From 447b5acf09aab75f53a7cb5aeda12cc3ad65e3c8 Mon Sep 17 00:00:00 2001 From: Tom Russell Date: Wed, 21 Nov 2018 22:19:51 +0000 Subject: [PATCH] Redirect from edit if not logged in --- app/src/frontend/app.js | 2 +- app/src/frontend/building-edit-any.js | 18 ++++++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/app/src/frontend/app.js b/app/src/frontend/app.js index bace2792..884cd2fa 100644 --- a/app/src/frontend/app.js +++ b/app/src/frontend/app.js @@ -84,7 +84,7 @@ class App extends React.Component { - + ( diff --git a/app/src/frontend/building-edit-any.js b/app/src/frontend/building-edit-any.js index 519044ee..83933baa 100644 --- a/app/src/frontend/building-edit-any.js +++ b/app/src/frontend/building-edit-any.js @@ -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 = () => ( - -

Select a building to edit by clicking on the map…

-
-); - +const BuildingEditAny = (props) => { + if (!props.user){ + return + } + return ( + + + + ); +} export default BuildingEditAny;