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' && } {auth === 'signUp' && }
{footerInfo[auth][0]}
{footerInfo[auth][1]}
); }; export default AuthPage;