-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #141 from FinalDoubleTen/dev
리프레쉬 + 스크롤
- Loading branch information
Showing
9 changed files
with
136 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { deleteMember } from '@api/member'; | ||
import { UserInfoState } from '@recoil/Auth.atom'; | ||
import { useNavigate } from 'react-router-dom'; | ||
import { useSetRecoilState } from 'recoil'; | ||
|
||
const DeleteMemberButton = () => { | ||
const setUserInfo = useSetRecoilState(UserInfoState); | ||
const navigate = useNavigate(); | ||
const onDeleteClick = async () => { | ||
if (confirm('정말 탈퇴 하시겠습니까?')) { | ||
try { | ||
const res = await deleteMember(); | ||
if (res.data.status === 200) { | ||
setUserInfo(null); | ||
navigate('/'); | ||
alert('회원 탈퇴되었습니다. 감사합니다.'); | ||
} | ||
} catch (err) { | ||
console.log(err); | ||
} | ||
} | ||
}; | ||
return ( | ||
<button onClick={onDeleteClick} className="body5 text-gray4"> | ||
회원 탈퇴 | ||
</button> | ||
); | ||
}; | ||
|
||
export default DeleteMemberButton; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,21 @@ | ||
import DeleteMemberButton from '@components/Mypage/DeleteMemberButton'; | ||
import { BackBox } from '@components/common'; | ||
import { Link } from 'react-router-dom'; | ||
|
||
const EditUserInfo = () => { | ||
return <>회원 정보 수정 페이지</>; | ||
return ( | ||
<> | ||
<BackBox showBack showSave saveHandler={() => {}}> | ||
회원정보 수정 | ||
</BackBox> | ||
<div className="flex flex-col items-center"> | ||
<Link to="password" className="body4 text-gray4"> | ||
비밀번호 변경 | ||
</Link> | ||
<DeleteMemberButton /> | ||
</div> | ||
</> | ||
); | ||
}; | ||
|
||
export default EditUserInfo; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters