aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-05-04 18:03:21 -0700
committerAnton Tananaev <anton@traccar.org>2022-05-04 18:03:21 -0700
commit3c6fd42a9bf79a104c43d61cad5dcfb44b6cc229 (patch)
treed7824726074a8d6eeaa7daa59d07872925004a89
parent05623d59c14896da5ac1b2527e93d4af50ec87b6 (diff)
downloadtrackermap-web-3c6fd42a9bf79a104c43d61cad5dcfb44b6cc229.tar.gz
trackermap-web-3c6fd42a9bf79a104c43d61cad5dcfb44b6cc229.tar.bz2
trackermap-web-3c6fd42a9bf79a104c43d61cad5dcfb44b6cc229.zip
Fix code style
-rw-r--r--modern/src/components/BottomMenu.js27
-rw-r--r--modern/src/settings/OptionsLayout.js2
2 files changed, 14 insertions, 15 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}>
diff --git a/modern/src/settings/OptionsLayout.js b/modern/src/settings/OptionsLayout.js
index 3a78929b..6aab5e37 100644
--- a/modern/src/settings/OptionsLayout.js
+++ b/modern/src/settings/OptionsLayout.js
@@ -99,7 +99,7 @@ const OptionsLayout = ({ children }) => {
], [t]);
const routes = useMemo(() => (
- [ ...readonlyRoutes, ...(!readonly ? mainRoutes : []), ...(admin ? adminRoutes : [])]
+ [...readonlyRoutes, ...(!readonly ? mainRoutes : []), ...(admin ? adminRoutes : [])]
), [readonlyRoutes, readonly, mainRoutes, admin, adminRoutes]);
useEffect(() => {