From 3c08a4c381d78893be86dcb37519afeee420be97 Mon Sep 17 00:00:00 2001 From: Scott Kirkland Date: Wed, 13 Jul 2022 10:57:02 -0700 Subject: [PATCH 1/2] map buttons now disable when they can't be used --- src/components/Map/MapContainer.tsx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/components/Map/MapContainer.tsx b/src/components/Map/MapContainer.tsx index 94f9a54c..17a65b90 100644 --- a/src/components/Map/MapContainer.tsx +++ b/src/components/Map/MapContainer.tsx @@ -502,6 +502,9 @@ export const MapContainer = () => { const style = { height: window.innerHeight }; + + const allResultsSelected = selectedYearIndex === years.length; + return (
{(yearlyResults.length > 0 || loading) && ( @@ -511,6 +514,8 @@ export const MapContainer = () => { toggleMoveInGeoJson(h => !h); }} active={showMoveInGeoJson} + disabled={allResultsSelected} + title='Show Move-In Geometry in selected year' color='primary' className='toggle-buttons movein-toggle' > @@ -522,6 +527,8 @@ export const MapContainer = () => { toggleTransportationGeoJson(h => !h); }} active={showTransportationGeoJson} + disabled={allResultsSelected} + title='Show Transportation Geometry in selected year' color='primary' className='toggle-buttons transportation-toggle' > @@ -539,6 +546,7 @@ export const MapContainer = () => { toggleHeatmap(h => !h); }} active={showHeatmap} + title='Heatmap scaled by density of biomass' color='primary' className='toggle-buttons heatmap-toggle' > From 260a8d311458da22aa2175d02f14b7f3438a1870 Mon Sep 17 00:00:00 2001 From: Scott Kirkland Date: Wed, 13 Jul 2022 10:58:38 -0700 Subject: [PATCH 2/2] change wording fixes #240 and fixes #239 --- src/components/Map/MapContainer.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/Map/MapContainer.tsx b/src/components/Map/MapContainer.tsx index 17a65b90..fcaba1df 100644 --- a/src/components/Map/MapContainer.tsx +++ b/src/components/Map/MapContainer.tsx @@ -559,10 +559,11 @@ export const MapContainer = () => { toggleErrorGeoJson(!showErrorGeoJson); }} active={showErrorGeoJson} + title='Cluster zones which cannot be used for biomass' color='primary' className='toggle-buttons error-toggle' > - {isErrorZone ? 'Show Error Zones' : 'Hide Error Zones'} + {isErrorZone ? 'Show Unusable Zones' : 'Hide Unusable Zones'}