diff options
author | Anton Tananaev <anton@traccar.org> | 2022-05-01 15:29:23 -0700 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2022-05-01 15:29:23 -0700 |
commit | 4ca85e42f074641ab83504e783603640da7478db (patch) | |
tree | 07376d23560fe7034890de679e44c96484775679 /modern/src | |
parent | af6b60f85ba09a9d1a258cf9d1b6b61d4b8e4fe5 (diff) | |
download | trackermap-web-4ca85e42f074641ab83504e783603640da7478db.tar.gz trackermap-web-4ca85e42f074641ab83504e783603640da7478db.tar.bz2 trackermap-web-4ca85e42f074641ab83504e783603640da7478db.zip |
Fix lint issues
Diffstat (limited to 'modern/src')
-rw-r--r-- | modern/src/MainPage.js | 6 | ||||
-rw-r--r-- | modern/src/map/StatusCard.js | 25 |
2 files changed, 16 insertions, 15 deletions
diff --git a/modern/src/MainPage.js b/modern/src/MainPage.js index 82ed3756..0f6db95a 100644 --- a/modern/src/MainPage.js +++ b/modern/src/MainPage.js @@ -11,6 +11,7 @@ import CloseIcon from '@material-ui/icons/Close'; import ArrowBackIcon from '@material-ui/icons/ArrowBack'; import ListIcon from '@material-ui/icons/ViewList'; +import { useDispatch, useSelector } from 'react-redux'; import DevicesList from './DevicesList'; import Map from './map/Map'; import SelectedDeviceMap from './map/SelectedDeviceMap'; @@ -23,7 +24,6 @@ import { useTranslation } from './LocalizationProvider'; import PoiMap from './map/PoiMap'; import MapPadding from './map/MapPadding'; import StatusCard from './map/StatusCard'; -import { useDispatch, useSelector } from 'react-redux'; import { devicesActions } from './store'; const useStyles = makeStyles((theme) => ({ @@ -179,14 +179,14 @@ const MainPage = () => { </div> </Paper> <BottomMenu /> - {selectedDeviceId && + {selectedDeviceId && ( <div className={classes.statusCard}> <StatusCard deviceId={selectedDeviceId} onClose={() => dispatch(devicesActions.select(null))} /> </div> - } + )} </div> ); }; diff --git a/modern/src/map/StatusCard.js b/modern/src/map/StatusCard.js index 47f7724d..d19651ca 100644 --- a/modern/src/map/StatusCard.js +++ b/modern/src/map/StatusCard.js @@ -11,7 +11,9 @@ import EditIcon from '@material-ui/icons/Edit'; import DeleteIcon from '@material-ui/icons/Delete'; import { useTranslation } from '../LocalizationProvider'; -import { formatDistance, formatPosition, formatSpeed, formatStatus } from '../common/formatter'; +import { + formatDistance, formatPosition, formatSpeed, formatStatus, +} from '../common/formatter'; import RemoveDialog from '../RemoveDialog'; import { useAttributePreference } from '../common/preferences'; @@ -54,7 +56,7 @@ const StatusRow = ({ name, value }) => { </TableCell> </TableRow> ); -} +}; const StatusCard = ({ deviceId, onClose }) => { const classes = useStyles(); @@ -71,23 +73,23 @@ const StatusCard = ({ deviceId, onClose }) => { return ( <> - {device && + {device && ( <Card> <CardHeader - avatar={ + avatar={( <Avatar> <img className={classes.icon} src={`images/icon/${device.category || 'default'}.svg`} alt="" /> </Avatar> - } - action={ + )} + action={( <IconButton onClick={onClose}> <CloseIcon /> </IconButton> - } + )} title={device.name} subheader={formatStatus(device.status, t)} /> - {position && + {position && ( <CardContent> <TableContainer> <Table size="small" classes={{ root: classes.table }}> @@ -96,14 +98,13 @@ const StatusCard = ({ deviceId, onClose }) => { <StatusRow name={t('positionBattery')} value={formatSpeed(position.speed, speedUnit, t)} /> {position.attributes.odometer ? <StatusRow name={t('positionOdometer')} value={formatDistance(position.attributes.odometer, distanceUnit, t)} /> - : <StatusRow name={t('deviceTotalDistance')} value={formatDistance(position.attributes.totalDistance, distanceUnit, t)} /> - } + : <StatusRow name={t('deviceTotalDistance')} value={formatDistance(position.attributes.totalDistance, distanceUnit, t)} />} <StatusRow name={t('positionCourse')} value={formatPosition(position.course, 'course', t)} /> </TableBody> </Table> </TableContainer> </CardContent> - } + )} <CardActions disableSpacing> <Button onClick={() => history.push(`/position/${position.id}`)} disabled={!position} color="secondary"> {t('sharedInfoTitle')} @@ -122,7 +123,7 @@ const StatusCard = ({ deviceId, onClose }) => { </IconButton> </CardActions> </Card> - } + )} <RemoveDialog open={removeDialogShown} endpoint="devices" |