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/settings/components/CollectionFab.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/settings/components/CollectionFab.js')
-rw-r--r-- | modern/src/settings/components/CollectionFab.js | 6 |
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> ); |