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

82 lines
2.7 KiB
TypeScript
Raw Normal View History

2019-08-23 09:09:23 -04:00
import React, { Fragment } from 'react';
2019-11-07 02:39:26 -05:00
import { dataFields } from '../../data_fields';
import MultiDataEntry from '../data-components/multi-data-entry';
import NumericDataEntry from '../data-components/numeric-data-entry';
import SelectDataEntry from '../data-components/select-data-entry';
import TextboxDataEntry from '../data-components/textbox-data-entry';
import YearDataEntry from '../data-components/year-data-entry';
2019-11-07 02:39:26 -05:00
import withCopyEdit from '../data-container';
import { CategoryViewProps } from './category-view-props';
/**
* Age view/edit section
*/
const AgeView: React.FunctionComponent<CategoryViewProps> = (props) => (
2019-08-23 09:09:23 -04:00
<Fragment>
<YearDataEntry
year={props.building.date_year}
upper={props.building.date_upper}
lower={props.building.date_lower}
mode={props.mode}
2019-10-02 17:35:57 -04:00
copy={props.copy}
onChange={props.onChange}
2019-08-14 16:54:56 -04:00
/>
<NumericDataEntry
2019-10-24 07:16:23 -04:00
title={dataFields.facade_year.title}
2019-08-14 16:54:56 -04:00
slug="facade_year"
value={props.building.facade_year}
mode={props.mode}
2019-08-14 16:54:56 -04:00
copy={props.copy}
onChange={props.onChange}
step={1}
2019-10-24 07:16:23 -04:00
tooltip={dataFields.facade_year.tooltip}
2019-08-14 16:54:56 -04:00
/>
<SelectDataEntry
2019-10-24 07:16:23 -04:00
title={dataFields.date_source.title}
2019-08-14 16:54:56 -04:00
slug="date_source"
value={props.building.date_source}
mode={props.mode}
2019-08-14 16:54:56 -04:00
copy={props.copy}
onChange={props.onChange}
2019-10-24 07:16:23 -04:00
tooltip={dataFields.date_source.tooltip}
placeholder=""
options={[
"Survey of London",
"Pevsner Guides",
"Local history publication",
"National Heritage List for England",
"Historical map",
"Archive research",
"Expert knowledge of building",
"Other book",
"Other website",
"Other"
]}
2019-08-14 16:54:56 -04:00
/>
<TextboxDataEntry
2019-10-24 07:16:23 -04:00
title={dataFields.date_source_detail.title}
2019-08-14 16:54:56 -04:00
slug="date_source_detail"
value={props.building.date_source_detail}
mode={props.mode}
2019-08-14 16:54:56 -04:00
copy={props.copy}
onChange={props.onChange}
2019-10-24 07:16:23 -04:00
tooltip={dataFields.date_source_detail.tooltip}
2019-08-14 16:54:56 -04:00
/>
<MultiDataEntry
2019-10-24 07:16:23 -04:00
title={dataFields.date_link.title}
2019-08-14 16:54:56 -04:00
slug="date_link"
value={props.building.date_link}
mode={props.mode}
2019-08-14 16:54:56 -04:00
copy={props.copy}
onChange={props.onChange}
2019-10-24 07:16:23 -04:00
tooltip={dataFields.date_link.tooltip}
placeholder="https://..."
2019-08-14 16:54:56 -04:00
/>
2019-08-23 09:09:23 -04:00
</Fragment>
2019-11-07 03:13:30 -05:00
);
const AgeContainer = withCopyEdit(AgeView);
export default AgeContainer;