Redirect from edit if not logged in
This commit is contained in:
parent
298c55038c
commit
447b5acf09
@ -84,7 +84,7 @@ class App extends React.Component {
|
||||
<Welcome />
|
||||
</Route>
|
||||
<Route exact path="/select.html">
|
||||
<BuildingEditAny />
|
||||
<BuildingEditAny user={this.state.user} />
|
||||
</Route>
|
||||
<Route exact path="/map/:map.html" component={Legend} />
|
||||
<Route exact path="/building/:building.html" render={(props) => (
|
||||
|
@ -1,11 +1,17 @@
|
||||
|
||||
import React from 'react';
|
||||
import Sidebar from './sidebar';
|
||||
import InfoBox from './info-box';
|
||||
import { Redirect } from 'react-router-dom';
|
||||
|
||||
const BuildingEditAny = () => (
|
||||
<Sidebar title="Edit data">
|
||||
<p className="data-intro">Select a building to edit by clicking on the map…</p>
|
||||
</Sidebar>
|
||||
);
|
||||
|
||||
const BuildingEditAny = (props) => {
|
||||
if (!props.user){
|
||||
return <Redirect to="/sign-up.html" />
|
||||
}
|
||||
return (
|
||||
<Sidebar title="Edit data">
|
||||
<InfoBox msg="Select a building to edit by clicking on the map…" />
|
||||
</Sidebar>
|
||||
);
|
||||
}
|
||||
export default BuildingEditAny;
|
||||
|
Loading…
Reference in New Issue
Block a user