Functionality for 'historical maps' button

This commit is contained in:
Mike Simpson 2023-01-06 15:35:28 +00:00
parent b0707d47f0
commit 10872b8a45

View File

@ -17,6 +17,7 @@ import InfoBox from '../../components/info-box';
import { CategoryViewProps } from './category-view-props';
import { LogicalDataEntry } from '../data-components/logical-data-entry/logical-data-entry';
import { useDisplayPreferences } from '../../displayPreferences-context';
const HistoricalStatusOptions = [
'The current footprint matches/almost exactly matches the historical map beneath, and/or is known to have been built before the map was made',
@ -36,6 +37,8 @@ const AgeView: React.FunctionComponent<CategoryViewProps> = (props) => {
const ageLinkUrl = `/${props.mode}/${Category.Age}/${props.building.building_id}`;
const { historicData, historicDataSwitchOnClick } = useDisplayPreferences();
if (props.building.date_source == "Expert knowledge of building" ||
props.building.date_source == "Expert estimate from image" ||
props.building.date_source == null
@ -522,8 +525,8 @@ const AgeView: React.FunctionComponent<CategoryViewProps> = (props) => {
<InfoBox>
This section is under development.
</InfoBox>
<button className="map-switcher-inline btn btn-outline btn-outline-dark" /*onClick={}*/>
{'Click here for historical maps'}
<button className="map-switcher-inline btn btn-outline btn-outline-dark" onClick={historicDataSwitchOnClick}>
{(historicData === 'enabled')?'Click here to hide historical maps':'Click here to show historical maps'}
</button>
<SelectDataEntry
title={dataFields.historical_status.title}