Revert "unroll layer option on using buttons"

This reverts commit 5a59815234.
This commit is contained in:
Mateusz Konieczny 2023-01-24 10:34:39 +01:00
parent 6463044aab
commit 4a61f19103

View File

@ -176,7 +176,6 @@ export const DisplayPreferencesProvider: React.FC<{}> = ({children}) => {
e.preventDefault(); e.preventDefault();
const newVista = (vista === 'enabled')? 'disabled' : 'enabled'; const newVista = (vista === 'enabled')? 'disabled' : 'enabled';
setVista(newVista); setVista(newVista);
setShowLayerSelection('enabled')
}, },
[vista], [vista],
) )
@ -185,7 +184,6 @@ export const DisplayPreferencesProvider: React.FC<{}> = ({children}) => {
e.preventDefault(); e.preventDefault();
const newVista = (vista === 'enabled')? 'disabled' : 'enabled'; const newVista = (vista === 'enabled')? 'disabled' : 'enabled';
setVista(newVista); setVista(newVista);
setShowLayerSelection('enabled')
} }
const floodSwitch = useCallback( const floodSwitch = useCallback(
@ -193,7 +191,6 @@ export const DisplayPreferencesProvider: React.FC<{}> = ({children}) => {
e.preventDefault(); e.preventDefault();
const newFlood = (flood === 'enabled')? 'disabled' : 'enabled'; const newFlood = (flood === 'enabled')? 'disabled' : 'enabled';
setFlood(newFlood); setFlood(newFlood);
setShowLayerSelection('enabled')
}, },
[flood], [flood],
) )
@ -202,7 +199,6 @@ export const DisplayPreferencesProvider: React.FC<{}> = ({children}) => {
e.preventDefault(); e.preventDefault();
const newFlood = (flood === 'enabled')? 'disabled' : 'enabled'; const newFlood = (flood === 'enabled')? 'disabled' : 'enabled';
setFlood(newFlood); setFlood(newFlood);
setShowLayerSelection('enabled')
} }
const housingSwitch = useCallback( const housingSwitch = useCallback(
@ -210,7 +206,6 @@ export const DisplayPreferencesProvider: React.FC<{}> = ({children}) => {
e.preventDefault(); e.preventDefault();
const newHousing = (housing === 'enabled')? 'disabled' : 'enabled'; const newHousing = (housing === 'enabled')? 'disabled' : 'enabled';
setHousing(newHousing); setHousing(newHousing);
setShowLayerSelection('enabled')
}, },
[housing], [housing],
) )
@ -219,7 +214,6 @@ export const DisplayPreferencesProvider: React.FC<{}> = ({children}) => {
e.preventDefault(); e.preventDefault();
const newHousing = (housing === 'enabled')? 'disabled' : 'enabled'; const newHousing = (housing === 'enabled')? 'disabled' : 'enabled';
setHousing(newHousing); setHousing(newHousing);
setShowLayerSelection('enabled')
} }
const creativeSwitch = useCallback( const creativeSwitch = useCallback(
@ -227,7 +221,6 @@ export const DisplayPreferencesProvider: React.FC<{}> = ({children}) => {
e.preventDefault(); e.preventDefault();
const newCreative = (creative === 'enabled')? 'disabled' : 'enabled'; const newCreative = (creative === 'enabled')? 'disabled' : 'enabled';
setCreative(newCreative); setCreative(newCreative);
setShowLayerSelection('enabled')
}, },
[creative], [creative],
) )
@ -236,7 +229,6 @@ export const DisplayPreferencesProvider: React.FC<{}> = ({children}) => {
e.preventDefault(); e.preventDefault();
const newCreative = (creative === 'enabled')? 'disabled' : 'enabled'; const newCreative = (creative === 'enabled')? 'disabled' : 'enabled';
setCreative(newCreative); setCreative(newCreative);
setShowLayerSelection('enabled')
} }
const boroughSwitch = useCallback( const boroughSwitch = useCallback(
@ -252,9 +244,6 @@ export const DisplayPreferencesProvider: React.FC<{}> = ({children}) => {
e.preventDefault(); e.preventDefault();
const newBorough = (borough === 'enabled')? 'disabled' : 'enabled'; const newBorough = (borough === 'enabled')? 'disabled' : 'enabled';
setBorough(newBorough); setBorough(newBorough);
if(newBorough === 'enabled') {
setShowLayerSelection('enabled')
}
} }
const parcelSwitch = useCallback( const parcelSwitch = useCallback(
@ -270,9 +259,6 @@ export const DisplayPreferencesProvider: React.FC<{}> = ({children}) => {
e.preventDefault(); e.preventDefault();
const newParcel = (parcel === 'enabled')? 'disabled' : 'enabled'; const newParcel = (parcel === 'enabled')? 'disabled' : 'enabled';
setParcel(newParcel); setParcel(newParcel);
if(newParcel === 'enabled') {
setShowLayerSelection('enabled')
}
} }
const conservationSwitch = useCallback( const conservationSwitch = useCallback(
@ -288,9 +274,6 @@ export const DisplayPreferencesProvider: React.FC<{}> = ({children}) => {
e.preventDefault(); e.preventDefault();
const newConservation = (conservation === 'enabled')? 'disabled' : 'enabled'; const newConservation = (conservation === 'enabled')? 'disabled' : 'enabled';
setConservation(newConservation); setConservation(newConservation);
if(newConservation === 'enabled') {
setShowLayerSelection('enabled')
}
} }
const historicDataSwitch = useCallback( const historicDataSwitch = useCallback(
@ -306,9 +289,6 @@ export const DisplayPreferencesProvider: React.FC<{}> = ({children}) => {
e.preventDefault(); e.preventDefault();
const newHistoric = (historicData === 'enabled')? 'disabled' : 'enabled'; const newHistoric = (historicData === 'enabled')? 'disabled' : 'enabled';
setHistoricData(newHistoric); setHistoricData(newHistoric);
if(newHistoric === 'enabled') {
setShowLayerSelection('enabled')
}
} }
const darkLightThemeSwitch = useCallback( const darkLightThemeSwitch = useCallback(