Only accept view/edit modes for building view
This commit is contained in:
parent
06eb4e53ed
commit
740b788246
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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}
|
||||
|
Loading…
Reference in New Issue
Block a user