refactor logic to use <form>
This commit is contained in:
parent
2b24d49333
commit
e48414d647
@ -18,8 +18,9 @@ const TeamView: React.FunctionComponent<CategoryViewProps> = (props) => {
|
|||||||
const building = props.building;
|
const building = props.building;
|
||||||
const currentYear = new Date().getFullYear();
|
const currentYear = new Date().getFullYear();
|
||||||
const currentBuildingConstructionYear = building.date_year || undefined;
|
const currentBuildingConstructionYear = building.date_year || undefined;
|
||||||
if (props.building.is_extension == "The main building"){
|
|
||||||
return (
|
return (
|
||||||
|
<form>
|
||||||
|
{this.props.building.is_extension == "The main building" ? (
|
||||||
<Fragment>
|
<Fragment>
|
||||||
<InfoBox msg="Can you help us capture information on who built the current building?"></InfoBox>
|
<InfoBox msg="Can you help us capture information on who built the current building?"></InfoBox>
|
||||||
<SelectDataEntry
|
<SelectDataEntry
|
||||||
@ -112,9 +113,7 @@ const TeamView: React.FunctionComponent<CategoryViewProps> = (props) => {
|
|||||||
mode={props.mode}
|
mode={props.mode}
|
||||||
/>
|
/>
|
||||||
</Fragment>
|
</Fragment>
|
||||||
);
|
) : (
|
||||||
};
|
|
||||||
return ( // This is what gets used when is_extension == "A major extension"
|
|
||||||
<Fragment>
|
<Fragment>
|
||||||
<InfoBox msg="Can you help us capture information on who built the building extension?"></InfoBox>
|
<InfoBox msg="Can you help us capture information on who built the building extension?"></InfoBox>
|
||||||
<SelectDataEntry
|
<SelectDataEntry
|
||||||
@ -207,7 +206,9 @@ const TeamView: React.FunctionComponent<CategoryViewProps> = (props) => {
|
|||||||
mode={props.mode}
|
mode={props.mode}
|
||||||
/>
|
/>
|
||||||
</Fragment>
|
</Fragment>
|
||||||
);
|
)}
|
||||||
|
</form>
|
||||||
|
);
|
||||||
};
|
};
|
||||||
const TeamContainer = withCopyEdit(TeamView);
|
const TeamContainer = withCopyEdit(TeamView);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user