diff options
Diffstat (limited to 'src/pages/AuthPage/SignUpForm.tsx')
-rw-r--r-- | src/pages/AuthPage/SignUpForm.tsx | 24 |
1 files changed, 3 insertions, 21 deletions
diff --git a/src/pages/AuthPage/SignUpForm.tsx b/src/pages/AuthPage/SignUpForm.tsx index 0013372..2769eb0 100644 --- a/src/pages/AuthPage/SignUpForm.tsx +++ b/src/pages/AuthPage/SignUpForm.tsx @@ -6,44 +6,34 @@ import { post } from '../../requests'; interface PropTypes { logIn: (name: string, password: string) => Promise<boolean>; - setAuth: (auth: string) => void ; } const useStyles = makeStyles(theme => ({ root: { '& > *': { margin: theme.spacing(1), - width: '25ch' + width: theme.spacing(35) }, display: 'flex', flexDirection: 'column', alignItems: 'center', textAlign: 'center' }, - formTransfer: { - display: 'flex', - justifyContent: 'center' - }, - transferButton: { - marginLeft: 10, - color: 'green' - }, formHeader: { textAlign: 'center', fontSize: 25 } })); -const SignUpForm: React.FC<PropTypes> = ({ logIn, setAuth }) => { +const SignUpForm: React.FC<PropTypes> = ({ logIn }) => { const classes = useStyles(); const inputRef = useRef<HTMLInputElement>(); const inputRefPassword = useRef<HTMLInputElement>(); - const onClick = () => { const name = inputRef.current?.value; const password = inputRefPassword.current?.value; - const newUser = { name: name, password: password, avatarUrl: '' }; + const newUser = { name, password }; if (name && password) { post('/users', newUser).then(() => { logIn(name, password); @@ -51,10 +41,6 @@ const SignUpForm: React.FC<PropTypes> = ({ logIn, setAuth }) => { } }; - const handleSignIn = () => { - setAuth( 'signIn'); - }; - return ( <> <div className={classes.formHeader}>Sign Up</div> @@ -69,10 +55,6 @@ const SignUpForm: React.FC<PropTypes> = ({ logIn, setAuth }) => { /> <Button variant="contained" onClick={onClick}>submit</Button> </form> - <div className={classes.formTransfer}> - <div>Already have an account?</div> - <div className={classes.transferButton} onClick={handleSignIn}>Sign In</div> - </div> </> ); }; |