colouring-montreal/app/src/frontend/building/data-containers/construction.tsx

99 lines
3.6 KiB
TypeScript
Raw Normal View History

2019-08-14 17:34:47 -04:00
import React, { Fragment } from 'react';
import { dataFields } from '../../config/data-fields-config';
import DataEntry from '../data-components/data-entry';
import SelectDataEntry from '../data-components/select-data-entry';
import withCopyEdit from '../data-container';
2022-05-19 08:06:15 -04:00
import Verification from '../data-components/verification';
import { CategoryViewProps } from './category-view-props';
const ConstructionMaterialsOptions = [
'Wood',
'Stone',
'Brick',
'Steel',
'Reinforced Concrete',
'Other Metal',
'Other Natural Material',
'Other Man-Made Material'
];
const RoofCoveringOptions = [
'Slate',
'Clay Tile',
'Wood',
'Asphalt',
'Iron or Steel',
'Other Metal',
'Other Natural Material',
'Other Man-Made Material'
];
/**
* Construction view/edit section
*/
const ConstructionView: React.FunctionComponent<CategoryViewProps> = (props) => {
return (
<Fragment>
<SelectDataEntry
title={dataFields.construction_core_material.title}
slug="construction_core_material"
2020-05-04 09:24:53 -04:00
value={props.building.construction_core_material}
tooltip={dataFields.construction_core_material.tooltip}
options={ConstructionMaterialsOptions}
mode={props.mode}
copy={props.copy}
onChange={props.onChange}
/>
2022-05-19 08:04:53 -04:00
<Verification
slug="construction_core_material"
allow_verify={props.user !== undefined && props.building.construction_core_material !== null && !props.edited}
onVerify={props.onVerify}
user_verified={props.user_verified.hasOwnProperty("construction_core_material")}
user_verified_as={props.user_verified.construction_core_material}
verified_count={props.building.verified.construction_core_material}
/>
<SelectDataEntry
title={dataFields.construction_secondary_materials.title}
2020-05-04 09:24:53 -04:00
disabled={true}
slug="construction_secondary_materials"
2020-05-04 09:24:53 -04:00
value={props.building.construction_secondary_materials}
tooltip={dataFields.construction_secondary_materials.tooltip}
options={ConstructionMaterialsOptions}
mode={props.mode}
copy={props.copy}
onChange={props.onChange}
/>
<SelectDataEntry
title={dataFields.construction_roof_covering.title}
slug="construction_roof_covering"
2020-05-04 09:24:53 -04:00
value={props.building.construction_roof_covering}
tooltip={dataFields.construction_roof_covering.tooltip}
options={RoofCoveringOptions}
mode={props.mode}
copy={props.copy}
onChange={props.onChange}
/>
2022-05-19 08:04:53 -04:00
<Verification
slug="construction_roof_covering"
allow_verify={props.user !== undefined && props.building.construction_roof_covering !== null && !props.edited}
onVerify={props.onVerify}
user_verified={props.user_verified.hasOwnProperty("construction_roof_covering")}
user_verified_as={props.user_verified.construction_roof_covering}
verified_count={props.building.verified.construction_roof_covering}
/>
<DataEntry
title="Construction system type"
slug=""
value=""
mode='view'
/>
</Fragment>
);
2020-05-04 09:24:53 -04:00
};
const ConstructionContainer = withCopyEdit(ConstructionView);
export default ConstructionContainer;