diff --git a/frontend/src/components/SignIn.js b/frontend/src/components/SignIn.js index 346eff31..9929d327 100644 --- a/frontend/src/components/SignIn.js +++ b/frontend/src/components/SignIn.js @@ -1,24 +1,23 @@ -import React, { useEffect } from "react"; +import React, { useEffect, useState } from "react"; import { useForm } from "react-hook-form"; import { Text, Stack, Box, FormControl, - FormErrorMessage, InputGroup, - Button, Input, InputRightElement, + Button, } from "@chakra-ui/react"; import CustomIcon from "./CustomIcon"; import { useLogin } from "../core/hooks"; -import PasswordInput from "./PasswordInput"; import { MODAL_TYPES } from "../core/providers/OverlayProvider/constants"; const SignIn = ({ toggleModal }) => { const { handleSubmit, errors, register } = useForm(); const { login, isLoading, data } = useLogin(); + const [showPassword, togglePassword] = useState(false); useEffect(() => { if (!data) { @@ -30,70 +29,135 @@ const SignIn = ({ toggleModal }) => { return ( <> - - To your Moonstream account -
- + +
+ {errors.username ? errors.username.message : "Username"} +
- + - - {errors.username && errors.username.message} - +
+ {errors.password ? errors.password.message : "Password"} +
- - - {errors.password && errors.password.message} - + + + togglePassword(!showPassword)}> + + + + + {" "} + toggleModal({ type: MODAL_TYPES.FORGOT })} + > + Forgot your password? + +
+ - - {" "} - toggleModal({ type: MODAL_TYPES.FORGOT })} - > - Forgot your password? - - - - + + Don`t have an account?{" "} toggleModal({ type: MODAL_TYPES.SIGNUP })} >