2019-08-23 09:09:23 -04:00
|
|
|
import React, { Fragment } from 'react';
|
2019-08-14 14:33:26 -04:00
|
|
|
|
2019-11-07 02:39:26 -05:00
|
|
|
import { dataFields } from '../../data_fields';
|
2019-08-23 12:35:17 -04:00
|
|
|
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';
|
|
|
|
|
2019-10-18 10:06:50 -04:00
|
|
|
import { CategoryViewProps } from './category-view-props';
|
2019-08-14 14:33:26 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Age view/edit section
|
|
|
|
*/
|
2019-10-18 10:06:50 -04:00
|
|
|
const AgeView: React.FunctionComponent<CategoryViewProps> = (props) => (
|
2019-08-23 09:09:23 -04:00
|
|
|
<Fragment>
|
2019-08-23 12:35:17 -04:00
|
|
|
<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}
|
2019-08-23 12:35:17 -04:00
|
|
|
onChange={props.onChange}
|
2019-08-14 16:54:56 -04:00
|
|
|
/>
|
2019-08-23 12:35:17 -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}
|
2019-08-23 12:35:17 -04:00
|
|
|
mode={props.mode}
|
2019-08-14 16:54:56 -04:00
|
|
|
copy={props.copy}
|
2019-08-23 12:35:17 -04:00
|
|
|
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
|
|
|
/>
|
2019-08-23 12:35:17 -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}
|
2019-08-23 12:35:17 -04:00
|
|
|
mode={props.mode}
|
2019-08-14 16:54:56 -04:00
|
|
|
copy={props.copy}
|
2019-08-23 12:35:17 -04:00
|
|
|
onChange={props.onChange}
|
2019-10-24 07:16:23 -04:00
|
|
|
tooltip={dataFields.date_source.tooltip}
|
2019-08-23 12:35:17 -04:00
|
|
|
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
|
|
|
/>
|
2019-08-23 12:35:17 -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}
|
2019-08-23 12:35:17 -04:00
|
|
|
mode={props.mode}
|
2019-08-14 16:54:56 -04:00
|
|
|
copy={props.copy}
|
2019-08-23 12:35:17 -04:00
|
|
|
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
|
|
|
/>
|
2019-08-23 12:35:17 -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}
|
2019-08-23 12:35:17 -04:00
|
|
|
mode={props.mode}
|
2019-08-14 16:54:56 -04:00
|
|
|
copy={props.copy}
|
2019-10-18 10:06:50 -04:00
|
|
|
onChange={props.onChange}
|
2019-10-24 07:16:23 -04:00
|
|
|
tooltip={dataFields.date_link.tooltip}
|
2019-08-23 12:35:17 -04:00
|
|
|
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
|
|
|
);
|
2019-08-14 14:33:26 -04:00
|
|
|
const AgeContainer = withCopyEdit(AgeView);
|
|
|
|
|
|
|
|
export default AgeContainer;
|