diff options
author | Anton Tananaev <anton@traccar.org> | 2022-05-26 16:16:41 -0700 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2022-05-26 16:16:41 -0700 |
commit | 3a651e5f02a90857e4023edb7ac9785d569417dd (patch) | |
tree | 8ca8ac15c3c2a708236e5db1fd1b577e880046aa /modern/src/common/components | |
parent | e01380561a113f868538e9a3399fc2406e250368 (diff) | |
download | trackermap-web-3a651e5f02a90857e4023edb7ac9785d569417dd.tar.gz trackermap-web-3a651e5f02a90857e4023edb7ac9785d569417dd.tar.bz2 trackermap-web-3a651e5f02a90857e4023edb7ac9785d569417dd.zip |
Socket status and backup
Diffstat (limited to 'modern/src/common/components')
-rw-r--r-- | modern/src/common/components/BottomMenu.js | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/modern/src/common/components/BottomMenu.js b/modern/src/common/components/BottomMenu.js index b011638e..274c4f1a 100644 --- a/modern/src/common/components/BottomMenu.js +++ b/modern/src/common/components/BottomMenu.js @@ -2,7 +2,7 @@ import React, { useState } from 'react'; import { useDispatch, useSelector } from 'react-redux'; import { useNavigate, useLocation } from 'react-router-dom'; import { - Paper, BottomNavigation, BottomNavigationAction, Menu, MenuItem, Typography, + Paper, BottomNavigation, BottomNavigationAction, Menu, MenuItem, Typography, Badge, } from '@mui/material'; import DescriptionIcon from '@mui/icons-material/Description'; @@ -23,6 +23,7 @@ const BottomMenu = () => { const readonly = useReadonly(); const userId = useSelector((state) => state.session.user?.id); + const socket = useSelector((state) => state.session.socket); const [anchorEl, setAnchorEl] = useState(null); @@ -77,7 +78,14 @@ const BottomMenu = () => { return ( <Paper square elevation={3}> <BottomNavigation value={currentSelection()} onChange={handleSelection} showLabels> - <BottomNavigationAction label={t('mapTitle')} icon={<MapIcon />} /> + <BottomNavigationAction + label={t('mapTitle')} + icon={( + <Badge color="error" variant="dot" overlap="circular" invisible={socket !== false}> + <MapIcon /> + </Badge> + )} + /> <BottomNavigationAction label={t('reportTitle')} icon={<DescriptionIcon />} /> <BottomNavigationAction label={t('settingsTitle')} icon={<SettingsIcon />} /> {readonly |