From 21aafc4af3f2778ba0df87a5cd64586464ef2984 Mon Sep 17 00:00:00 2001 From: David Inga Date: Wed, 28 Feb 2024 11:02:14 +0100 Subject: [PATCH] eudr page and layout --- client/src/components/map/types.d.ts | 2 +- .../containers/collapse-button/component.tsx | 17 +-- .../src/containers/collapse-button/index.tsx | 20 ++- client/src/layouts/application/component.tsx | 9 ++ client/src/pages/eudr/index.tsx | 115 ++++++++++++++++++ 5 files changed, 150 insertions(+), 13 deletions(-) create mode 100644 client/src/pages/eudr/index.tsx diff --git a/client/src/components/map/types.d.ts b/client/src/components/map/types.d.ts index 2e19a87a3..2db511b8b 100644 --- a/client/src/components/map/types.d.ts +++ b/client/src/components/map/types.d.ts @@ -10,7 +10,7 @@ export interface CustomMapProps extends MapProps { /** Custom css class for styling */ className?: string; - mapStyle: MapStyle; + mapStyle?: MapStyle; /** An object that defines the viewport * @see https://visgl.github.io/react-map-gl/docs/api-reference/map#initialviewstate diff --git a/client/src/containers/collapse-button/component.tsx b/client/src/containers/collapse-button/component.tsx index 26958d1ad..9b2175e33 100644 --- a/client/src/containers/collapse-button/component.tsx +++ b/client/src/containers/collapse-button/component.tsx @@ -1,18 +1,13 @@ import { useCallback } from 'react'; import { ChevronLeftIcon, ChevronRightIcon } from '@heroicons/react/outline'; -import { useAppSelector, useAppDispatch } from 'store/hooks'; -import { analysisUI, setSidebarCollapsed } from 'store/features/analysis/ui'; - const ICON_CLASSNAMES = 'h-4 w-4 text-gray-900'; -const CollapseButton: React.FC = () => { - const { isSidebarCollapsed } = useAppSelector(analysisUI); - const dispatch = useAppDispatch(); - - const handleClick = useCallback(() => { - dispatch(setSidebarCollapsed(!isSidebarCollapsed)); - }, [dispatch, isSidebarCollapsed]); +const CollapseButton: React.FC<{ + isCollapsed: boolean; + onClick: (isCollapsed: boolean) => void; +}> = ({ isCollapsed, onClick }) => { + const handleClick = useCallback(() => onClick(!isCollapsed), [isCollapsed, onClick]); return (