refactor dates verification

This commit is contained in:
Ed Chalstrey 2022-05-19 10:35:13 +01:00
parent 252d7ba214
commit 485190842f

View File

@ -35,13 +35,19 @@ const AgeView: React.FunctionComponent<CategoryViewProps> = (props) => {
user_verified={props.user_verified.hasOwnProperty("date_year")}
user_verified_as={props.user_verified.date_year}
verified_count={props.building.verified.date_year}
/>
<Verification
slug="date_upper"
allow_verify={props.user !== undefined && props.building.date_upper !== null && !props.edited}
onVerify={props.onVerify}
user_verified={props.user_verified.hasOwnProperty("date_upper")}
user_verified_as={props.user_verified.date_upper}
verified_count={props.building.verified.date_upper}
/>
<Verification
slug="date_lower"
allow_verify={props.user !== undefined && props.building.date_lower !== null && !props.edited}
onVerify={props.onVerify}
user_verified={props.user_verified.hasOwnProperty("date_lower")}
user_verified_as={props.user_verified.date_lower}
verified_count={props.building.verified.date_lower}
@ -104,13 +110,19 @@ const AgeView: React.FunctionComponent<CategoryViewProps> = (props) => {
user_verified={props.user_verified.hasOwnProperty("date_year")}
user_verified_as={props.user_verified.date_year}
verified_count={props.building.verified.date_year}
/>
<Verification
slug="date_upper"
allow_verify={props.user !== undefined && props.building.date_upper !== null && !props.edited}
onVerify={props.onVerify}
user_verified={props.user_verified.hasOwnProperty("date_upper")}
user_verified_as={props.user_verified.date_upper}
verified_count={props.building.verified.date_upper}
/>
<Verification
slug="date_lower"
allow_verify={props.user !== undefined && props.building.date_lower !== null && !props.edited}
onVerify={props.onVerify}
user_verified={props.user_verified.hasOwnProperty("date_lower")}
user_verified_as={props.user_verified.date_lower}
verified_count={props.building.verified.date_lower}