diff --git a/apps/climatemappedafrica/src/components/DropdownSearch/DownloadSearch.js b/apps/climatemappedafrica/src/components/DropdownSearch/DownloadSearch.js index 8b8c45e3e..a5a129e48 100644 --- a/apps/climatemappedafrica/src/components/DropdownSearch/DownloadSearch.js +++ b/apps/climatemappedafrica/src/components/DropdownSearch/DownloadSearch.js @@ -175,6 +175,7 @@ function DropdownSearch({ {suggestions.map(({ name, code }) => ( handleSelect(code, name)} diff --git a/apps/climatemappedafrica/src/components/ExplorePage/index.js b/apps/climatemappedafrica/src/components/ExplorePage/index.js index 3449e5482..c92939648 100644 --- a/apps/climatemappedafrica/src/components/ExplorePage/index.js +++ b/apps/climatemappedafrica/src/components/ExplorePage/index.js @@ -82,7 +82,7 @@ function ExplorePage({ if (geoCode) { dispatch({ type: "fetch", - payload: { code: geoCode, onClick: handleClickTag }, + payload: { code: geoCode }, }); } }, [dispatch, geoCode]); @@ -129,6 +129,8 @@ function ExplorePage({ }; const handleClickMap = (_, feature) => { + const code = feature?.properties?.code; + setGeoCode(code); return handleSelectLocation(feature.properties); }; diff --git a/apps/climatemappedafrica/src/components/HURUmap/Chart/index.js b/apps/climatemappedafrica/src/components/HURUmap/Chart/index.js index 5ac66afd9..df51f08fd 100644 --- a/apps/climatemappedafrica/src/components/HURUmap/Chart/index.js +++ b/apps/climatemappedafrica/src/components/HURUmap/Chart/index.js @@ -2,7 +2,6 @@ import { RichTypography } from "@commons-ui/next"; import { ChartTooltip, IndicatorTitle, Download, Share } from "@hurumap/core"; import { Source } from "@hurumap/next"; import { Box, useMediaQuery, useTheme } from "@mui/material"; -import { debounce } from "lodash"; import React, { useState, useRef, useCallback, useEffect } from "react"; import * as vega from "vega"; import embed from "vega-embed"; @@ -68,25 +67,9 @@ function Chart({ const handler = useCallback( (_, event, item, value) => { - const debouncedTooltip = debounce((e, i, v) => { - if (!v) { - setTooltipData(null); - return; - } - if ( - !tooltipData || - tooltipData.value?.group !== v?.group || - tooltipData.event?.clientX !== e?.clientX || - tooltipData.event?.clientY !== e?.clientY - ) { - setTooltipData({ item: i, value: v, id, geoCode, event: e }); - } - }, 50); - - debouncedTooltip(event, item, value); - return () => debouncedTooltip.cancel(); + setTooltipData({ item, value, id, geoCode, event }); }, - [id, geoCode, tooltipData], + [id, geoCode], ); useEffect(() => { diff --git a/apps/climatemappedafrica/src/components/HURUmap/Panel/DesktopPanel/DesktopPanel.js b/apps/climatemappedafrica/src/components/HURUmap/Panel/DesktopPanel/DesktopPanel.js index 2a17f726b..67117244b 100644 --- a/apps/climatemappedafrica/src/components/HURUmap/Panel/DesktopPanel/DesktopPanel.js +++ b/apps/climatemappedafrica/src/components/HURUmap/Panel/DesktopPanel/DesktopPanel.js @@ -47,7 +47,7 @@ function DesktopPanel({ sx, ...props }) { overscrollBehaviorBlock: "none", }, }} - variant="persistent" + {...(open && { variant: "persistent" })} PaperProps={{ elevation: 0, square: true, diff --git a/apps/climatemappedafrica/src/lib/data/blockify/hero.js b/apps/climatemappedafrica/src/lib/data/blockify/hero.js index d4142c684..cfc753309 100644 --- a/apps/climatemappedafrica/src/lib/data/blockify/hero.js +++ b/apps/climatemappedafrica/src/lib/data/blockify/hero.js @@ -24,8 +24,8 @@ export default async function hero(block, _api, _context, { hurumap }) { }); const { level } = geometries.boundary?.properties ?? {}; const childLevelMaps = { - continent: "country", - country: "region", + Continent: "Country", + Country: "Region", }; const childLevel = childLevelMaps[level]; const { locations, preferredChildren } = await fetchProfile({ diff --git a/apps/pesayetu/src/components/DropdownSearch/index.js b/apps/pesayetu/src/components/DropdownSearch/index.js index 2b5eabc00..36f05875f 100644 --- a/apps/pesayetu/src/components/DropdownSearch/index.js +++ b/apps/pesayetu/src/components/DropdownSearch/index.js @@ -151,6 +151,7 @@ function DropdownSearch({ {suggestions.map(({ name, code }) => ( handleSelect(code, name)} diff --git a/apps/pesayetu/src/components/ExplorePage/index.js b/apps/pesayetu/src/components/ExplorePage/index.js index 38a2f6dae..570958691 100644 --- a/apps/pesayetu/src/components/ExplorePage/index.js +++ b/apps/pesayetu/src/components/ExplorePage/index.js @@ -72,6 +72,8 @@ function ExplorePage({ panelProps, profile: profileProp, ...props }) { }; const handleClickMap = (_, feature) => { + const code = feature?.properties?.code; + setGeoCode(code); return handleSelectLocation(feature.properties); };