-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat: 마이페이지 마크업 #14
Feat: 마이페이지 마크업 #14
Changes from 5 commits
2e03e3d
65d7ba9
47c63bf
1439b84
107f2e8
6174250
704ab1e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { Chip } from '@/components/Chip'; | ||
import { UserDataType } from '@/types'; | ||
import Image from 'next/image'; | ||
import { GET } from '@/network'; | ||
|
||
const UserDataCard = async () => { | ||
//TODO: 추후 로그인 로직 완성 후 주석 교체 | ||
const userData: UserDataType = await getUserData(); | ||
// const userData = cookies().get('userData'); | ||
|
||
Comment on lines
+7
to
+10
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. UserDataCard에서 유저의 정보(이름, 이메일, 태그 유형, 프로필사진)를 받아오기 위해
에서 2번을 선택했는데, next의 SSR특성상 localStorage에는 접근할 수 없어서 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 한번에 코멘트 남길게요! |
||
return ( | ||
<div className='flex flex-col w-full h-full gap-3'> | ||
<Image src={userData.profile} alt='profile' width={80} height={80} className='rounded-full' /> | ||
<div className='flex flex-col'> | ||
<span className='text-h2'>{userData.name}</span> | ||
<span className='text-body3'>{userData.email}</span> | ||
</div> | ||
<div className='flex flex-row gap-2'> | ||
{userData.typeList.map(type => ( | ||
<Chip key={type} text={type} /> | ||
))} | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default UserDataCard; | ||
|
||
// TODO: 추후 로그인 로직 완성 후 아래 제거 | ||
const getUserData = async () => { | ||
const response = await GET('/userData'); | ||
return response.data; | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,52 @@ | ||
const MyPage = () => { | ||
import type { UserDataType } from '@/types'; | ||
import Link from 'next/link'; | ||
import { GET } from '@/network'; | ||
|
||
interface MyPageProps { | ||
userData: UserDataType; | ||
} | ||
|
||
const MyPage = async () => { | ||
//TODO: 추후 로그인 로직 완성 후 주석 교체 | ||
const userData: UserDataType = await getUserData(); | ||
// const userData = cookies().get('userData'); | ||
|
||
return ( | ||
<> | ||
<>Test123</> | ||
</> | ||
<div className='flex flex-col gap-12 w-articleCard'> | ||
<div className='relative w-full aspect-[792/216] bg-blue'> | ||
<div className='absolute bottom-0 w-full h-2/5 bg-gradient-to-t from-white' /> | ||
<div className='absolute ml-4 -bottom-6 text-h1'>{userData?.name}</div> | ||
</div> | ||
<div className='flex flex-col w-full gap-8 pl-4 text-btn1'> | ||
<Link | ||
className='w-fit' | ||
href='/mypage/subscribe' // Link to Subscribe Management Page | ||
> | ||
뉴스레터 구독 관리 | ||
</Link> | ||
<Link | ||
href='/logout' // Link to Logout | ||
className='flex flex-col gap-1 w-fit' | ||
> | ||
로그아웃 | ||
<span className='text-caption'>다시 로그인 할 때까지 계정이 비활성화됩니다.</span> | ||
</Link> | ||
<Link | ||
href='/withdrawl' // Link to Withdrawal | ||
className='flex flex-col gap-1 w-fit text-darkgrey' | ||
> | ||
회원 탈퇴 | ||
<span className='text-caption'>개인 정보 및 설정이 모두 영구적으로 삭제됩니다</span> | ||
</Link> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default MyPage; | ||
|
||
// TODO: 추후 로그인 로직 완성 후 아래 제거 | ||
const getUserData = async () => { | ||
const response = await GET('/userData'); | ||
return response.data; | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import DomainListItem from '@/components/Domain/DomainListItem'; | ||
import AlternateListTap from '@/components/ListTap/AlternateListTap'; | ||
import ListItem from '@/components/ListTap/ListItem'; | ||
import SubscribeButton from '@/components/SubscribeButton'; | ||
import { GET } from '@/network'; | ||
|
||
interface SubscribeDataType { | ||
id: string; | ||
name: string; | ||
type: string; | ||
} | ||
|
||
const SubscribePage = async () => { | ||
const subscribeList: SubscribeDataType[] = await getSubscribeList(); | ||
|
||
return ( | ||
<div className='flex flex-col gap-6 w-articleCard pt-[7.625rem]'> | ||
<div className='flex flex-col gap-2'> | ||
<span className='text-caption text-darkgrey'>{`마이페이지 >`}</span> | ||
<span className='text-h2'>뉴스레터 구독 관리</span> | ||
<span className='text-body3'>InspoMailClub에서 더 이상 읽고 싶지 않은 뉴스레터를 선택하세요</span> | ||
</div> | ||
<AlternateListTap tapName='발신인' tapCount={subscribeList.length} /> | ||
<div className='flex flex-col max-w-max_domainCard'> | ||
{subscribeList.map(subscribe => ( | ||
<DomainListItem domainData={subscribe} isSubscribed={true} /> | ||
))} | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default SubscribePage; | ||
|
||
const getSubscribeList = async () => { | ||
const response = await GET('/subscribeList'); | ||
return response.data; | ||
}; |
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 부분은 중복되는 UI 로직이 있어서 DomainListItem으로 뺐습니다
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
확인해보고 싶어서 서버 켜봤는데 오류뜨는지라... ㅜ 확인이 쉽지않네요 ㅎㅎ..
나중에 다시 확인해보겠습니당