Browse Source

마이페이지(업데이트 수정본)

feature/auth
sanguu 2 years ago
parent
commit
9f18339f9c
  1. 14
      src/components/account/mypage/AccountMypageForm.js
  2. 14
      src/containers/account/mypage/AccountMypageContainer.js

14
src/components/account/mypage/AccountMypageForm.js

@ -162,19 +162,19 @@ const AccountMypageForm = ({ userInfo, handler, formModal,handlerUpdate,handlerI
<Col className='list-input' md='3' sm='12'>
<FormGroup>
<Label for='memberName'>이름</Label>
<Input type='text' id='memberName' size='sm' placeholder='' value={userInfo[0].memberName || ''} disabled />
<Input type='text' id='memberName' size='sm' placeholder='' value={userInfo.memberName || ''} disabled />
</FormGroup>
</Col>
<Col className='list-input' md='3' sm='12'>
<FormGroup>
<Label for='brithdyDate'>생년월일</Label>
<Input type='text' id='brithdyDate' size='sm' placeholder='' value={userInfo[0].brthdyDate || ""} disabled />
<Input type='text' id='brithdyDate' size='sm' placeholder='' value={userInfo.brthdyDate || ""} disabled />
</FormGroup>
</Col>
<Col className='list-input' md='3' sm='12'>
<FormGroup>
<Label for='cenderCD'>성별</Label>
<Input type='select' name='select' size='sm' id='cenderCD' value={userInfo[0].genderCd || ""} disabled >
<Input type='select' name='select' size='sm' id='cenderCD' value={userInfo.genderCd || ""} disabled >
<option>남자</option>
<option>여자</option>
</Input>
@ -191,13 +191,13 @@ const AccountMypageForm = ({ userInfo, handler, formModal,handlerUpdate,handlerI
<Col className='list-input' md='3' sm='12'>
<FormGroup>
<Label for='userId'>ID</Label>
<Input type='text' id='userId' size='sm' placeholder='' value={userInfo[0].userId || ""} diabled />
<Input type='text' id='userId' size='sm' placeholder='' value={userInfo.userId || ""} disabled />
</FormGroup>
</Col>
<Col className='list-input' md='3' sm='12'>
<FormGroup>
<Label for='email'>E-mail</Label>
<Input type='text' id='email' size='sm' placeholder='' value={userInfo[0].email} onChange={handlerInput} />
<Input type='text' id='email' name='email' size='sm' placeholder='' defaultValue={userInfo.email} onChange={(e) => handlerInput(e)} />
</FormGroup>
</Col>
<Col className='list-input' md='3' sm='12'>
@ -210,7 +210,7 @@ const AccountMypageForm = ({ userInfo, handler, formModal,handlerUpdate,handlerI
<span className='d-sm-inline-block'>변경</span>
</Button.Ripple>
</div>
<Input type='number' name='clncd' id='hpno' size='sm' placeholder='' value={userInfo[0].hpno || ""} />
<Input type='number' name='clncd' id='hpno' size='sm' placeholder='' value={userInfo.hpno || ""} />
<div>
<Modal
isOpen={formModal}
@ -231,7 +231,7 @@ const AccountMypageForm = ({ userInfo, handler, formModal,handlerUpdate,handlerI
<Row className='input-inline-btn'>
<Col md='8'>
<Label className='form-label' for='hpno'>휴대폰 번호</Label>
<Input type='number' name='test' id='hpno' size='sm' />
<Input type='number' disabled name='test' id='hpno' size='sm' />
</Col>
<Col md='4' xs='12'>
{/* 발송 버튼을 누르면 남은시간 d-none를 빼주세여~ 그럼나타나여~ */}

14
src/containers/account/mypage/AccountMypageContainer.js

@ -36,14 +36,14 @@ const AccountMypageContainer = () => {
useEffect(() => {
if (userPage)
setUserInfo(userPage)
setUserInfo(userPage[0])
}, [userPage])
const handlerInput = e => {
const { name, value } = e.target;
setParams({
...params,
setUserInfo({
...userInfo,
[name]: value
});
};
@ -62,8 +62,8 @@ const AccountMypageContainer = () => {
const handlerUpdate = () => {
const param = {
cstmrSno: user.cstmrSno,
email: userPage[0].email,
updateUserId : userPage[0].userId,
email: userInfo.email,
updateUserId: userInfo.userId,
}
dispatch(userupdateAction.request(param));
@ -93,6 +93,7 @@ const AccountMypageContainer = () => {
handler={handler}
formModal={formModal}
handlerUpdate={handlerUpdate}
handlerInput={handlerInput}
/>
:
<></>
@ -100,7 +101,6 @@ const AccountMypageContainer = () => {
{activeTab == 2 ?
<AccountMypagePwForm
user={user}
handlerInput={handlerInput}
/>
:
<></>

Loading…
Cancel
Save