diff options
author | Anton Tananaev <anton@traccar.org> | 2022-05-23 06:44:15 -0700 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2022-05-23 06:44:15 -0700 |
commit | ddcb42512e95e98806db0523e4d954484a6e48cc (patch) | |
tree | 795fbd841eb94ded02ce66a2a2c50c2cc52a7dcd /modern/src/main/StatusCard.js | |
parent | fdbc6762b10233950d9c84fc71a9a8c11823f0a9 (diff) | |
download | trackermap-web-ddcb42512e95e98806db0523e4d954484a6e48cc.tar.gz trackermap-web-ddcb42512e95e98806db0523e4d954484a6e48cc.tar.bz2 trackermap-web-ddcb42512e95e98806db0523e4d954484a6e48cc.zip |
Upgrade router and navigation
Diffstat (limited to 'modern/src/main/StatusCard.js')
-rw-r--r-- | modern/src/main/StatusCard.js | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/modern/src/main/StatusCard.js b/modern/src/main/StatusCard.js index d23bc8c3..92db8047 100644 --- a/modern/src/main/StatusCard.js +++ b/modern/src/main/StatusCard.js @@ -1,6 +1,6 @@ import React, { useState } from 'react'; import { useDispatch, useSelector } from 'react-redux'; -import { useHistory } from 'react-router-dom'; +import { useNavigate } from 'react-router-dom'; import { makeStyles, Card, CardContent, Typography, CardActions, CardHeader, IconButton, Avatar, Table, TableBody, TableRow, TableCell, TableContainer, } from '@material-ui/core'; @@ -65,7 +65,7 @@ const StatusRow = ({ name, content }) => { const StatusCard = ({ deviceId, onClose }) => { const classes = useStyles(); - const history = useHistory(); + const navigate = useNavigate(); const dispatch = useDispatch(); const t = useTranslation(); @@ -134,16 +134,16 @@ const StatusCard = ({ deviceId, onClose }) => { </CardContent> )} <CardActions classes={{ root: classes.actions }} disableSpacing> - <IconButton onClick={() => history.push(`/position/${position.id}`)} disabled={!position} color="secondary"> + <IconButton onClick={() => navigate(`/position/${position.id}`)} disabled={!position} color="secondary"> <PostAddIcon /> </IconButton> - <IconButton onClick={() => history.push('/replay')} disabled={!position}> + <IconButton onClick={() => navigate('/replay')} disabled={!position}> <ReplayIcon /> </IconButton> - <IconButton onClick={() => history.push(`/settings/command-send/${deviceId}`)} disabled={readonly}> + <IconButton onClick={() => navigate(`/settings/command-send/${deviceId}`)} disabled={readonly}> <PublishIcon /> </IconButton> - <IconButton onClick={() => history.push(`/settings/device/${deviceId}`)} disabled={deviceReadonly}> + <IconButton onClick={() => navigate(`/settings/device/${deviceId}`)} disabled={deviceReadonly}> <EditIcon /> </IconButton> <IconButton onClick={() => setRemoving(true)} disabled={deviceReadonly} className={classes.negative}> |