Fix Key change buttons

This commit is contained in:
Mike Simpson 2023-06-06 14:48:15 +01:00
parent 2da2834a72
commit 435d0cb2f3

View File

@ -7,7 +7,6 @@ import { MultiSelectDataEntry } from '../data-components/multi-select-data-entry
import { DataEntryGroup } from '../data-components/data-entry-group';
import { CategoryViewProps } from './category-view-props';
import InfoBox from '../../components/info-box';
import { LogicalDataEntry, LogicalDataEntryYesOnlyWithExplanation } from '../data-components/logical-data-entry/logical-data-entry';
import { buildingUserFields, dataFields } from '../../config/data-fields-config';
@ -47,9 +46,7 @@ const CommunityView: React.FunctionComponent<CategoryViewProps> = (props) => {
</i>
</div>
<div className='community-opinion-pane'>
{
(props.building.is_domestic === "no" || props.building.is_domestic === "mixed domestic/non-domestic") ?
{(props.building.is_domestic === "no" || props.building.is_domestic === "mixed domestic/non-domestic") ?
<>
<UserOpinionEntry
slug='community_like'
@ -61,13 +58,10 @@ const CommunityView: React.FunctionComponent<CategoryViewProps> = (props) => {
mode={props.mode}
copy={props.copy}
/>
<button className={`map-switcher-inline ${props.mapColourScale == "likes" ? "enabled-state" : "disabled-state"} btn btn-outline btn-outline-dark ${darkLightTheme}`}>
{(props.mapColourScale == "likes")? 'Showing likes for specific buildings' : 'Click to see likes for specific buildings mapped'}
</button>
</>
: <></>}
:
<></>
}
<LogicalDataEntryYesOnlyWithExplanation
slug='community_type_worth_keeping'
title={buildingUserFields.community_type_worth_keeping.title}
@ -80,6 +74,15 @@ const CommunityView: React.FunctionComponent<CategoryViewProps> = (props) => {
mode={props.mode}
/>
{(props.mapColourScale == "typology_likes") ?
<button className={`map-switcher-inline enabled-state btn btn-outline btn-outline-dark ${darkLightTheme}`} onClick={switchToLocalSignificanceMapStyle}>
{'Click here to change map to buildings of local interest.'}
</button>
:
<button className={`map-switcher-inline disabled-state btn btn-outline btn-outline-dark ${darkLightTheme}`} onClick={switchToTypologyMapStyle}>
{"Click to return to liked typologies mapped."}
</button>
}
{
props.building.community_type_worth_keeping === true &&
<MultiSelectDataEntry
@ -99,16 +102,7 @@ const CommunityView: React.FunctionComponent<CategoryViewProps> = (props) => {
mode={props.mode}
/>
}
{
/*
<button className={`map-switcher-inline ${props.mapColourScale == "typology_likes" ? "enabled-state" : "disabled-state"} btn btn-outline btn-outline-dark ${darkLightTheme}`} onClick={switchToTypologyMapStyle}>
{(props.mapColourScale == "typology_likes")? 'Showing likes for typologies (not about specific buildings)' : 'Click to see views on building typologies'}
</button>
*/
}
<hr />
<UserOpinionEntry
slug='community_local_significance'
title={buildingUserFields.community_local_significance.title}
@ -120,15 +114,14 @@ const CommunityView: React.FunctionComponent<CategoryViewProps> = (props) => {
copy={props.copy}
/>
{(props.mapColourScale == "community_local_significance_total") ?
<button className={`map-switcher-inline enabled-state btn btn-outline btn-outline-dark ${darkLightTheme}`} onClick={switchToTypologyMapStyle}>
{'Click to return to liked typologies mapped.'}
</button>
<button className={`map-switcher-inline enabled-state btn btn-outline btn-outline-dark ${darkLightTheme}`} onClick={switchToTypologyMapStyle}>
{'Click to return to liked typologies mapped.'}
</button>
:
<button className={`map-switcher-inline disabled-state btn btn-outline btn-outline-dark ${darkLightTheme}`} onClick={switchToLocalSignificanceMapStyle}>
{"Click here to change map to buildings of local interest."}
</button>
<button className={`map-switcher-inline disabled-state btn btn-outline btn-outline-dark ${darkLightTheme}`} onClick={switchToLocalSignificanceMapStyle}>
{"Click here to change map to buildings of local interest."}
</button>
}
<hr />
<UserOpinionEntry
slug='community_expected_planning_application'
@ -141,16 +134,14 @@ const CommunityView: React.FunctionComponent<CategoryViewProps> = (props) => {
copy={props.copy}
/>
{(props.mapColourScale == "community_expected_planning_application_total") ?
<button className={`map-switcher-inline enabled-state btn btn-outline btn-outline-dark ${darkLightTheme}`} onClick={switchToTypologyMapStyle}>
{'Click to return to liked typologies mapped.'}
</button>
<button className={`map-switcher-inline enabled-state btn btn-outline btn-outline-dark ${darkLightTheme}`} onClick={switchToTypologyMapStyle}>
{'Click to return to liked typologies mapped.'}
</button>
:
<button className={`map-switcher-inline disabled-state btn btn-outline btn-outline-dark ${darkLightTheme}`} onClick={switchToExpectedApplicationMapStyle}>
{"Click here to change map to planning applications expected by community."}
</button>
<button className={`map-switcher-inline disabled-state btn btn-outline btn-outline-dark ${darkLightTheme}`} onClick={switchToExpectedApplicationMapStyle}>
{"Click here to change map to planning applications expected by community."}
</button>
}
</div>
</DataEntryGroup>
<DataEntryGroup name="Building use for community activities">
@ -186,17 +177,6 @@ const CommunityView: React.FunctionComponent<CategoryViewProps> = (props) => {
onChange={props.onChange}
mode={props.mode}
/>
{/* TODO: dates */}
{
// props.building.community_activities === true &&
// <FieldRow>
// <div>
// </div>
// <div>
// </div>
// </FieldRow>
}
<SelectDataEntry
slug='community_public_ownership'
title={dataFields.community_public_ownership.title}
@ -207,13 +187,13 @@ const CommunityView: React.FunctionComponent<CategoryViewProps> = (props) => {
copy={props.copy}
/>
<Verification
slug="community_public_ownership"
allow_verify={props.user !== undefined && props.building.community_public_ownership !== null && !props.edited}
onVerify={props.onVerify}
user_verified={props.user_verified.hasOwnProperty("community_public_ownership")}
user_verified_as={props.user_verified.community_public_ownership}
verified_count={props.building.verified.community_public_ownership}
/>
slug="community_public_ownership"
allow_verify={props.user !== undefined && props.building.community_public_ownership !== null && !props.edited}
onVerify={props.onVerify}
user_verified={props.user_verified.hasOwnProperty("community_public_ownership")}
user_verified_as={props.user_verified.community_public_ownership}
verified_count={props.building.verified.community_public_ownership}
/>
<MultiDataEntry
slug='community_public_ownership_sources'
title={dataFields.community_public_ownership_sources.title}
@ -226,21 +206,21 @@ const CommunityView: React.FunctionComponent<CategoryViewProps> = (props) => {
copy={props.copy}
/>
<Verification
slug="community_public_ownership_sources"
allow_verify={props.user !== undefined && props.building.community_public_ownership_sources !== null && !props.edited}
onVerify={props.onVerify}
user_verified={props.user_verified.hasOwnProperty("community_public_ownership_sources")}
user_verified_as={props.user_verified.community_public_ownership_sources}
verified_count={props.building.verified.community_public_ownership_sources}
/>
slug="community_public_ownership_sources"
allow_verify={props.user !== undefined && props.building.community_public_ownership_sources !== null && !props.edited}
onVerify={props.onVerify}
user_verified={props.user_verified.hasOwnProperty("community_public_ownership_sources")}
user_verified_as={props.user_verified.community_public_ownership_sources}
verified_count={props.building.verified.community_public_ownership_sources}
/>
{(props.mapColourScale == "community_in_public_ownership") ?
<button className={`map-switcher-inline enabled-state btn btn-outline btn-outline-dark ${darkLightTheme}`} onClick={switchToTypologyMapStyle}>
{'Click to return to liked typologies mapped.'}
</button>
<button className={`map-switcher-inline enabled-state btn btn-outline btn-outline-dark ${darkLightTheme}`} onClick={switchToTypologyMapStyle}>
{'Click to return to liked typologies mapped.'}
</button>
:
<button className={`map-switcher-inline disabled-state btn btn-outline btn-outline-dark ${darkLightTheme}`} onClick={switchToPublicOwnershipMapStyle}>
{"Click here to see ownership type mapped."}
</button>
<button className={`map-switcher-inline disabled-state btn btn-outline btn-outline-dark ${darkLightTheme}`} onClick={switchToPublicOwnershipMapStyle}>
{"Click here to see ownership type mapped."}
</button>
}
</DataEntryGroup>
</>