Skip to content

Commit

Permalink
Merge pull request #243 from ucdavis/srk/button-names
Browse files Browse the repository at this point in the history
update some text and set some auto-disabled
  • Loading branch information
srkirkland authored Jul 13, 2022
2 parents f433f82 + 260a8d3 commit 55c5fd9
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion 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 All @@ -551,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'
>
<span>{isErrorZone ? 'Show Error Zones' : 'Hide Error Zones'}</span>
<span>{isErrorZone ? 'Show Unusable Zones' : 'Hide Unusable Zones'}</span>
<FontAwesomeIcon icon={isErrorZone ? faEye : faEyeSlash} />
</Button>
<Button
Expand Down

0 comments on commit 55c5fd9

Please sign in to comment.