aboutsummaryrefslogtreecommitdiff
path: root/modern/src/other/ReplayPage.js
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-05-23 06:44:15 -0700
committerAnton Tananaev <anton@traccar.org>2022-05-23 06:44:15 -0700
commitddcb42512e95e98806db0523e4d954484a6e48cc (patch)
tree795fbd841eb94ded02ce66a2a2c50c2cc52a7dcd /modern/src/other/ReplayPage.js
parentfdbc6762b10233950d9c84fc71a9a8c11823f0a9 (diff)
downloadtrackermap-web-ddcb42512e95e98806db0523e4d954484a6e48cc.tar.gz
trackermap-web-ddcb42512e95e98806db0523e4d954484a6e48cc.tar.bz2
trackermap-web-ddcb42512e95e98806db0523e4d954484a6e48cc.zip
Upgrade router and navigation
Diffstat (limited to 'modern/src/other/ReplayPage.js')
-rw-r--r--modern/src/other/ReplayPage.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/modern/src/other/ReplayPage.js b/modern/src/other/ReplayPage.js
index 5e759d7e..c95240be 100644
--- a/modern/src/other/ReplayPage.js
+++ b/modern/src/other/ReplayPage.js
@@ -10,7 +10,7 @@ import PlayArrowIcon from '@material-ui/icons/PlayArrow';
import PauseIcon from '@material-ui/icons/Pause';
import FastForwardIcon from '@material-ui/icons/FastForward';
import FastRewindIcon from '@material-ui/icons/FastRewind';
-import { useHistory } from 'react-router-dom';
+import { useNavigate } from 'react-router-dom';
import { useSelector } from 'react-redux';
import Map from '../map/core/Map';
import MapReplayPath from '../map/MapReplayPath';
@@ -78,7 +78,7 @@ const TimeLabel = ({ children, open, value }) => (
const ReplayPage = () => {
const t = useTranslation();
const classes = useStyles();
- const history = useHistory();
+ const navigate = useNavigate();
const timerRef = useRef();
const defaultDeviceId = useSelector((state) => state.devices.selectedId);
@@ -100,8 +100,8 @@ const ReplayPage = () => {
});
const onClick = useCallback((positionId) => {
- history.push(`/position/${positionId}`);
- }, [history]);
+ navigate(`/position/${positionId}`);
+ }, [navigate]);
useEffect(() => {
if (playing && positions.length > 0) {
@@ -146,7 +146,7 @@ const ReplayPage = () => {
<div className={classes.sidebar}>
<Paper elevation={3} square>
<Toolbar>
- <IconButton onClick={() => history.push('/')}>
+ <IconButton onClick={() => navigate('/')}>
<ArrowBackIcon />
</IconButton>
<Typography variant="h6" className={classes.title}>{t('reportReplay')}</Typography>