From 0f45e4dd9d3372e752e9e8d5cbfa62732c706e13 Mon Sep 17 00:00:00 2001 From: Lukas0912 Date: Thu, 19 Dec 2024 21:58:26 +0100 Subject: [PATCH] fix: type issue in nutritionCloropleth --- .../Map/NutritionStateChoropleth.tsx | 22 +++++++++---------- src/domain/props/NutritionStateProps.ts | 2 +- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/src/components/Map/NutritionStateChoropleth.tsx b/src/components/Map/NutritionStateChoropleth.tsx index 44e8f9c8..38247e9c 100644 --- a/src/components/Map/NutritionStateChoropleth.tsx +++ b/src/components/Map/NutritionStateChoropleth.tsx @@ -31,17 +31,15 @@ export default function NutritionStateChoropleth({ }, [selectedNutrient, regionNutrition]); return ( - regionNutrition && ( - NutritionStateChoroplethOperations.dynamicStyle(feature, selectedNutrient)} - onEachFeature={(feature, layer) => { - layersRef.current.push(layer); - NutritionStateChoroplethOperations.addNutritionTooltip(layer, feature, selectedNutrient); - NutritionStateChoroplethOperations.addHoverEffect(layer); - MapOperations.setupRegionLabelTooltip(feature, regionLabelData, countryMapData, map, setRegionLabelTooltips); - }} - /> - ) + NutritionStateChoroplethOperations.dynamicStyle(feature, selectedNutrient)} + onEachFeature={(feature, layer) => { + layersRef.current.push(layer); + NutritionStateChoroplethOperations.addNutritionTooltip(layer, feature, selectedNutrient); + NutritionStateChoroplethOperations.addHoverEffect(layer); + MapOperations.setupRegionLabelTooltip(feature, regionLabelData, countryMapData, map, setRegionLabelTooltips); + }} + /> ); } diff --git a/src/domain/props/NutritionStateProps.ts b/src/domain/props/NutritionStateProps.ts index c2b3e068..63783084 100644 --- a/src/domain/props/NutritionStateProps.ts +++ b/src/domain/props/NutritionStateProps.ts @@ -5,7 +5,7 @@ import { CountryMapData } from '@/domain/entities/country/CountryMapData.ts'; import { NutrientType } from '@/domain/enums/NutrientType.ts'; export interface NutritionStateChoroplethProps { - regionNutrition?: FeatureCollection; + regionNutrition: FeatureCollection; setRegionLabelTooltips: (tooltips: (prevRegionLabelData: L.Tooltip[]) => L.Tooltip[]) => void; regionLabelData: FeatureCollection; countryMapData: CountryMapData;