From 013afc743014d0b6cf89bcec60681a52ad7b0716 Mon Sep 17 00:00:00 2001 From: skiende74 Date: Sun, 10 Nov 2024 19:15:01 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EB=A6=AC=EB=B7=B0=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EnterVerificationCodeStep.tsx | 83 ++++--------------- .../ResetPassword/ResetPasswordStep.tsx | 69 ++------------- .../SendVerificationEmailStep.tsx | 73 +++------------- .../src/components/ResetPassword/style.ts | 57 +++++++++++++ 4 files changed, 93 insertions(+), 189 deletions(-) create mode 100644 frontend/src/components/ResetPassword/style.ts diff --git a/frontend/src/components/ResetPassword/EnterVerificationCodeStep.tsx b/frontend/src/components/ResetPassword/EnterVerificationCodeStep.tsx index 0fc3be1eb..76ff29d62 100644 --- a/frontend/src/components/ResetPassword/EnterVerificationCodeStep.tsx +++ b/frontend/src/components/ResetPassword/EnterVerificationCodeStep.tsx @@ -1,4 +1,3 @@ -import styled from '@emotion/styled'; import { useState } from 'react'; import { useNavigate } from 'react-router-dom'; @@ -7,10 +6,10 @@ import Button from '@/components/_common/Button/Button'; import FlexBox from '@/components/_common/FlexBox/FlexBox'; import FormField from '@/components/_common/FormField/FormField'; import Header from '@/components/_common/Header/Header'; +import CS from '@/components/ResetPassword/style'; import { ROUTE_PATH } from '@/constants/routePath'; import usePostResetPasswordMail from '@/hooks/query/usePostResetPasswordMail'; import useValidateInput from '@/hooks/useValidateInput'; -import { flexCenter, title3 } from '@/styles/common'; import { ResetPasswordArgs } from '@/types/user'; interface Props { @@ -22,10 +21,11 @@ const SendVerificationEmailStep = ({ args: { email }, onNext }: Props) => { const [isComplete, setIsComplete] = useState(false); const [postErrorMessage, setPostErrorMessage] = useState(''); const { mutate: postResetMail } = usePostResetPasswordMail(); + const { value: code, - getErrorMessage: getEmailErrors, - onChange: onChangeEmail, + getErrorMessage: getCodeErrors, + onChange: onChangeCode, isValidated: isEmailValid, } = useValidateInput({ initialValue: '', @@ -37,6 +37,7 @@ const SendVerificationEmailStep = ({ args: { email }, onNext }: Props) => { onSuccess: () => setIsComplete(true), onError: error => setPostErrorMessage(error.message), }); + const handleClickNext = () => { onNext({ code, email }); }; @@ -55,13 +56,13 @@ const SendVerificationEmailStep = ({ args: { email }, onNext }: Props) => { return ( <>
} /> - - + + - - - 비밀번호 찾기 + + + 비밀번호 찾기 @@ -69,14 +70,16 @@ const SendVerificationEmailStep = ({ args: { email }, onNext }: Props) => { maxLength={254} value={code} name="email" - onChange={onChangeEmail} + onChange={onChangeCode} style={{ width: '25rem' }} />
- 전송 + + 전송 +
- {getEmailErrors() && } + {getCodeErrors() && }
{postErrorMessage && }