From 2fb5078733f8bcb6a5a6ab02b7db3b8a65988436 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?hagjoon=28=EC=9D=B4=ED=95=99=EC=A4=80=29?= Date: Thu, 15 Sep 2022 16:06:06 +0900 Subject: [PATCH 1/2] =?UTF-8?q?[=ED=94=84=EB=A1=9C=ED=95=84]=20=ED=9C=B4?= =?UTF-8?q?=EB=8C=80=ED=8F=B0=20=EB=B2=88=ED=98=B8=2011=EC=9E=90=EB=A6=AC?= =?UTF-8?q?=20=EC=A0=9C=ED=95=9C=20=EB=B0=8F=20=EC=95=8C=EB=9E=8C=EB=AA=A8?= =?UTF-8?q?=EB=8B=AC=20=EC=83=89=EC=83=81=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../account/mypage/AccountMypageForm.js | 2 +- .../account/mypage/AccountMypageContainer.js | 51 ++++++++++++++----- 2 files changed, 39 insertions(+), 14 deletions(-) diff --git a/src/components/account/mypage/AccountMypageForm.js b/src/components/account/mypage/AccountMypageForm.js index 8e67d09f..12d3d31f 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/containers/account/mypage/AccountMypageContainer.js b/src/containers/account/mypage/AccountMypageContainer.js index 68d3cf2f..c0fc75bd 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' > Date: Thu, 15 Sep 2022 16:18:24 +0900 Subject: [PATCH 2/2] =?UTF-8?q?=EA=B0=80=EC=9E=85=EC=A0=95=EB=B3=B4=20?= =?UTF-8?q?=ED=8E=98=EC=9D=B4=EC=A7=80=20state=20=EC=98=A4=ED=83=80=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../account/register/AccountRegisterForm.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/components/account/register/AccountRegisterForm.js b/src/components/account/register/AccountRegisterForm.js index d7567a2e..aa41d509 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)) {