-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: mainListTap 하단 border set Width as screen * feat: header height값 수정 * feat: Digest탭의 빈 페이지 구현 * feat: 탐색탭 구독자 삭제, 설명 height 고정 QA 반영 * feat: 로그아웃, 회원탈퇴 기능 구현 * WIP: [선행작업대기중] domain 구독 버튼 클릭시 구독 페이지 이동
- Loading branch information
Showing
8 changed files
with
84 additions
and
32 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
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,12 +1,30 @@ | ||
import type { UserDataType, UserDataTypes } from '@/types'; | ||
'use client'; | ||
|
||
import Link from 'next/link'; | ||
import { GET } from '@/network'; | ||
import { useProfileQuery, usewithdrawalMutation } from '@/api/hooks/useFetchProfileQuery'; | ||
|
||
const MyPage = () => { | ||
const { data: userData } = useProfileQuery(); | ||
const withdrawalMutation = usewithdrawalMutation(); | ||
|
||
const handleWithdrawal = () => { | ||
console.log('withdrawal'); | ||
withdrawalMutation.mutate(null, { | ||
onSuccess: () => { | ||
alert('회원 탈퇴가 완료되었습니다.'); | ||
window.location.href = '/'; | ||
}, | ||
onError: () => { | ||
alert('회원 탈퇴에 실패했습니다.\n관리자에게 문의하세요.'); | ||
window.open('mailto:[email protected]', '_blank'); | ||
}, | ||
}); | ||
}; | ||
|
||
const MyPage = async () => { | ||
//TODO: 추후 로그인 로직 완성 후 주석 교체 | ||
const userData: UserDataTypes = await getUserData(); | ||
console.log(userData); | ||
// const userData = cookies().get('userData'); | ||
const handleLogout = () => { | ||
document.cookie = 'connect.sid=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;'; | ||
window.location.href = '/'; | ||
}; | ||
|
||
return ( | ||
<div className='flex flex-col gap-8 w-articleCard'> | ||
|
@@ -23,27 +41,21 @@ const MyPage = async () => { | |
> | ||
뉴스레터 구독 관리 | ||
</Link> | ||
<Link | ||
href='/logout' // Link to Logout | ||
className='flex flex-col gap-2 py-4 font-bold w-fit' | ||
> | ||
<div role='button' onClick={handleLogout} className='flex flex-col gap-2 py-4 font-bold w-fit'> | ||
로그아웃 | ||
<span className='font-normal text-body2 text-darkgrey'>다시 로그인 할 때까지 계정이 비활성화됩니다.</span> | ||
</Link> | ||
<Link href='/mypage' className='flex flex-col gap-2 py-4 font-bold w-fit text-darkgrey'> | ||
</div> | ||
<div | ||
role='button' | ||
onClick={handleWithdrawal} | ||
className='flex flex-col gap-2 py-4 font-bold w-fit text-darkgrey' | ||
> | ||
회원 탈퇴 | ||
<span className='font-normal text-body2'>개인 정보 및 설정이 모두 영구적으로 삭제됩니다</span> | ||
</Link> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default MyPage; | ||
|
||
// TODO: 추후 로그인 로직 완성 후 아래 제거 | ||
const getUserData = async () => { | ||
const response = await GET('/users'); | ||
console.log(response); | ||
return response.data; | ||
}; |
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 |
---|---|---|
|
@@ -186,6 +186,9 @@ export const handlers = [ | |
updated_at: new Date('2024-07-13'), | ||
}); | ||
}), | ||
http.delete('/users', () => { | ||
return HttpResponse.json({ status: 204 }); | ||
}), | ||
|
||
http.get('/articleList', req => { | ||
const { currentTab } = req.params; | ||
|
@@ -397,6 +400,15 @@ export const handlers = [ | |
contentLink: 'https://surfside.stibee.com/', | ||
thumbnailImage: 'https://picsum.photos/200', | ||
}, | ||
{ | ||
name: '디자인 나침반 뉴스레터', | ||
companyName: '디자인 나침반', | ||
isAutomated: false, | ||
content: ' 매주 화요일 아침, 16년 차 디자이너가큐레이션한 디자인 트렌드를 모아보세요.', | ||
subscriptionLink: 'https://designcompass.org/', | ||
contentLink: 'https://designcompass.org/', | ||
thumbnailImage: 'https://picsum.photos/200', | ||
}, | ||
], | ||
startup: [ | ||
{ | ||
|
@@ -421,18 +433,27 @@ export const handlers = [ | |
isPublished: false, | ||
address: '[email protected]', | ||
thumbnailImage: 'https://picsum.photos/48', | ||
isAutomated: false, | ||
subscriptionLink: 'https://maily.so/josh', | ||
companyName: 'string', | ||
}, | ||
{ | ||
name: 'string1', | ||
isPublished: false, | ||
address: '[email protected]', | ||
thumbnailImage: 'https://picsum.photos/48', | ||
isAutomated: false, | ||
subscriptionLink: 'https://maily.so/josh', | ||
companyName: 'string', | ||
}, | ||
{ | ||
name: 'string2', | ||
isPublished: false, | ||
address: '[email protected]', | ||
thumbnailImage: 'https://picsum.photos/48', | ||
isAutomated: true, | ||
subscriptionLink: 'https://maily.so/josh', | ||
companyName: 'string', | ||
}, | ||
], | ||
}); | ||
|