Skip to content

Commit

Permalink
Merge pull request #274 from Vizzuality/fix-conservation-builder-page…
Browse files Browse the repository at this point in the history
…-type

Fix incorrect type prop in the ConservationBuilderPage + typing
  • Loading branch information
SARodrigues authored Jun 21, 2024
2 parents c8c741f + 08b78ac commit 61908d5
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion frontend/src/containers/map/sidebar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<MapSidebarProps> = ({ type }) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<PanelsProps> = ({ type }) => {
Expand Down
8 changes: 6 additions & 2 deletions frontend/src/layouts/map.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<PropsWithChildren<MapLayoutProps>> = ({
Expand All @@ -41,7 +41,11 @@ const MapLayout: FCWithMessages<PropsWithChildren<MapLayoutProps>> = ({
return (
<>
<Head
title={!title.length && type === 'conservation_builder' ? t('conservation-builder') : title}
title={
!title.length && type === LAYOUT_TYPES.conservation_builder
? t('conservation-builder')
: title
}
description={description}
/>
<div className="flex h-screen w-screen flex-col">
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/conservation-builder/[locationCode].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ ConservationBuilderPage.layout = {
Component: MapLayout,
props: {
title: '',
type: 'conservation_builder',
type: 'conservation-builder',
},
};

Expand Down

0 comments on commit 61908d5

Please sign in to comment.