From 08b78ac42fecd9e7948d276ad5fc2c2961eeae1c Mon Sep 17 00:00:00 2001 From: Simao Rodrigues Date: Fri, 21 Jun 2024 12:18:28 +0100 Subject: [PATCH] Fix incorrect type prop in the ConservationBuilderPage + typing --- frontend/src/containers/map/sidebar/index.tsx | 2 +- .../containers/map/sidebar/main-panel/panels/index.tsx | 2 +- frontend/src/layouts/map.tsx | 8 ++++++-- .../src/pages/conservation-builder/[locationCode].tsx | 2 +- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/frontend/src/containers/map/sidebar/index.tsx b/frontend/src/containers/map/sidebar/index.tsx index 4294934f..fb619b27 100644 --- a/frontend/src/containers/map/sidebar/index.tsx +++ b/frontend/src/containers/map/sidebar/index.tsx @@ -16,7 +16,7 @@ import LayersPanel from './layers-panel'; import MainPanel, { PANEL_TYPES } from './main-panel/panels'; type MapSidebarProps = { - type: keyof typeof PANEL_TYPES; + type: (typeof PANEL_TYPES)[keyof typeof PANEL_TYPES]; }; const MapSidebar: FCWithMessages = ({ type }) => { diff --git a/frontend/src/containers/map/sidebar/main-panel/panels/index.tsx b/frontend/src/containers/map/sidebar/main-panel/panels/index.tsx index 4412bf00..42a241c4 100644 --- a/frontend/src/containers/map/sidebar/main-panel/panels/index.tsx +++ b/frontend/src/containers/map/sidebar/main-panel/panels/index.tsx @@ -14,7 +14,7 @@ const SIDEBAR_COMPONENTS = { }; type PanelsProps = { - type: keyof typeof PANEL_TYPES; + type: (typeof PANEL_TYPES)[keyof typeof PANEL_TYPES]; }; const MainPanel: FCWithMessages = ({ type }) => { diff --git a/frontend/src/layouts/map.tsx b/frontend/src/layouts/map.tsx index 2dab6213..998e6850 100644 --- a/frontend/src/layouts/map.tsx +++ b/frontend/src/layouts/map.tsx @@ -18,7 +18,7 @@ const LAYOUT_TYPES = { export interface MapLayoutProps { title?: string; description?: string; - type: keyof typeof LAYOUT_TYPES; + type: (typeof LAYOUT_TYPES)[keyof typeof LAYOUT_TYPES]; } const MapLayout: FCWithMessages> = ({ @@ -41,7 +41,11 @@ const MapLayout: FCWithMessages> = ({ return ( <>
diff --git a/frontend/src/pages/conservation-builder/[locationCode].tsx b/frontend/src/pages/conservation-builder/[locationCode].tsx index 1b918637..fe381778 100644 --- a/frontend/src/pages/conservation-builder/[locationCode].tsx +++ b/frontend/src/pages/conservation-builder/[locationCode].tsx @@ -26,7 +26,7 @@ ConservationBuilderPage.layout = { Component: MapLayout, props: { title: '', - type: 'conservation_builder', + type: 'conservation-builder', }, };