aboutsummaryrefslogtreecommitdiff
path: root/src/pages/AuthPage/AuthPage.tsx
diff options
context:
space:
mode:
authorEugene Sokolov <eug-vs@keemail.me>2020-08-08 11:28:07 +0300
committerGitHub <noreply@github.com>2020-08-08 11:28:07 +0300
commit70d533d2bcbaa689d3de6ecb532997cd68a7a842 (patch)
tree0199ab8a91f3e1bd5df0865c10695dde20a5303f /src/pages/AuthPage/AuthPage.tsx
parent84eaed2f29ac370eea7c4a7ded6fb3d4661c9679 (diff)
parent104c658fc411536e09931191721411de448f964f (diff)
downloadwhich-ui-70d533d2bcbaa689d3de6ecb532997cd68a7a842.tar.gz
Merge pull request #72 from which-ecosystem/feat/routing
Add basic routing
Diffstat (limited to 'src/pages/AuthPage/AuthPage.tsx')
-rw-r--r--src/pages/AuthPage/AuthPage.tsx50
1 files changed, 0 insertions, 50 deletions
diff --git a/src/pages/AuthPage/AuthPage.tsx b/src/pages/AuthPage/AuthPage.tsx
deleted file mode 100644
index ad93463..0000000
--- a/src/pages/AuthPage/AuthPage.tsx
+++ /dev/null
@@ -1,50 +0,0 @@
-import React, { useState } from 'react';
-import { makeStyles } from '@material-ui/core/styles';
-import SignInForm from './SignInForm';
-import SignUpForm from './SignUpForm';
-
-const useStyles = makeStyles({
- formTransfer: {
- display: 'flex',
- justifyContent: 'center'
- },
- transferButton: {
- marginLeft: 10,
- color: 'green',
- cursor: 'pointer'
- }
-});
-
-const AuthPage: React.FC = () => {
- const [auth, setAuth] = useState<'signIn' | 'signUp'>('signIn');
- const classes = useStyles();
-
- const handleRedirect = () => {
- setAuth(auth === 'signIn' ? 'signUp' : 'signIn');
- };
-
- const footerInfo = {
- signIn: ['Don\'t have an account?', 'Sign up'],
- signUp: ['Already have an account?', 'Sign in']
- };
-
- return (
- <>
- {auth === 'signIn' && <SignInForm />}
- {auth === 'signUp' && <SignUpForm />}
- <div className={classes.formTransfer}>
- <div>{footerInfo[auth][0]}</div>
- <span
- onClick={handleRedirect}
- className={classes.transferButton}
- role="presentation"
- >
- {footerInfo[auth][1]}
- </span>
- </div>
- </>
- );
-};
-
-export default AuthPage;
-