diff --git a/src/component/Auth/Login.tsx b/src/component/Auth/Login.tsx new file mode 100644 index 0000000..dbecf2d --- /dev/null +++ b/src/component/Auth/Login.tsx @@ -0,0 +1,166 @@ +import { useRef, useState } from 'react'; +import styled from 'styled-components'; +import { useForm } from 'react-hook-form'; +import { AuthContent, RightAlignedLink, RegisterButton } from '.'; +import { theme, flexCenter, gap } from '../../style/theme'; + +const Login = () => { + const [passwordType, setPasswordType] = useState({ + type: 'password', + visible: false, + }); + + // password type 변경하는 함수 + const handlePasswordType = (e) => { + setPasswordType(() => { + if (!passwordType.visible) { + return { type: 'text', visible: true }; + } + return { type: 'password', visible: false }; + }); + }; + interface Form { + id: string; + pw: string; + } + const initValue: Form = { + id: '', + pw: '', + }; + const { + handleSubmit, + register, + watch, + formState: { errors }, + } = useForm