-
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.
- Loading branch information
Showing
10 changed files
with
113 additions
and
34 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
import { ReactNode } from 'react' | ||
import { MemberProfile } from '@/widget/member-profile' | ||
import { MemberProfileSender } from '@/entities/member/ui/MemberProfileSender' | ||
import { setMetadata } from '@/shared/lib' | ||
import { SessionSender } from '@/shared/ui/headless' | ||
import { ContentWrap, Inner } from '@/shared/ui/layout' | ||
import { Button } from '@/shared/ui/shadcn/button' | ||
|
||
export async function generateMetadata() { | ||
return setMetadata('MY_INFO') | ||
} | ||
|
||
function Page() { | ||
return ( | ||
<ContentWrap pt={false}> | ||
<Inner size="sm"> | ||
<SessionSender> | ||
{(memberSession) => | ||
memberSession && ( | ||
<> | ||
<MemberProfileSender nickname={memberSession.nickname}> | ||
{(memberInfo) => <MemberProfile member={memberInfo} />} | ||
</MemberProfileSender> | ||
<dl> | ||
<InfoListItem title="이메일"> | ||
{memberSession.email} <Button size="compact">변경</Button> | ||
</InfoListItem> | ||
<InfoListItem title="비밀번호"> | ||
1개월 전 변경됨 | ||
<Button size="compact">비밀번호 변경</Button> | ||
</InfoListItem> | ||
<InfoListItem title="가입일">2024. 01. 01</InfoListItem> | ||
<InfoListItem title="회원탈퇴"> | ||
<Button variant="destructive" size="compact"> | ||
회원탈퇴 | ||
</Button> | ||
<span className="text-1md text-gray-30"> | ||
탈퇴 시 작성하신 포스트 및 댓글이 모두 삭제되며 복구되지 | ||
않습니다. | ||
</span> | ||
</InfoListItem> | ||
</dl> | ||
</> | ||
) | ||
} | ||
</SessionSender> | ||
</Inner> | ||
</ContentWrap> | ||
) | ||
} | ||
|
||
const InfoListItem = ({ | ||
children, | ||
title, | ||
}: { | ||
children: ReactNode | ||
title: string | ||
}) => { | ||
return ( | ||
<div className="separator-line-80 grid grid-cols-[repeat(1,100px_1fr)] items-center py-2md"> | ||
<dt>{title}</dt> | ||
<dd className="flex items-center gap-x-2md">{children}</dd> | ||
</div> | ||
) | ||
} | ||
|
||
export default Page |
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 was deleted.
Oops, something went wrong.
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,16 @@ | ||
import { getMemberProfile } from '@/entities/member/api' | ||
import { Member } from '@/entities/member/type' | ||
|
||
interface MemberProfileSenderProps { | ||
nickname: string | ||
children: (memberPosts: Member) => React.ReactElement | ||
} | ||
|
||
export async function MemberProfileSender({ | ||
nickname, | ||
children, | ||
}: MemberProfileSenderProps) { | ||
const data = await getMemberProfile(nickname) | ||
|
||
return <>{children(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
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