diff --git a/src/components/account/mypage/AccountMypageForm.js b/src/components/account/mypage/AccountMypageForm.js index 8e67d09..12d3d31 100644 --- a/src/components/account/mypage/AccountMypageForm.js +++ b/src/components/account/mypage/AccountMypageForm.js @@ -103,7 +103,7 @@ const AccountMypageForm = ({ userInfo,handlerSmsSend,isCrtfy,seconds_Counter,han - + {/* 발송 버튼을 누르면 남은시간 d-none를 빼주세여~ 그럼나타나여~ */} diff --git a/src/components/account/register/AccountRegisterForm.js b/src/components/account/register/AccountRegisterForm.js index d7567a2..aa41d50 100644 --- a/src/components/account/register/AccountRegisterForm.js +++ b/src/components/account/register/AccountRegisterForm.js @@ -25,7 +25,13 @@ import { useDispatch, useSelector } from 'react-redux'; import { accountApi } from '../../../modules/account/register/apis/accountApi'; import * as Actions from '../../../modules/account/register/actions/accountAction'; -export const AccountRegisterForm = ({ stepper, type, movePage, testName, setMemberName }) => { +export const AccountRegisterForm = ({ + stepper, + type, + movePage, + testName, + setMemberName +}) => { const { agreeTerms } = useSelector(state => state.accountState); const [minutes_Counter, setMinutes_Counter] = useState('03'); const [seconds_Counter, setSeconds_Counter] = useState('00'); @@ -167,7 +173,7 @@ export const AccountRegisterForm = ({ stepper, type, movePage, testName, setMemb .oneOf([yup.ref('userPswd'), null], '비밀번호가 일치하지 않습니다.') }); - const { register, getValues, setValuey, errors, handleSubmit } = useForm({ + const { register, getValues, setValue, errors, handleSubmit } = useForm({ defaultValues: { userId: '', userPswd: '', @@ -272,11 +278,11 @@ export const AccountRegisterForm = ({ stepper, type, movePage, testName, setMemb // console.log(register); const { name, value } = e.target; - if(name == 'memberName') { + if (name === 'memberName') { setMemberName(value); } - if (name == 'brthdyDate') { + if (name === 'brthdyDate') { const regex = /^[0-9\b]{0,8}$/; if (regex.test(value)) { @@ -285,7 +291,7 @@ export const AccountRegisterForm = ({ stepper, type, movePage, testName, setMemb } else { setValue(name, brthdyDate); } - } else if (name == 'hpno') { + } else if (name === 'hpno') { const regex = /^[0-9\b]{0,11}$/; if (regex.test(value)) { diff --git a/src/containers/account/mypage/AccountMypageContainer.js b/src/containers/account/mypage/AccountMypageContainer.js index 68d3cf2..c0fc75b 100644 --- a/src/containers/account/mypage/AccountMypageContainer.js +++ b/src/containers/account/mypage/AccountMypageContainer.js @@ -48,7 +48,8 @@ const AccountMypageContainer = () => { const [modal, setModal] = useState({ isOpen: false, title: '', - desc: '' + desc: '', + color: '' }); const timerStart = count => { @@ -69,6 +70,12 @@ const AccountMypageContainer = () => { setIsRunning(false); setInputCrtfy('crtfyhpNo', ''); // setCrtfyNo(''); + setModal({ + isOpen: true, + title: '인증번호 만료', + desc: '인증번호가 만료되었습니다.', + color: 'modal-danger' + }) } }, 1000); @@ -92,7 +99,8 @@ const AccountMypageContainer = () => { setModal({ isOpen: true, title: '인증번호 발송', - desc: '휴대폰 번호를 입력 해주세요.' + desc: '휴대폰 번호를 입력 해주세요.', + color: 'modal-danger' }); return; } @@ -100,7 +108,8 @@ const AccountMypageContainer = () => { setModal({ isOpen: true, title: '인증번호 발송', - desc: '인증번호 발송은 3회 까지만 가능합니다.' + desc: '인증번호 발송은 3회 까지만 가능합니다.', + color: 'modal-danger' }); return; } @@ -111,13 +120,15 @@ const AccountMypageContainer = () => { setModal({ isOpen: true, title: '인증번호 발송', - desc: '이미 가입된 휴대폰 입니다.' + desc: '이미 가입된 휴대폰 입니다.', + color: 'modal-danger' }); } else { setModal({ isOpen: true, title: '인증번호 발송', - desc: '인증번호 발송을 실패하였습니다.' + desc: '인증번호 발송을 실패하였습니다.', + color: 'modal-danger' }); } return; @@ -126,7 +137,8 @@ const AccountMypageContainer = () => { setModal({ isOpen: true, title: '인증번호 발송', - desc: '인증번호를 발송했습니다.' + desc: '인증번호를 발송했습니다.', + color: 'modal-primary' }); } } @@ -161,7 +173,8 @@ const AccountMypageContainer = () => { setModal({ isOpen: true, title: '인증번호 인증', - desc: '휴대폰 번호를 입력 해주세요.' + desc: '휴대폰 번호를 입력 해주세요.', + color: 'modal-danger' }); return false; @@ -170,7 +183,8 @@ const AccountMypageContainer = () => { setModal({ isOpen: true, title: '인증번호 인증', - desc: '인증번호 를 입력 해주세요.' + desc: '인증번호 를 입력 해주세요.', + color: 'modal-danger' }); return false; } @@ -181,7 +195,8 @@ const AccountMypageContainer = () => { setModal({ isOpen: true, title: '인증번호 인증', - desc: '인증번호 가 잘못 되었습니다.' + desc: '인증번호 가 잘못 되었습니다.', + color: 'modal-danger' }) } else if (res?.data.code === 0) { @@ -195,7 +210,7 @@ const AccountMypageContainer = () => { setModal({ isOpen: true, title: '인증번호 성공', - desc: '인증번호 성공했습니다.', + desc: '인증되었습니다', color: 'modal-primary' }) setOkinput(!okinput); @@ -228,13 +243,23 @@ const AccountMypageContainer = () => { setFormModal(!formModal) } + let hpno = ''; + let crtfyhp = ''; const handlerChange = (e) => { const { name, value } = e.target; 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) + } } } //업데이트 @@ -299,7 +324,7 @@ const AccountMypageContainer = () => { setModal({ ...modal, isOpen: !modal.isOpen })} - modalClassName='modal-danger' + modalClassName={modal.color} className='modal-dialog-centered' >