diff options
author | Iván Ávalos <avalos@disroot.org> | 2021-12-11 15:22:58 -0600 |
---|---|---|
committer | Iván Ávalos <avalos@disroot.org> | 2021-12-11 15:22:58 -0600 |
commit | e490ffb046eff933a134f96323c8e6c765175cf0 (patch) | |
tree | 5031f70ca28137fb02d403cace7ccbe90a2eb56d /modern/src/MainToolbar.js | |
parent | 982dec21075a244a0c75ee11c13777d6931e21ec (diff) | |
download | etbsa-traccar-web-e490ffb046eff933a134f96323c8e6c765175cf0.tar.gz etbsa-traccar-web-e490ffb046eff933a134f96323c8e6c765175cf0.tar.bz2 etbsa-traccar-web-e490ffb046eff933a134f96323c8e6c765175cf0.zip |
Many stuff modified
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}> |