+ {/*
@@ -433,22 +445,12 @@ export const AccountFindPassword = props => {
{modal.desc}
- {
- udResult?.data.code === 0 ?
-
- :
- }
diff --git a/src/components/account/find/AccountFindUserId.js b/src/components/account/find/AccountFindUserId.js
index 27e8d62..78214e1 100644
--- a/src/components/account/find/AccountFindUserId.js
+++ b/src/components/account/find/AccountFindUserId.js
@@ -1,7 +1,7 @@
import * as yup from 'yup';
import classnames from 'classnames';
import { yupResolver } from '@hookform/resolvers/yup';
-import { useState, useEffect } from 'react'
+import { useState, useEffect, useMemo } from 'react'
import { useForm } from 'react-hook-form';
import { useDispatch, useSelector } from 'react-redux';
@@ -15,20 +15,6 @@ import { accountApi } from '../../../modules/account/register/apis/accountApi';
import { findAPI } from '../../../modules/account/find/apis/findApi';
export const AccountFindUserId = props => {
- // const validationSchema = yup.object().shape({
- // memberName: yup
- // .string()
- // .required('이름을 입력해 주세요.'),
- // hpno: yup.string().required('휴대폰번호를 입력해 주세요.')
- // })
-
- // const { register, getValues, setValue, errors, handleSubmit } = useForm({
- // defaultValues: {
- // memberName: '',
- // hpno: '',
- // },
- // resolver: yupResolver(validationSchema)
- // })
const dispatch = useDispatch();
const [activeTab, setActiveTab] = useState('2')
@@ -187,15 +173,30 @@ export const AccountFindUserId = props => {
}
}
- const handlerChange = (e) => {
+ let memberName = '';
+ let hpno = '';
+ let crtfyhp = '';
+ const handlerChange = e => {
const {name, value} = e.target;
if(name == 'memberName') {
- setInputName(value);
+ const regex = /^[ㄱ-ㅎ|ㅏ-ㅣ|가-힣|a-z]{0,10}$/;
+ if(regex.test(value)) {
+ memberName = value;
+ setInputName(memberName)
+ }
} else if(name == 'hpno') {
- setInputHpno(value);
+ const regex = /^[0-9]{0,11}$/;
+ if(regex.test(value)) {
+ hpno = value;
+ setInputHpno(hpno)
+ }
} else if(name == 'crtfyhpNo') {
- setInputCrtfy(value);
+ const regex = /^[0-9]{0,6}$/;
+ if(regex.test(value)) {
+ crtfyhp = value;
+ setInputCrtfy(crtfyhp)
+ }
}
}
@@ -223,13 +224,7 @@ export const AccountFindUserId = props => {
placeholder='이름'
value={inputName}
onChange={handlerChange}
- // className={classnames({
- // 'is-invalid': errors.memberName
- // })}
/>
- {/* {errors && errors.memberName && (
-