mirror of
https://github.com/LucasVbr/meeting-app.git
synced 2026-12-05 17:30:50 +00:00
fix(map): Fix logout
Took 1 hour 16 minutes
This commit is contained in:
@@ -2,7 +2,7 @@ import { MdError } from "react-icons/md";
|
||||
import { Button, Text, VStack } from "@chakra-ui/react";
|
||||
import { useRouter } from "next/router";
|
||||
|
||||
export default function LoadingPage() {
|
||||
export default function ErrorGeoLocation() {
|
||||
const router = useRouter();
|
||||
|
||||
return (
|
||||
|
||||
@@ -2,7 +2,7 @@ import { MdError } from "react-icons/md";
|
||||
import { Button, Text, VStack } from "@chakra-ui/react";
|
||||
import { useRouter } from "next/router";
|
||||
|
||||
export default function LoadingPage() {
|
||||
export default function ErrorPage() {
|
||||
const router = useRouter();
|
||||
|
||||
return (
|
||||
|
||||
@@ -29,10 +29,7 @@ export default function Navbar({variant = 'fixed'}: Props) {
|
||||
|
||||
return (
|
||||
<Flex gap={5} justify={'center'} flexBasis={'100%'}>
|
||||
{status === 'authenticated'
|
||||
? authenticatedLinks
|
||||
: <></>
|
||||
}
|
||||
{status === 'authenticated' && authenticatedLinks}
|
||||
</Flex>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import {MapContainer, TileLayer, Marker, Popup} from 'react-leaflet';
|
||||
import {MapContainer, TileLayer, Marker} from 'react-leaflet';
|
||||
import {Flex, Text, useToast} from '@chakra-ui/react';
|
||||
import MarkerClusterGroup
|
||||
from '@christopherpickering/react-leaflet-markercluster';
|
||||
import MarkerClusterGroup from '@christopherpickering/react-leaflet-markercluster';
|
||||
|
||||
import '@christopherpickering/react-leaflet-markercluster/dist/styles.min.css';
|
||||
|
||||
@@ -15,46 +14,45 @@ export default function MapComponent(props: any) {
|
||||
|
||||
const idToastError = 'error_location';
|
||||
|
||||
const userIcon = new L.Icon({
|
||||
iconUrl: 'logo.svg',
|
||||
iconSize: [35, 35],
|
||||
});
|
||||
const userIcon = new L.Icon({iconUrl: 'logo.svg', iconSize: [35, 35]});
|
||||
|
||||
if (!location[0] || !location[1]) return (
|
||||
<>
|
||||
{!toast.isActive(idToastError) &&
|
||||
toast({
|
||||
title: 'Erreur',
|
||||
id: idToastError,
|
||||
description: 'Veuillez autoriser la localisation',
|
||||
status: 'error',
|
||||
isClosable: false,
|
||||
duration: 100000,
|
||||
})}
|
||||
<Text color="purple.500" fontSize="2xl" fontWeight="bold">
|
||||
Veuillez autoriser la localisation
|
||||
</Text>
|
||||
</>
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
{location[0] === null || location[1] === null ? (
|
||||
<>
|
||||
{!toast.isActive(idToastError) &&
|
||||
toast({
|
||||
title: 'Erreur',
|
||||
id: idToastError,
|
||||
description: 'Veuillez autoriser la localisation',
|
||||
status: 'error',
|
||||
isClosable: false,
|
||||
duration: 100000,
|
||||
})}
|
||||
<Text color="purple.500" fontSize="2xl" fontWeight="bold">
|
||||
Veuillez autoriser la localisation
|
||||
</Text>
|
||||
</>
|
||||
) : (
|
||||
<Flex>
|
||||
<MapContainer center={location} zoom={13} minZoom={8}
|
||||
zoomControl={false}
|
||||
style={{width: '100vw', height: '100vw'}}>
|
||||
<TileLayer
|
||||
url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
|
||||
attribution='© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
|
||||
/>
|
||||
{/* Pour le user */}
|
||||
<Marker icon={userIcon} position={location}></Marker>
|
||||
<Flex>
|
||||
<MapContainer center={location} zoom={13} minZoom={8}
|
||||
zoomControl={false}
|
||||
style={{width: '100vw', height: '100vw'}}>
|
||||
<TileLayer
|
||||
url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
|
||||
attribution='© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
|
||||
/>
|
||||
{/* Pour le user */}
|
||||
<Marker icon={userIcon} position={location}></Marker>
|
||||
|
||||
<MarkerClusterGroup chunkedLoading showCoverageOnHover={false}>
|
||||
{listBars.map((bar: any, index: number) => <MarkerBar key={index} bar={bar}/>)}
|
||||
</MarkerClusterGroup>
|
||||
</MapContainer>
|
||||
</Flex>
|
||||
)}
|
||||
<MarkerClusterGroup chunkedLoading showCoverageOnHover={false}>
|
||||
{listBars.map((bar: any, index: number) =>
|
||||
<MarkerBar key={index} bar={bar}/>
|
||||
)}
|
||||
</MarkerClusterGroup>
|
||||
</MapContainer>
|
||||
</Flex>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user