Skip to content

Commit

Permalink
Remove mentions to Sidebar from map; it is in a sub-component and doe…
Browse files Browse the repository at this point in the history
…sn't need to worry about it
  • Loading branch information
SARodrigues committed Nov 10, 2023
1 parent c2b56c5 commit 6afd60b
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions frontend/src/containers/data-tool/content/map/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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<string | number | null>(null);

const locationData = queryClient.getQueryData<LocationResponseDataObject>([
Expand Down Expand Up @@ -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<LocationListResponse>(queryKey);
Expand All @@ -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 (
<div className="absolute left-0 h-full w-full">
Expand Down

0 comments on commit 6afd60b

Please sign in to comment.