aboutsummaryrefslogtreecommitdiff
path: root/modern/src/MainToolbar.js
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2020-09-20 19:10:16 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2020-09-20 19:10:16 -0700
commit44e753b794513c5c9c1f550d685461e6c5bb0d11 (patch)
treedfeeeab4dd11249d6e8b60f064afc96c8b1bd548 /modern/src/MainToolbar.js
parentb124908d9f9f2a24963871cac982cc5b5e172ba5 (diff)
downloadtrackermap-web-44e753b794513c5c9c1f550d685461e6c5bb0d11.tar.gz
trackermap-web-44e753b794513c5c9c1f550d685461e6c5bb0d11.tar.bz2
trackermap-web-44e753b794513c5c9c1f550d685461e6c5bb0d11.zip
Add users context menu
Diffstat (limited to 'modern/src/MainToolbar.js')
-rw-r--r--modern/src/MainToolbar.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/modern/src/MainToolbar.js b/modern/src/MainToolbar.js
index 338e961b..60731967 100644
--- a/modern/src/MainToolbar.js
+++ b/modern/src/MainToolbar.js
@@ -44,6 +44,7 @@ const MainToolbar = () => {
const classes = useStyles();
const history = useHistory();
const adminEnabled = useSelector(state => state.session.user && state.session.user.administrator);
+ const userId = useSelector(state => state.session.user && state.session.user.id);
const openDrawer = () => { setDrawer(true) }
const closeDrawer = () => { setDrawer(false) }
@@ -94,7 +95,7 @@ const MainToolbar = () => {
{t('reportTitle')}
</ListSubheader>
}>
- <ListItem button onClick={() => { history.push('/reports/route') }}>
+ <ListItem button onClick={() => history.push('/reports/route')}>
<ListItemIcon>
<BarChartIcon />
</ListItemIcon>
@@ -138,7 +139,7 @@ const MainToolbar = () => {
{t('settingsTitle')}
</ListSubheader>
}>
- <ListItem button disabled>
+ <ListItem button disabled={!userId} onClick={() => history.push(`/user/${userId}`)}>
<ListItemIcon>
<SettingsIcon />
</ListItemIcon>
@@ -166,7 +167,7 @@ const MainToolbar = () => {
{t('userAdmin')}
</ListSubheader>
}>
- <ListItem button onClick={() => { history.push('/admin/users') }}>
+ <ListItem button onClick={() => history.push('/admin/users')}>
<ListItemIcon>
<PeopleIcon />
</ListItemIcon>