aboutsummaryrefslogtreecommitdiff
path: root/modern/src/settings/components/CollectionFab.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/settings/components/CollectionFab.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/settings/components/CollectionFab.js')
-rw-r--r--modern/src/settings/components/CollectionFab.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/modern/src/settings/components/CollectionFab.js b/modern/src/settings/components/CollectionFab.js
index f52bed38..36435cd9 100644
--- a/modern/src/settings/components/CollectionFab.js
+++ b/modern/src/settings/components/CollectionFab.js
@@ -1,7 +1,7 @@
import React from 'react';
import { Fab, makeStyles } from '@material-ui/core';
import AddIcon from '@material-ui/icons/Add';
-import { useHistory } from 'react-router-dom';
+import { useNavigate } from 'react-router-dom';
import { useReadonly } from '../../common/util/permissions';
import dimensions from '../../common/theme/dimensions';
@@ -18,13 +18,13 @@ const useStyles = makeStyles((theme) => ({
const CollectionFab = ({ editPath, disabled }) => {
const classes = useStyles();
- const history = useHistory();
+ const navigate = useNavigate();
const readonly = useReadonly();
if (!readonly && !disabled) {
return (
- <Fab size="medium" color="primary" className={classes.fab} onClick={() => history.push(editPath)}>
+ <Fab size="medium" color="primary" className={classes.fab} onClick={() => navigate(editPath)}>
<AddIcon />
</Fab>
);