From 8b57cdd86145d6e17c651b3646133641e65270e2 Mon Sep 17 00:00:00 2001 From: ilyayudovin Date: Mon, 15 Jun 2020 18:41:33 +0300 Subject: fix: resolve conflicts --- src/pages/AuthPage/SignInForm.tsx | 1 - 1 file changed, 1 deletion(-) (limited to 'src/pages/AuthPage/SignInForm.tsx') diff --git a/src/pages/AuthPage/SignInForm.tsx b/src/pages/AuthPage/SignInForm.tsx index 1d4ce0e..e2ae8b7 100644 --- a/src/pages/AuthPage/SignInForm.tsx +++ b/src/pages/AuthPage/SignInForm.tsx @@ -38,7 +38,6 @@ const SignInForm: React.FC = ({ logIn }) => { return (
-

Sign In

Date: Tue, 16 Jun 2020 15:14:40 +0300 Subject: add form transfer to signIn and signUp --- src/pages/AuthPage/SignInForm.tsx | 60 +++++++++++++++++++++++++++------------ 1 file changed, 42 insertions(+), 18 deletions(-) (limited to 'src/pages/AuthPage/SignInForm.tsx') diff --git a/src/pages/AuthPage/SignInForm.tsx b/src/pages/AuthPage/SignInForm.tsx index e2ae8b7..f4f763c 100644 --- a/src/pages/AuthPage/SignInForm.tsx +++ b/src/pages/AuthPage/SignInForm.tsx @@ -1,10 +1,11 @@ -import React, { useState, useRef } from 'react'; -import { makeStyles } from '@material-ui/core/styles'; +import React, {useState, useRef} from 'react'; +import {makeStyles} from '@material-ui/core/styles'; import TextField from '@material-ui/core/TextField'; import Button from '@material-ui/core/Button'; interface PropTypes { logIn: (name: string, password: string) => Promise; + setAuthorization: (authorization: { authorize: string }) => void ; } const useStyles = makeStyles(theme => ({ @@ -17,10 +18,22 @@ const useStyles = makeStyles(theme => ({ flexDirection: 'column', alignItems: 'center', textAlign: 'center' + }, + formTransfer: { + display: 'flex', + justifyContent: 'center' + }, + transferButton: { + marginLeft: 10, + color: 'green' + }, + formHeader: { + textAlign: 'center', + fontSize: 25 } })); -const SignInForm: React.FC = ({ logIn }) => { +const SignInForm: React.FC = ({logIn, setAuthorization}) => { const [error, setError] = useState(false); const classes = useStyles(); const nameRef = useRef(); @@ -36,22 +49,33 @@ const SignInForm: React.FC = ({ logIn }) => { } }; + const handleSignUp = () => { + setAuthorization({authorize: 'signUp'}); + }; + return ( - - - - - + <> +
Sign In
+
+ + + + +
+
Don't have an account?
+
Sign Up
+
+ ); }; -- cgit v1.2.3 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/SignInForm.tsx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/pages/AuthPage/SignInForm.tsx') diff --git a/src/pages/AuthPage/SignInForm.tsx b/src/pages/AuthPage/SignInForm.tsx index f4f763c..cf68493 100644 --- a/src/pages/AuthPage/SignInForm.tsx +++ b/src/pages/AuthPage/SignInForm.tsx @@ -1,11 +1,11 @@ -import React, {useState, useRef} from 'react'; -import {makeStyles} from '@material-ui/core/styles'; +import React, { useState, useRef } from 'react'; +import { makeStyles } from '@material-ui/core/styles'; import TextField from '@material-ui/core/TextField'; import Button from '@material-ui/core/Button'; interface PropTypes { logIn: (name: string, password: string) => Promise; - setAuthorization: (authorization: { authorize: string }) => void ; + setAuthorization: (authorization: { authorize: string }) => void; } const useStyles = makeStyles(theme => ({ @@ -21,11 +21,11 @@ const useStyles = makeStyles(theme => ({ }, formTransfer: { display: 'flex', - justifyContent: 'center' + justifyContent: 'center' }, transferButton: { marginLeft: 10, - color: 'green' + color: 'green' }, formHeader: { textAlign: 'center', @@ -33,7 +33,7 @@ const useStyles = makeStyles(theme => ({ } })); -const SignInForm: React.FC = ({logIn, setAuthorization}) => { +const SignInForm: React.FC = ({ logIn, setAuthorization }) => { const [error, setError] = useState(false); const classes = useStyles(); const nameRef = useRef(); @@ -50,12 +50,12 @@ const SignInForm: React.FC = ({logIn, setAuthorization}) => { }; const handleSignUp = () => { - setAuthorization({authorize: 'signUp'}); + setAuthorization({ authorize: 'signUp' }); }; return ( <> -
Sign In
+
Sign In
= ({logIn, setAuthorization}) => {
-
Don't have an account?
+
Don`t have an account?
Sign Up
-- cgit v1.2.3 From 171af45318b3c27c232fc7d1aee99976dfb3046e Mon Sep 17 00:00:00 2001 From: ilyayudovin Date: Tue, 16 Jun 2020 18:52:58 +0300 Subject: replace interface with simple string for authorization --- src/pages/AuthPage/SignInForm.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/pages/AuthPage/SignInForm.tsx') diff --git a/src/pages/AuthPage/SignInForm.tsx b/src/pages/AuthPage/SignInForm.tsx index cf68493..ae75541 100644 --- a/src/pages/AuthPage/SignInForm.tsx +++ b/src/pages/AuthPage/SignInForm.tsx @@ -5,7 +5,7 @@ import Button from '@material-ui/core/Button'; interface PropTypes { logIn: (name: string, password: string) => Promise; - setAuthorization: (authorization: { authorize: string }) => void; + setAuth: (auth: string) => void; } const useStyles = makeStyles(theme => ({ @@ -33,7 +33,7 @@ const useStyles = makeStyles(theme => ({ } })); -const SignInForm: React.FC = ({ logIn, setAuthorization }) => { +const SignInForm: React.FC = ({ logIn, setAuth }) => { const [error, setError] = useState(false); const classes = useStyles(); const nameRef = useRef(); @@ -50,7 +50,7 @@ const SignInForm: React.FC = ({ logIn, setAuthorization }) => { }; const handleSignUp = () => { - setAuthorization({ authorize: 'signUp' }); + setAuth('signUp'); }; return ( -- cgit v1.2.3 From e68d60d60880f4b1e847f7b092210fadfe5d6ab5 Mon Sep 17 00:00:00 2001 From: eug-vs Date: Tue, 16 Jun 2020 20:08:01 +0300 Subject: refactor: restructure components --- src/pages/AuthPage/SignInForm.tsx | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) (limited to 'src/pages/AuthPage/SignInForm.tsx') diff --git a/src/pages/AuthPage/SignInForm.tsx b/src/pages/AuthPage/SignInForm.tsx index ae75541..c521abf 100644 --- a/src/pages/AuthPage/SignInForm.tsx +++ b/src/pages/AuthPage/SignInForm.tsx @@ -5,35 +5,26 @@ import Button from '@material-ui/core/Button'; interface PropTypes { logIn: (name: string, password: string) => Promise; - 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 SignInForm: React.FC = ({ logIn, setAuth }) => { +const SignInForm: React.FC = ({ logIn }) => { const [error, setError] = useState(false); const classes = useStyles(); const nameRef = useRef(); @@ -49,10 +40,6 @@ const SignInForm: React.FC = ({ logIn, setAuth }) => { } }; - const handleSignUp = () => { - setAuth('signUp'); - }; - return ( <>
Sign In
@@ -71,10 +58,6 @@ const SignInForm: React.FC = ({ logIn, setAuth }) => { /> -
-
Don`t have an account?
-
Sign Up
-
); }; -- cgit v1.2.3