2019-08-14 16:54:00 -04:00
|
|
|
import React from 'react';
|
2018-09-11 15:59:59 -04:00
|
|
|
|
2019-08-14 14:33:26 -04:00
|
|
|
import BuildingNotFound from './building-not-found';
|
2019-08-14 06:36:38 -04:00
|
|
|
|
2019-08-14 14:33:26 -04:00
|
|
|
import LocationContainer from './data-containers/location';
|
|
|
|
import UseContainer from './data-containers/use';
|
|
|
|
import TypeContainer from './data-containers/type';
|
|
|
|
import AgeContainer from './data-containers/age';
|
|
|
|
import SizeContainer from './data-containers/size';
|
|
|
|
import ConstructionContainer from './data-containers/construction';
|
|
|
|
import TeamContainer from './data-containers/team';
|
|
|
|
import SustainabilityContainer from './data-containers/sustainability';
|
2019-09-10 10:05:35 -04:00
|
|
|
import StreetscapeContainer from './data-containers/streetscape';
|
2019-08-14 14:33:26 -04:00
|
|
|
import CommunityContainer from './data-containers/community';
|
|
|
|
import PlanningContainer from './data-containers/planning';
|
|
|
|
import LikeContainer from './data-containers/like';
|
2019-10-15 09:37:23 -04:00
|
|
|
import { Building } from '../models/building';
|
|
|
|
|
|
|
|
|
|
|
|
interface BuildingViewProps {
|
|
|
|
cat: string;
|
2019-10-30 08:28:10 -04:00
|
|
|
mode: 'view' | 'edit';
|
2019-11-05 15:13:10 -05:00
|
|
|
building?: Building;
|
|
|
|
building_like?: boolean;
|
|
|
|
user?: any;
|
2019-10-15 14:16:48 -04:00
|
|
|
selectBuilding: (building: Building) => void
|
2019-10-15 09:37:23 -04:00
|
|
|
}
|
2019-08-14 06:36:38 -04:00
|
|
|
|
2019-08-14 14:33:26 -04:00
|
|
|
/**
|
|
|
|
* Top-level container for building view/edit form
|
|
|
|
*
|
|
|
|
* @param props
|
|
|
|
*/
|
2019-10-15 09:37:23 -04:00
|
|
|
const BuildingView: React.FunctionComponent<BuildingViewProps> = (props) => {
|
2019-08-14 14:33:26 -04:00
|
|
|
switch (props.cat) {
|
|
|
|
case 'location':
|
|
|
|
return <LocationContainer
|
2019-08-14 06:36:38 -04:00
|
|
|
{...props}
|
2019-08-14 14:33:26 -04:00
|
|
|
title="Location"
|
|
|
|
help="https://pages.colouring.london/location"
|
|
|
|
intro="Where are the buildings? Address, location and cross-references."
|
2019-08-14 06:36:38 -04:00
|
|
|
/>
|
2019-08-14 14:33:26 -04:00
|
|
|
case 'use':
|
|
|
|
return <UseContainer
|
|
|
|
{...props}
|
|
|
|
inactive={true}
|
|
|
|
title="Land Use"
|
|
|
|
intro="How are buildings used, and how does use change over time? Coming soon…"
|
|
|
|
help="https://pages.colouring.london/use"
|
|
|
|
/>
|
|
|
|
case 'type':
|
|
|
|
return <TypeContainer
|
|
|
|
{...props}
|
2019-10-02 09:34:44 -04:00
|
|
|
inactive={false}
|
2019-08-14 14:33:26 -04:00
|
|
|
title="Type"
|
2019-10-02 09:34:44 -04:00
|
|
|
intro="How were buildings previously used?"
|
2019-08-14 14:33:26 -04:00
|
|
|
help="https://www.pages.colouring.london/buildingtypology"
|
|
|
|
/>
|
|
|
|
case 'age':
|
|
|
|
return <AgeContainer
|
|
|
|
{...props}
|
|
|
|
title="Age"
|
|
|
|
help="https://pages.colouring.london/age"
|
|
|
|
intro="Building age data can support energy analysis and help predict long-term change."
|
|
|
|
/>
|
|
|
|
case 'size':
|
|
|
|
return <SizeContainer
|
|
|
|
{...props}
|
|
|
|
title="Size & Shape"
|
|
|
|
intro="How big are buildings?"
|
|
|
|
help="https://pages.colouring.london/shapeandsize"
|
|
|
|
/>
|
|
|
|
case 'construction':
|
|
|
|
return <ConstructionContainer
|
|
|
|
{...props}
|
|
|
|
title="Construction"
|
|
|
|
intro="How are buildings built? Coming soon…"
|
|
|
|
help="https://pages.colouring.london/construction"
|
|
|
|
inactive={true}
|
|
|
|
/>
|
|
|
|
case 'team':
|
|
|
|
return <TeamContainer
|
|
|
|
{...props}
|
|
|
|
title="Team"
|
|
|
|
intro="Who built the buildings? Coming soon…"
|
|
|
|
help="https://pages.colouring.london/team"
|
|
|
|
inactive={true}
|
|
|
|
/>
|
|
|
|
case 'sustainability':
|
|
|
|
return <SustainabilityContainer
|
|
|
|
{...props}
|
|
|
|
title="Sustainability"
|
2019-10-02 08:32:00 -04:00
|
|
|
intro="Are buildings energy efficient?"
|
2019-08-14 14:33:26 -04:00
|
|
|
help="https://pages.colouring.london/sustainability"
|
2019-10-02 08:32:00 -04:00
|
|
|
inactive={false}
|
2019-08-14 14:33:26 -04:00
|
|
|
/>
|
2019-09-10 10:05:35 -04:00
|
|
|
case 'streetscape':
|
|
|
|
return <StreetscapeContainer
|
2019-08-14 14:33:26 -04:00
|
|
|
{...props}
|
2019-09-10 10:05:35 -04:00
|
|
|
title="Streetscape"
|
|
|
|
intro="What's the building's context? Coming soon…"
|
|
|
|
help="https://pages.colouring.london/streetscape"
|
2019-08-14 14:33:26 -04:00
|
|
|
inactive={true}
|
|
|
|
/>
|
|
|
|
case 'community':
|
|
|
|
return <CommunityContainer
|
|
|
|
{...props}
|
|
|
|
title="Community"
|
|
|
|
intro="How does this building work for the local community?"
|
|
|
|
help="https://pages.colouring.london/community"
|
|
|
|
inactive={true}
|
|
|
|
/>
|
|
|
|
case 'planning':
|
|
|
|
return <PlanningContainer
|
|
|
|
{...props}
|
|
|
|
title="Planning"
|
|
|
|
intro="Planning controls relating to protection and reuse."
|
|
|
|
help="https://pages.colouring.london/planning"
|
|
|
|
/>
|
|
|
|
case 'like':
|
|
|
|
return <LikeContainer
|
|
|
|
{...props}
|
|
|
|
title="Like Me!"
|
|
|
|
intro="Do you like the building and think it contributes to the city?"
|
|
|
|
help="https://pages.colouring.london/likeme"
|
|
|
|
/>
|
|
|
|
default:
|
|
|
|
return <BuildingNotFound mode="view" />
|
|
|
|
}
|
2019-05-27 13:26:29 -04:00
|
|
|
}
|
2018-10-03 16:47:49 -04:00
|
|
|
|
2018-09-09 17:22:44 -04:00
|
|
|
export default BuildingView;
|