aboutsummaryrefslogtreecommitdiff
path: root/src/pages/AuthPage/AuthPage.tsx
diff options
context:
space:
mode:
authorilyayudovin <ilyayudovin123@gmail.com>2020-06-16 18:52:58 +0300
committerilyayudovin <ilyayudovin123@gmail.com>2020-06-16 18:52:58 +0300
commit171af45318b3c27c232fc7d1aee99976dfb3046e (patch)
treefb0dd6c829a41f06c231f72ed8c830a86950a315 /src/pages/AuthPage/AuthPage.tsx
parentad91510c6d0a600cb19678e6f3dd64f66656e01a (diff)
downloadwhich-ui-171af45318b3c27c232fc7d1aee99976dfb3046e.tar.gz
replace interface with simple string for authorization
Diffstat (limited to 'src/pages/AuthPage/AuthPage.tsx')
-rw-r--r--src/pages/AuthPage/AuthPage.tsx7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/pages/AuthPage/AuthPage.tsx b/src/pages/AuthPage/AuthPage.tsx
index fc7f404..0072686 100644
--- a/src/pages/AuthPage/AuthPage.tsx
+++ b/src/pages/AuthPage/AuthPage.tsx
@@ -1,7 +1,6 @@
import React, { useState } from 'react';
import SignInForm from './SignInForm';
import SignUpForm from './SignUpForm';
-import { Authorization } from '../../types';
interface PropTypes {
@@ -9,12 +8,12 @@ interface PropTypes {
}
const AuthPage: React.FC<PropTypes> = ({ logIn }) => {
- const [authorization, setAuthorization] = useState<Authorization>({ authorize: 'signIn' });
+ const [auth, setAuth] = useState<String>('signIn');
return (
<>
- {authorization.authorize === 'signIn' && <SignInForm logIn={logIn} setAuthorization={setAuthorization} />}
- {authorization.authorize === 'signUp' && <SignUpForm logIn={logIn} setAuthorization={setAuthorization} />}
+ {auth === 'signIn' && <SignInForm logIn={logIn} setAuth={setAuth} />}
+ {auth === 'signUp' && <SignUpForm logIn={logIn} setAuth={setAuth} />}
</>
);
};