From ad91510c6d0a600cb19678e6f3dd64f66656e01a Mon Sep 17 00:00:00 2001 From: ilyayudovin Date: Tue, 16 Jun 2020 17:24:29 +0300 Subject: fix: clear eslint errors --- src/pages/AuthPage/SignUpForm.tsx | 48 ++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 26 deletions(-) (limited to 'src/pages/AuthPage/SignUpForm.tsx') diff --git a/src/pages/AuthPage/SignUpForm.tsx b/src/pages/AuthPage/SignUpForm.tsx index 29f17b1..a4271d5 100644 --- a/src/pages/AuthPage/SignUpForm.tsx +++ b/src/pages/AuthPage/SignUpForm.tsx @@ -1,9 +1,8 @@ -import React, {useRef} from 'react'; -import {makeStyles} from '@material-ui/core/styles'; +import React, { useRef } from 'react'; +import { makeStyles } from '@material-ui/core/styles'; import TextField from '@material-ui/core/TextField'; import Button from '@material-ui/core/Button'; -import {Authorization} from '../../types'; -import {get, post} from '../../requests'; +import { post } from '../../requests'; interface PropTypes { logIn: (name: string, password: string) => Promise; @@ -35,7 +34,7 @@ const useStyles = makeStyles(theme => ({ } })); -const SignUpForm: React.FC = ({logIn,setAuthorization}) => { +const SignUpForm: React.FC = ({ logIn, setAuthorization }) => { const classes = useStyles(); const inputRef = useRef(); const inputRefPassword = useRef(); @@ -44,40 +43,37 @@ const SignUpForm: React.FC = ({logIn,setAuthorization}) => { const onClick = () => { const name = inputRef.current?.value; const password = inputRefPassword.current?.value; - const newUser = { - name: name, - password: password, - avatarUrl: '', - }; + const newUser = { name: name, password: password, avatarUrl: '' }; if (name && password) { - post(`/users`,newUser).then(response => { + post('/users', newUser).then(() => { logIn(name, password); }); } }; const handleSignIn = () => { - setAuthorization({authorize: 'signIn'}); + setAuthorization({ authorize: 'signIn' }); }; return ( <>
Sign Up
- - - - - -
-
Already have an account?
-
Sign In
-
- + + + + + +
+
Already have an account?
+
Sign In
+
+ ); }; -- cgit v1.2.3