diff --git a/client/src/components/flami/FlamiShow.tsx b/client/src/components/flami/FlamiShow.tsx index 06db6ac..c6a7a7e 100644 --- a/client/src/components/flami/FlamiShow.tsx +++ b/client/src/components/flami/FlamiShow.tsx @@ -9,11 +9,11 @@ const FlamiShow = ({ flami }: { flami: FlamiData }) => { useEffect(() => { setCurrentAnimation("Jump"); - setCurrentKeptAnimation("Atchoum"); + setCurrentKeptAnimation("Jump"); setTimeout(() => { setCurrentAnimation("Idle"); setCurrentKeptAnimation("Idle"); - }, 3200); + }, 1300); }, [setCurrentAnimation]); return ( diff --git a/client/src/components/map/Map.tsx b/client/src/components/map/Map.tsx index 154a260..d315a41 100644 --- a/client/src/components/map/Map.tsx +++ b/client/src/components/map/Map.tsx @@ -8,12 +8,13 @@ import { } from "react-leaflet"; import { Icon, LatLng } from "leaflet"; import { Step } from "../../interfaces/step.interface"; -import { useEffect } from "react"; +import { useEffect, useState } from "react"; import { Button } from "../ui"; import { APIHandler } from "../../utils/api/api-handler"; import { useAuth } from "../../hooks/useAuth"; import toast from "react-hot-toast"; import { GenericResponse } from "../../interfaces/api-response/generic-response"; +import { SearchIcon } from "react-line-awesome"; const Map = ({ currentStep, @@ -41,12 +42,11 @@ const Map = ({ iconSize: [40, 40], }); - const geolocalisation = currentStep - ? new LatLng( - currentStep.geolocalisation.latitude, - currentStep.geolocalisation.longitude - ) - : new LatLng(43.282, 5.405); + const [geolocalisation, setGeolocation] = useState(new LatLng(43.282, 5.405)); + + useEffect(() => { + if(currentStep) setGeolocation(new LatLng(currentStep.geolocalisation.latitude, currentStep.geolocalisation.longitude)) + }, [currentStep, setGeolocation]) const MapRecenter = ({ lat, @@ -66,7 +66,17 @@ const Map = ({ }; return ( -