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 {
|
interface BuildingViewProps {
|
||||||
cat: string;
|
cat: string;
|
||||||
mode: 'view' | 'edit' | 'multi-edit';
|
mode: 'view' | 'edit';
|
||||||
building: Building;
|
building: Building;
|
||||||
building_like: boolean;
|
building_like: boolean;
|
||||||
user: any;
|
user: any;
|
||||||
|
@ -20,7 +20,7 @@ interface DataContainerProps {
|
|||||||
inactive?: boolean;
|
inactive?: boolean;
|
||||||
|
|
||||||
user: User;
|
user: User;
|
||||||
mode: 'view' | 'edit' | 'multi-edit';
|
mode: 'view' | 'edit';
|
||||||
building: Building;
|
building: Building;
|
||||||
building_like: boolean;
|
building_like: boolean;
|
||||||
selectBuilding: (building: Building) => void
|
selectBuilding: (building: Building) => void
|
||||||
|
@ -221,6 +221,7 @@ class MapApp extends React.Component<MapAppProps, MapAppState> {
|
|||||||
|
|
||||||
render() {
|
render() {
|
||||||
const mode = this.props.match.params.mode;
|
const mode = this.props.match.params.mode;
|
||||||
|
const viewEditMode = mode === 'multi-edit' ? undefined : mode;
|
||||||
|
|
||||||
let category = this.state.category || 'age';
|
let category = this.state.category || 'age';
|
||||||
|
|
||||||
@ -246,7 +247,7 @@ class MapApp extends React.Component<MapAppProps, MapAppState> {
|
|||||||
<Route exact path="/:mode/:cat/:building?">
|
<Route exact path="/:mode/:cat/:building?">
|
||||||
<Sidebar>
|
<Sidebar>
|
||||||
<BuildingView
|
<BuildingView
|
||||||
mode={mode}
|
mode={viewEditMode}
|
||||||
cat={category}
|
cat={category}
|
||||||
building={this.state.building}
|
building={this.state.building}
|
||||||
building_like={this.state.building_like}
|
building_like={this.state.building_like}
|
||||||
|
Loading…
Reference in New Issue
Block a user