Skip to content

Commit

Permalink
map buttons now disable when they can't be used
Browse files Browse the repository at this point in the history
  • Loading branch information
srkirkland committed Jul 13, 2022
1 parent f433f82 commit 3c08a4c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/components/Map/MapContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,9 @@ export const MapContainer = () => {
const style = {
height: window.innerHeight
};

const allResultsSelected = selectedYearIndex === years.length;

return (
<div style={style}>
{(yearlyResults.length > 0 || loading) && (
Expand All @@ -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'
>
Expand All @@ -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'
>
Expand All @@ -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'
>
Expand Down

0 comments on commit 3c08a4c

Please sign in to comment.