Only accept view/edit modes for building view

This commit is contained in:
Maciej Ziarkowski 2019-10-30 12:28:10 +00:00
parent 06eb4e53ed
commit 740b788246
3 changed files with 4 additions and 3 deletions

View File

@ -19,7 +19,7 @@ import { Building } from '../models/building';
interface BuildingViewProps {
cat: string;
mode: 'view' | 'edit' | 'multi-edit';
mode: 'view' | 'edit';
building: Building;
building_like: boolean;
user: any;

View File

@ -20,7 +20,7 @@ interface DataContainerProps {
inactive?: boolean;
user: User;
mode: 'view' | 'edit' | 'multi-edit';
mode: 'view' | 'edit';
building: Building;
building_like: boolean;
selectBuilding: (building: Building) => void

View File

@ -221,6 +221,7 @@ class MapApp extends React.Component<MapAppProps, MapAppState> {
render() {
const mode = this.props.match.params.mode;
const viewEditMode = mode === 'multi-edit' ? undefined : mode;
let category = this.state.category || 'age';
@ -246,7 +247,7 @@ class MapApp extends React.Component<MapAppProps, MapAppState> {
<Route exact path="/:mode/:cat/:building?">
<Sidebar>
<BuildingView
mode={mode}
mode={viewEditMode}
cat={category}
building={this.state.building}
building_like={this.state.building_like}