diff --git a/src/components/ScrollToTop/ScrollToTop.tsx b/src/components/ScrollToTop/ScrollToTop.tsx index 6861e6b3..99ed8d9c 100644 --- a/src/components/ScrollToTop/ScrollToTop.tsx +++ b/src/components/ScrollToTop/ScrollToTop.tsx @@ -5,7 +5,7 @@ import { useLocation } from 'react-router-dom' * Function that can be called to bring the user's screen to the top of the page. */ export default function ScrollToTop() { - const { pathname } = useLocation() + const { pathname, key } = useLocation() useEffect(() => { window.scrollTo({ @@ -13,7 +13,7 @@ export default function ScrollToTop() { top: 0, behavior: 'instant', }) - }, [pathname]) + }, [pathname, key]) return null } diff --git a/src/pages/public/Home/SearchSection/SearchSection.tsx b/src/pages/public/Home/SearchSection/SearchSection.tsx index 4ca0f0da..b339dd98 100644 --- a/src/pages/public/Home/SearchSection/SearchSection.tsx +++ b/src/pages/public/Home/SearchSection/SearchSection.tsx @@ -25,6 +25,7 @@ const SearchSection = () => ( controllers={{ showSearch: false, showDraw: true, + showLayers: false, }} className="w-full rounded border border-pzh-gray-300" /> diff --git a/src/pages/public/MapSearch/SidebarInformation/SidebarInformation.tsx b/src/pages/public/MapSearch/SidebarInformation/SidebarInformation.tsx index fc9934ee..8a4baf7c 100644 --- a/src/pages/public/MapSearch/SidebarInformation/SidebarInformation.tsx +++ b/src/pages/public/MapSearch/SidebarInformation/SidebarInformation.tsx @@ -1,11 +1,10 @@ import { Transition } from '@headlessui/react' -import { FieldSelect, Heading, Text } from '@pzh-ui/components' +import { Heading, Text } from '@pzh-ui/components' import { ArrowLeft, DrawPolygon, LocationDot } from '@pzh-ui/icons' import Leaflet, { latLng } from 'leaflet' -import { ReactNode, useEffect, useMemo, useState } from 'react' +import { ReactNode, useEffect, useState } from 'react' import { useNavigate } from 'react-router-dom' -import { useWerkingsgebiedenValidGet } from '@/api/fetchers' import { LeafletSearchInput } from '@/components/Leaflet' import { MAP_SEARCH_PAGE } from '@/constants/leaflet' import useSearchParam from '@/hooks/useSearchParam' @@ -32,24 +31,24 @@ const SidebarInformation = ({ onDraw }: SidebarInformationProps) => { const [werkingsgebied, setWerkingsgebied] = useState(null) - const { data, isLoading } = useWerkingsgebiedenValidGet({ - limit: 1000, - sort_column: 'Title', - sort_order: 'ASC', - }) - const selectedVal = useMemo( - () => data?.results.find(item => item.UUID === paramWerkingsgebied), - [data, paramWerkingsgebied] - ) - - const options = useMemo( - () => - data?.results.map(option => ({ - label: option.Title, - value: option.Area_UUID, - })), - [data] - ) + // const { data, isLoading } = useWerkingsgebiedenValidGet({ + // limit: 1000, + // sort_column: 'Title', + // sort_order: 'ASC', + // }) + // const selectedVal = useMemo( + // () => data?.results.find(item => item.UUID === paramWerkingsgebied), + // [data, paramWerkingsgebied] + // ) + + // const options = useMemo( + // () => + // data?.results.map(option => ({ + // label: option.Title, + // value: option.Area_UUID, + // })), + // [data] + // ) const goBack = () => { navigate(MAP_SEARCH_PAGE) @@ -149,7 +148,7 @@ const SidebarInformation = ({ onDraw }: SidebarInformationProps) => { )} - @@ -186,7 +185,7 @@ const SidebarInformation = ({ onDraw }: SidebarInformationProps) => { ) }} /> - )} + )} */} number({