From e17da922ab2d08cca930b5a311babac0f279bf8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Ooms?= Date: Sun, 25 Nov 2018 14:26:51 +0100 Subject: [PATCH] :bug: fix(accounts): Improve disconnected user uix fixes #36 --- imports/ui/App.js | 2 +- imports/ui/Header.js | 4 ++-- imports/ui/NavigationDrawer.js | 4 ++-- imports/ui/Router.js | 6 ++++++ 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/imports/ui/App.js b/imports/ui/App.js index 4d24b9c9f..5c1b35b97 100644 --- a/imports/ui/App.js +++ b/imports/ui/App.js @@ -48,7 +48,7 @@ class App extends React.Component {
- +
diff --git a/imports/ui/Header.js b/imports/ui/Header.js index e6b5868b6..f65b00e77 100644 --- a/imports/ui/Header.js +++ b/imports/ui/Header.js @@ -81,13 +81,13 @@ class Header extends React.Component { {location.pathname}
- item ? item.label : ''} onChange={this.handleChange} stateReducer={this.reduceState} - /> + /> }
diff --git a/imports/ui/NavigationDrawer.js b/imports/ui/NavigationDrawer.js index 5b4f3e442..fccf753bd 100644 --- a/imports/ui/NavigationDrawer.js +++ b/imports/ui/NavigationDrawer.js @@ -45,7 +45,7 @@ const styles = theme => ({ drawerHeader: theme.mixins.toolbar, }); -function NavigationDrawer ( { classes } ) { +function NavigationDrawer ( { classes, currentUser } ) { const blocks = [ @@ -219,7 +219,7 @@ function NavigationDrawer ( { classes } ) { { links.map( link => ( - + {link.icon} diff --git a/imports/ui/Router.js b/imports/ui/Router.js index 294695de5..898a3eb27 100644 --- a/imports/ui/Router.js +++ b/imports/ui/Router.js @@ -79,6 +79,12 @@ class Main extends React.Component { const { classes, patients, currentUser } = this.props; + if (!currentUser) return ( +
+ Please sign in +
+ ) ; + return (