feat(map geolocation error ): showing error when geolocation disabled

This commit is contained in:
Laurian-Dufrechou
2023-04-28 18:51:50 +02:00
parent 6da8d263f6
commit c78b6e67c8
3 changed files with 59 additions and 10 deletions
+25
View File
@@ -0,0 +1,25 @@
import { MdError } from "react-icons/md";
import { Button, Text, VStack } from "@chakra-ui/react";
import { useRouter } from "next/router";
export default function LoadingPage() {
const router = useRouter();
return (
<VStack
justifyContent="center"
alignItems="center"
height="100vh"
width="100vw"
bg="gray.100"
>
<MdError color="purple.500" size="50%" />
<Text color="purple.500" fontSize="2xl" fontWeight="bold">
Veillez à autoriser la géolocalisation
</Text>
<Button colorScheme={"purple"} onClick={() => router.push("/")}>
Page d'accueuil
</Button>
</VStack>
);
}
+2 -1
View File
@@ -10,7 +10,7 @@ import "leaflet/dist/leaflet.css";
export default function MapComponent(props: any) {
const { location, listBars } = props;
const toast = useToast({ position: "top" });
const toast = useToast({ position: "bottom" });
const idToastError = "error_location";
@@ -43,6 +43,7 @@ export default function MapComponent(props: any) {
center={location}
zoom={13}
minZoom={8}
zoomControl={false}
style={{
width: "100vw",
height: "100vw",