From 1f646377c35b65b97d6eeebb1e88f6d8307e1ef0 Mon Sep 17 00:00:00 2001
From: eug-vs <eug-vs@keemail.me>
Date: Mon, 29 Jun 2020 23:59:15 +0300
Subject: feat!: create useAuth hook

---
 src/pages/AuthPage/AuthPage.tsx | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

(limited to 'src/pages/AuthPage/AuthPage.tsx')

diff --git a/src/pages/AuthPage/AuthPage.tsx b/src/pages/AuthPage/AuthPage.tsx
index d2c2eec..ad93463 100644
--- a/src/pages/AuthPage/AuthPage.tsx
+++ b/src/pages/AuthPage/AuthPage.tsx
@@ -3,11 +3,6 @@ import { makeStyles } from '@material-ui/core/styles';
 import SignInForm from './SignInForm';
 import SignUpForm from './SignUpForm';
 
-
-interface PropTypes {
-  logIn: (name: string, password: string, remember?: boolean) => Promise<boolean>;
-}
-
 const useStyles = makeStyles({
   formTransfer: {
     display: 'flex',
@@ -20,7 +15,7 @@ const useStyles = makeStyles({
   }
 });
 
-const AuthPage: React.FC<PropTypes> = ({ logIn }) => {
+const AuthPage: React.FC = () => {
   const [auth, setAuth] = useState<'signIn' | 'signUp'>('signIn');
   const classes = useStyles();
 
@@ -35,8 +30,8 @@ const AuthPage: React.FC<PropTypes> = ({ logIn }) => {
 
   return (
     <>
-      {auth === 'signIn' && <SignInForm logIn={logIn} />}
-      {auth === 'signUp' && <SignUpForm logIn={logIn} />}
+      {auth === 'signIn' && <SignInForm />}
+      {auth === 'signUp' && <SignUpForm />}
       <div className={classes.formTransfer}>
         <div>{footerInfo[auth][0]}</div>
         <span
-- 
cgit v1.2.3

