Merge pull request #1227 from colouring-cities/interface/ui-tweaks

Interface/UI tweaks
This commit is contained in:
Mike Simpson 2023-08-16 14:52:20 +01:00 committed by GitHub
commit 0cc0ed385f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 7 deletions

View File

@ -65,12 +65,14 @@ const AgeView: React.FunctionComponent<CategoryViewProps> = (props) => {
const switchToAgeMapStyle = (e) => { const switchToAgeMapStyle = (e) => {
e.preventDefault(); e.preventDefault();
if (props.mapColourScale == "survival_status") if (historicData === 'enabled') {
{
historicDataSwitchOnClick(e); historicDataSwitchOnClick(e);
} }
if (historicMap === 'enabled') {
historicMapSwitchOnClick(e);
}
props.onMapColourScale('date_year') props.onMapColourScale('date_year');
} }
const switchToStylePeriodMapStyle = (e) => { const switchToStylePeriodMapStyle = (e) => {
@ -498,7 +500,7 @@ const AgeView: React.FunctionComponent<CategoryViewProps> = (props) => {
Choose a colour to indicate whether the building has survived. Choose a colour to indicate whether the building has survived.
</i> </i>
</div> </div>
{(historicMap == "enabled") ? {(historicMap === "enabled") ?
<button className={`map-switcher-inline enabled-state btn btn-outline btn-outline-dark ${darkLightTheme}`} onClick={switchToAgeMapStyle}> <button className={`map-switcher-inline enabled-state btn btn-outline btn-outline-dark ${darkLightTheme}`} onClick={switchToAgeMapStyle}>
Click here to hide the 1890s OS historical map. Click here to hide the 1890s OS historical map.
</button> </button>
@ -507,7 +509,7 @@ const AgeView: React.FunctionComponent<CategoryViewProps> = (props) => {
Click here to show the 1890s OS historical map. Click here to show the 1890s OS historical map.
</button> </button>
} }
{(historicData == "enabled") ? {(historicData === "enabled") ?
<button className={`map-switcher-inline enabled-state btn btn-outline btn-outline-dark ${darkLightTheme}`} onClick={switchToAgeMapStyle}> <button className={`map-switcher-inline enabled-state btn btn-outline btn-outline-dark ${darkLightTheme}`} onClick={switchToAgeMapStyle}>
Click here to hide the 1890s OS historical map with modern footprints. Click here to hide the 1890s OS historical map with modern footprints.
</button> </button>

View File

@ -297,7 +297,7 @@ export const DisplayPreferencesProvider: React.FC<{}> = ({children}) => {
} }
flipHistoricData(e); flipHistoricData(e);
}, },
[historicData], [historicData, historicMap],
) )
const historicDataSwitchOnClick = (e) => { const historicDataSwitchOnClick = (e) => {
flipHistoricData(e) flipHistoricData(e)
@ -315,7 +315,7 @@ export const DisplayPreferencesProvider: React.FC<{}> = ({children}) => {
} }
fliphistoricMap(e); fliphistoricMap(e);
}, },
[historicMap], [historicMap, historicData],
) )
const historicMapSwitchOnClick = (e) => { const historicMapSwitchOnClick = (e) => {
fliphistoricMap(e) fliphistoricMap(e)