diff options
author | Ashutosh Bishnoi <mail2bishnoi@gmail.com> | 2021-06-15 14:11:17 +0530 |
---|---|---|
committer | Ashutosh Bishnoi <mail2bishnoi@gmail.com> | 2021-06-15 14:11:17 +0530 |
commit | 2bbb45f8234b07f5c9b40e98650b2a6eead352c1 (patch) | |
tree | 66bbaa2decf8fb24bfc6e32069a5ad22a0ec59e2 /modern/src/components/registration/RegisterForm.js | |
parent | b7928f760ab557be29ade8c4b8e1605feed6fd7f (diff) | |
download | trackermap-web-2bbb45f8234b07f5c9b40e98650b2a6eead352c1.tar.gz trackermap-web-2bbb45f8234b07f5c9b40e98650b2a6eead352c1.tar.bz2 trackermap-web-2bbb45f8234b07f5c9b40e98650b2a6eead352c1.zip |
Fixed login screen issues
Diffstat (limited to 'modern/src/components/registration/RegisterForm.js')
-rw-r--r-- | modern/src/components/registration/RegisterForm.js | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/modern/src/components/registration/RegisterForm.js b/modern/src/components/registration/RegisterForm.js index c2af04ba..62605eb3 100644 --- a/modern/src/components/registration/RegisterForm.js +++ b/modern/src/components/registration/RegisterForm.js @@ -1,7 +1,8 @@ import React, { useState } from 'react'; import { Grid, Button, TextField, Typography, Link, makeStyles, Snackbar } from '@material-ui/core'; +import { useHistory } from 'react-router-dom'; import ArrowBackIcon from '@material-ui/icons/ArrowBack'; -import LoginForm from './LoginForm'; +import LoginPage from './../../LoginPage'; import t from './../../common/localization'; const useStyles = makeStyles(theme => ({ @@ -17,13 +18,11 @@ const useStyles = makeStyles(theme => ({ } })); -const forms = { - login: () => LoginForm, -}; - -const RegisterForm = ({ setCurrentForm }) => { +const RegisterForm = () => { const classes = useStyles(); + const history = useHistory(); + const [name, setName] = useState(''); const [email, setEmail] = useState(''); const [password, setPassword] = useState(''); @@ -46,18 +45,18 @@ const RegisterForm = ({ setCurrentForm }) => { } return ( - <> + <LoginPage> <Snackbar anchorOrigin={{ vertical: 'top', horizontal: 'center' }} open={snackbarOpen} - onClose={() => setCurrentForm(forms.login)} + onClose={() => history.push('/login')} autoHideDuration={6000} message={t('loginCreated')} /> <Grid container direction='column' spacing={3}> <Grid container item> <Grid item> <Typography className={classes.link} color='primary'> - <Link onClick={() => setCurrentForm(forms.login)}> + <Link onClick={() => history.push('/login')}> <ArrowBackIcon /> </Link> </Typography> @@ -115,7 +114,7 @@ const RegisterForm = ({ setCurrentForm }) => { </Button> </Grid> </Grid> - </> + </LoginPage> ) } |