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';
|
2020-01-09 14:43:59 -05:00
|
|
|
import MultiDataEntry from '../data-components/multi-data-entry/multi-data-entry';
|
2019-08-23 12:35:17 -04:00
|
|
|
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-11-28 07:22:10 -05:00
|
|
|
const AgeView: React.FunctionComponent<CategoryViewProps> = (props) => {
|
|
|
|
const currentYear = new Date().getFullYear();
|
|
|
|
|
|
|
|
return (
|
|
|
|
<Fragment>
|
|
|
|
<YearDataEntry
|
|
|
|
year={props.building.date_year}
|
|
|
|
upper={props.building.date_upper}
|
|
|
|
lower={props.building.date_lower}
|
|
|
|
mode={props.mode}
|
|
|
|
copy={props.copy}
|
|
|
|
onChange={props.onChange}
|
|
|
|
/>
|
|
|
|
<NumericDataEntry
|
|
|
|
title={dataFields.facade_year.title}
|
|
|
|
slug="facade_year"
|
|
|
|
value={props.building.facade_year}
|
|
|
|
mode={props.mode}
|
|
|
|
copy={props.copy}
|
|
|
|
onChange={props.onChange}
|
|
|
|
step={1}
|
|
|
|
min={1}
|
|
|
|
max={currentYear}
|
|
|
|
tooltip={dataFields.facade_year.tooltip}
|
|
|
|
/>
|
|
|
|
<SelectDataEntry
|
|
|
|
title={dataFields.date_source.title}
|
|
|
|
slug="date_source"
|
|
|
|
value={props.building.date_source}
|
|
|
|
mode={props.mode}
|
|
|
|
copy={props.copy}
|
|
|
|
onChange={props.onChange}
|
|
|
|
tooltip={dataFields.date_source.tooltip}
|
|
|
|
placeholder=""
|
|
|
|
options={[
|
2019-12-01 19:12:55 -05:00
|
|
|
"Expert knowledge of building",
|
|
|
|
"Expert estimate from image",
|
2019-11-28 07:22:10 -05:00
|
|
|
"Survey of London",
|
|
|
|
"Pevsner Guides",
|
2019-12-01 19:12:55 -05:00
|
|
|
"Victoria County History",
|
2019-11-28 07:22:10 -05:00
|
|
|
"Local history publication",
|
2019-12-01 19:12:55 -05:00
|
|
|
"Other publication",
|
2019-11-28 07:22:10 -05:00
|
|
|
"National Heritage List for England",
|
2019-12-01 19:12:55 -05:00
|
|
|
"Other database or gazetteer",
|
2019-11-28 07:22:10 -05:00
|
|
|
"Historical map",
|
2019-12-01 19:12:55 -05:00
|
|
|
"Other archive document",
|
|
|
|
"Film/Video",
|
2019-11-28 07:22:10 -05:00
|
|
|
"Other website",
|
|
|
|
"Other"
|
|
|
|
]}
|
|
|
|
/>
|
|
|
|
<TextboxDataEntry
|
|
|
|
title={dataFields.date_source_detail.title}
|
|
|
|
slug="date_source_detail"
|
|
|
|
value={props.building.date_source_detail}
|
|
|
|
mode={props.mode}
|
|
|
|
copy={props.copy}
|
|
|
|
onChange={props.onChange}
|
|
|
|
tooltip={dataFields.date_source_detail.tooltip}
|
|
|
|
/>
|
|
|
|
<MultiDataEntry
|
|
|
|
title={dataFields.date_link.title}
|
|
|
|
slug="date_link"
|
|
|
|
value={props.building.date_link}
|
|
|
|
mode={props.mode}
|
|
|
|
copy={props.copy}
|
|
|
|
onChange={props.onChange}
|
|
|
|
tooltip={dataFields.date_link.tooltip}
|
|
|
|
placeholder="https://..."
|
2020-03-19 14:17:56 -04:00
|
|
|
editableEntries={true}
|
2019-11-28 07:22:10 -05:00
|
|
|
/>
|
|
|
|
</Fragment>
|
|
|
|
);
|
|
|
|
};
|
2019-08-14 14:33:26 -04:00
|
|
|
const AgeContainer = withCopyEdit(AgeView);
|
|
|
|
|
|
|
|
export default AgeContainer;
|