-
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: member profile 컴포넌트 추출 및 데이터 연동 #85
- Loading branch information
Showing
5 changed files
with
55 additions
and
17 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,16 @@ | ||
import { getMemberInfo } from '@/entities/member/api' | ||
import { Member } from '@/entities/member/type' | ||
|
||
interface MemberInfoSenderProps { | ||
nickname: string | ||
children: (memberPosts: Member) => React.ReactElement | ||
} | ||
|
||
export async function MemberInfoSender({ | ||
nickname, | ||
children, | ||
}: MemberInfoSenderProps) { | ||
const data = await getMemberInfo(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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export { MemberProfileImage } from './ui/MemberProfileImage' | ||
export { MemberProfile } from './ui/MemberProfile' |
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,25 @@ | ||
import { MemberProfileImage } from '@/widget/member-profile' | ||
import { Member } from '@/entities/member' | ||
import { Title } from '@/shared/ui/text' | ||
|
||
interface MemberProfileProps { | ||
member: Member | ||
} | ||
|
||
export const MemberProfile = ({ member }: MemberProfileProps) => { | ||
const { nickname, profileImage, introduction } = member | ||
return ( | ||
<div className="flex items-center gap-2lg py-2lg"> | ||
<MemberProfileImage | ||
isLink={false} | ||
nickname={nickname} | ||
profileImage={profileImage} | ||
size="lg" | ||
/> | ||
<div className="space-y-1sm"> | ||
<Title mb={false}> {nickname}</Title> | ||
<p>{introduction || '얌수의 페이지 입니다.'}</p> | ||
</div> | ||
</div> | ||
) | ||
} |