From e48414d647187e5c9588384ee19efcfc63ab0ad2 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Mon, 6 Jun 2022 09:52:50 +0100 Subject: [PATCH] refactor logic to use
--- .../building/data-containers/team.tsx | 187 +++++++++--------- 1 file changed, 94 insertions(+), 93 deletions(-) diff --git a/app/src/frontend/building/data-containers/team.tsx b/app/src/frontend/building/data-containers/team.tsx index c9c6785f..276184ab 100644 --- a/app/src/frontend/building/data-containers/team.tsx +++ b/app/src/frontend/building/data-containers/team.tsx @@ -18,8 +18,9 @@ const TeamView: React.FunctionComponent = (props) => { const building = props.building; const currentYear = new Date().getFullYear(); const currentBuildingConstructionYear = building.date_year || undefined; - if (props.building.is_extension == "The main building"){ return ( + + {this.props.building.is_extension == "The main building" ? ( = (props) => { mode={props.mode} /> - ); - }; - return ( // This is what gets used when is_extension == "A major extension" - - - + + + + - - - + - - + + + - - - - - -); + onChange={props.onChange} + mode={props.mode} + /> + + )} + + ); }; const TeamContainer = withCopyEdit(TeamView);