Skip to content

Commit

Permalink
fix: type issue in nutritionCloropleth
Browse files Browse the repository at this point in the history
  • Loading branch information
Lukas0912 committed Dec 19, 2024
1 parent f353031 commit 0f45e4d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
22 changes: 10 additions & 12 deletions src/components/Map/NutritionStateChoropleth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,15 @@ export default function NutritionStateChoropleth({
}, [selectedNutrient, regionNutrition]);

return (
regionNutrition && (
<GeoJSON
data={regionNutrition}
style={(feature) => 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);
}}
/>
)
<GeoJSON
data={regionNutrition}
style={(feature) => 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);
}}
/>
);
}
2 changes: 1 addition & 1 deletion src/domain/props/NutritionStateProps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<Geometry, GeoJsonProperties>;
countryMapData: CountryMapData;
Expand Down

0 comments on commit 0f45e4d

Please sign in to comment.