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/login/RegisterPage.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/login/RegisterPage.js')
-rw-r--r-- | modern/src/login/RegisterPage.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/modern/src/login/RegisterPage.js b/modern/src/login/RegisterPage.js index 78728b58..5fa061bb 100644 --- a/modern/src/login/RegisterPage.js +++ b/modern/src/login/RegisterPage.js @@ -2,7 +2,7 @@ import React, { useState } from 'react'; import { Grid, Button, TextField, Typography, Link, makeStyles, Snackbar, } from '@material-ui/core'; -import { useHistory } from 'react-router-dom'; +import { useNavigate } from 'react-router-dom'; import ArrowBackIcon from '@material-ui/icons/ArrowBack'; import LoginLayout from './LoginLayout'; import { useTranslation } from '../common/components/LocalizationProvider'; @@ -26,7 +26,7 @@ const useStyles = makeStyles((theme) => ({ const RegisterPage = () => { const classes = useStyles(); - const history = useHistory(); + const navigate = useNavigate(); const t = useTranslation(); const [name, setName] = useState(''); @@ -51,7 +51,7 @@ const RegisterPage = () => { <LoginLayout> <Snackbar open={snackbarOpen} - onClose={() => history.push('/login')} + onClose={() => navigate('/login')} autoHideDuration={snackBarDurationShortMs} message={t('loginCreated')} /> @@ -59,7 +59,7 @@ const RegisterPage = () => { <Grid container item> <Grid item> <Typography className={classes.link} color="primary"> - <Link onClick={() => history.push('/login')}> + <Link onClick={() => navigate('/login')}> <ArrowBackIcon /> </Link> </Typography> |