diff options
author | Anton Tananaev <anton@traccar.org> | 2022-05-04 18:03:21 -0700 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2022-05-04 18:03:21 -0700 |
commit | 3c6fd42a9bf79a104c43d61cad5dcfb44b6cc229 (patch) | |
tree | d7824726074a8d6eeaa7daa59d07872925004a89 /modern/src/components/BottomMenu.js | |
parent | 05623d59c14896da5ac1b2527e93d4af50ec87b6 (diff) | |
download | trackermap-web-3c6fd42a9bf79a104c43d61cad5dcfb44b6cc229.tar.gz trackermap-web-3c6fd42a9bf79a104c43d61cad5dcfb44b6cc229.tar.bz2 trackermap-web-3c6fd42a9bf79a104c43d61cad5dcfb44b6cc229.zip |
Fix code style
Diffstat (limited to 'modern/src/components/BottomMenu.js')
-rw-r--r-- | modern/src/components/BottomMenu.js | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/modern/src/components/BottomMenu.js b/modern/src/components/BottomMenu.js index 920622ae..ff68a2ef 100644 --- a/modern/src/components/BottomMenu.js +++ b/modern/src/components/BottomMenu.js @@ -39,6 +39,18 @@ const BottomMenu = () => { return null; }; + const handleAccount = () => { + setAnchorEl(null); + history.push(`/user/${userId}`); + }; + + const handleLogout = async () => { + setAnchorEl(null); + await fetch('/api/session', { method: 'DELETE' }); + history.push('/login'); + dispatch(sessionActions.updateUser(null)); + }; + const handleSelection = (event, value) => { switch (value) { case 0: @@ -62,18 +74,6 @@ const BottomMenu = () => { } }; - const handleAccount = () => { - setAnchorEl(null); - history.push(`/user/${userId}`); - }; - - const handleLogout = async () => { - setAnchorEl(null); - await fetch('/api/session', { method: 'DELETE' }); - history.push('/login'); - dispatch(sessionActions.updateUser(null)); - }; - return ( <Paper square elevation={3}> <BottomNavigation value={currentSelection()} onChange={handleSelection} showLabels> @@ -82,8 +82,7 @@ const BottomMenu = () => { <BottomNavigationAction label={t('settingsTitle')} icon={<SettingsIcon />} /> {readonly ? (<BottomNavigationAction label={t('loginLogout')} icon={<ExitToAppIcon />} />) - : (<BottomNavigationAction label={t('settingsUser')} icon={<PersonIcon />} />) - } + : (<BottomNavigationAction label={t('settingsUser')} icon={<PersonIcon />} />)} </BottomNavigation> <Menu anchorEl={anchorEl} keepMounted open={Boolean(anchorEl)} onClose={() => setAnchorEl(null)}> <MenuItem onClick={handleAccount}> |