From 6afd60b35650025c66dcc1e6bd7d17029105d1a1 Mon Sep 17 00:00:00 2001 From: Simao Rodrigues Date: Fri, 10 Nov 2023 11:16:05 +0000 Subject: [PATCH] Remove mentions to Sidebar from map; it is in a sub-component and doesn't need to worry about it --- .../containers/data-tool/content/map/index.tsx | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/frontend/src/containers/data-tool/content/map/index.tsx b/frontend/src/containers/data-tool/content/map/index.tsx index 4eb649aa..a35b13a5 100644 --- a/frontend/src/containers/data-tool/content/map/index.tsx +++ b/frontend/src/containers/data-tool/content/map/index.tsx @@ -15,7 +15,6 @@ import LabelsManager from '@/containers/data-tool/content/map/labels-manager'; import LayersToolbox from '@/containers/data-tool/content/map/layers-toolbox'; import { useSyncMapSettings } from '@/containers/data-tool/content/map/sync-settings'; import { cn } from '@/lib/classnames'; -import { sidebarAtom } from '@/store/data-tool'; import { drawStateAtom, layersInteractiveAtom, @@ -38,7 +37,6 @@ const DataToolMap: React.FC = () => { const setPopup = useSetAtom(popupAtom); const queryClient = useQueryClient(); const { locationCode } = useParams(); - const isSidebarOpen = useAtomValue(sidebarAtom); const hoveredPolygonId = useRef(null); const locationData = queryClient.getQueryData([ @@ -132,18 +130,6 @@ const DataToolMap: React.FC = () => { const bounds = customBbox ?? (locationData?.attributes?.bounds as LngLatBoundsLike); - useEffect(() => { - map?.easeTo({ - padding: { - top: 0, - bottom: 0, - left: isSidebarOpen ? 430 : 0, - right: 0, - }, - duration: 500, - }); - }, [isSidebarOpen, map]); - useEffect(() => { const { queryKey } = getGetLocationsQueryOptions(); const d = queryClient.getQueryData(queryKey); @@ -154,12 +140,12 @@ const DataToolMap: React.FC = () => { padding: { top: 0, bottom: 0, - left: isSidebarOpen ? 430 : 0, + left: 0, right: 0, }, }); } - }, [queryClient, locationCode, isSidebarOpen, map]); + }, [queryClient, locationCode, map]); return (