diff options
Diffstat (limited to 'modern/src/MainToolbar.js')
-rw-r--r-- | modern/src/MainToolbar.js | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/modern/src/MainToolbar.js b/modern/src/MainToolbar.js index 1e4dabe..cd7abe0 100644 --- a/modern/src/MainToolbar.js +++ b/modern/src/MainToolbar.js @@ -8,6 +8,7 @@ import Typography from '@material-ui/core/Typography'; import Button from '@material-ui/core/Button'; import IconButton from '@material-ui/core/IconButton'; import MenuIcon from '@material-ui/icons/Menu'; +import CloseIcon from '@material-ui/icons/Close'; import Drawer from '@material-ui/core/Drawer'; import List from '@material-ui/core/List'; import ListItem from '@material-ui/core/ListItem'; @@ -50,12 +51,8 @@ const MainToolbar = () => { const openDrawer = () => { setDrawer(true); }; const closeDrawer = () => { setDrawer(false); }; - const handleLogout = async () => { - const response = await fetch('/api/session', { method: 'DELETE' }); - if (response.ok) { - dispatch(sessionActions.updateUser(null)); - history.push('/login'); - } + const handleClose = async () => { + history.push ('/'); }; return ( @@ -72,7 +69,12 @@ const MainToolbar = () => { <Typography variant="h6" color="inherit" className={classes.flex}> Traccar </Typography> - <Button color="inherit" onClick={handleLogout}>{t('loginLogout')}</Button> + <IconButton + color="inherit" + onClick={handleClose} + > + <CloseIcon /> + </IconButton> </Toolbar> </AppBar> <Drawer open={drawer} onClose={closeDrawer}> |