diff --git a/src/Components/Authentication/Login.js b/src/Components/Authentication/Login.js index e37d744..86e9dd3 100644 --- a/src/Components/Authentication/Login.js +++ b/src/Components/Authentication/Login.js @@ -7,7 +7,7 @@ import "./Login.css"; const initialFormState = { - email: "", password: "", authCode: "", resetCode: "", formType: "signIn" + email: "", password: "", authCode: "", resetCode: "" } function Login(props) { @@ -19,9 +19,6 @@ function Login(props) { const [newVerification, setNewVerification] = useState(false); const [loading, setLoading] = useState(false); - useEffect(() => { - updateFormState(() => ({...formState, formType: loginState})); - }, [loginState]) useEffect(() => { async function retrieveUser() { @@ -48,7 +45,6 @@ function Login(props) { updateFormState(() => ({...formState, [e.target.name]: e.target.value})) } - const {formType} = formState; async function signUp() { try { @@ -169,14 +165,14 @@ function Login(props) {
- {(formType === "signIn")? Sign In : (formType === "signUp")? Sign Up : (formType === "confirmSignUp")? Verify Account : (formType === "forgotPassword" || formType === "resetPassword")? Password Reset : Welcome} + {(loginState === "signIn")? Sign In : (loginState === "signUp")? Sign Up : (loginState === "confirmSignUp")? Verify Account : (loginState === "forgotPassword" || loginState === "resetPassword")? Password Reset : Welcome}
{ - formType === "signIn" && ( + loginState === "signIn" && ( @@ -237,7 +233,7 @@ function Login(props) { ) } { - formType === "forgotPassword" && ( + loginState === "forgotPassword" && ( @@ -270,7 +266,7 @@ function Login(props) { ) } { - formType === "resetPassword" && ( + loginState === "resetPassword" && ( @@ -319,7 +315,7 @@ function Login(props) { ) } { - formType === "signUp" && ( + loginState === "signUp" && ( @@ -362,7 +358,7 @@ function Login(props) { ) } { - formType === "confirmSignUp" && ( + loginState === "confirmSignUp" && (