-
Notifications
You must be signed in to change notification settings - Fork 2
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 #25 from team-nabi/NABI-85
🎉 프로필 영역 컴포넌트 구현
- Loading branch information
Showing
8 changed files
with
76 additions
and
5 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
src/app/(root)/(routes)/items/[itemId]/components/ProfileSection/ProfileSection.stories.tsx
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,19 @@ | ||
import type { Meta, StoryObj } from '@storybook/react' | ||
import ProfileSection from './ProfileSection' | ||
|
||
const meta = { | ||
title: 'ItemPage/ProfileSection', | ||
component: ProfileSection, | ||
tags: ['autodocs'], | ||
argTypes: {}, | ||
} satisfies Meta<typeof ProfileSection> | ||
|
||
export default meta | ||
type Story = StoryObj<typeof meta> | ||
|
||
export const Profile: Story = { | ||
args: { profileImg: null, userName: '푸바오바오' }, | ||
render: () => { | ||
return <ProfileSection profileImg={null} userName="푸바오바오" /> | ||
}, | ||
} |
20 changes: 20 additions & 0 deletions
20
src/app/(root)/(routes)/items/[itemId]/components/ProfileSection/ProfileSection.tsx
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,20 @@ | ||
import { Avatar, AvatarImage } from '@/components/ui/Avatar' | ||
import { TYPHOGRAPHY } from '@/styles/sizes' | ||
|
||
type ProfileSectionProps = { | ||
profileImg: string | null | ||
userName: string | ||
} | ||
|
||
const ProfileSection = ({ profileImg, userName }: ProfileSectionProps) => { | ||
return ( | ||
<section className="flex w-full py-2 border-b-[1px] items-center"> | ||
<Avatar size="md"> | ||
<AvatarImage imgUrl={profileImg} /> | ||
</Avatar> | ||
<div className={`ml-9 ${TYPHOGRAPHY.profile}`}>{userName}</div> | ||
</section> | ||
) | ||
} | ||
|
||
export default ProfileSection |
3 changes: 3 additions & 0 deletions
3
src/app/(root)/(routes)/items/[itemId]/components/ProfileSection/index.tsx
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,3 @@ | ||
import ProfileSection from './ProfileSection' | ||
|
||
export default ProfileSection |
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,19 @@ | ||
import ProfileSection from './components/ProfileSection' | ||
|
||
type ItemPageProps = { | ||
params: { | ||
itemId: string | ||
} | ||
} | ||
|
||
const ItemPage = ({ params }: ItemPageProps) => { | ||
return ( | ||
<main className="flex-col min-h-screen bg-background-color"> | ||
<div>이미지 슬라이더 영역</div> | ||
<ProfileSection profileImg={null} userName="임시이름" /> | ||
<div>아이템 상세정보 영역</div> | ||
</main> | ||
) | ||
} | ||
|
||
export default ItemPage |
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,4 @@ | ||
const DEFAULT_PROFILE_IMG = 'https://github.com/shadcn.png' | ||
const DEFAULT_ITEM_IMG = ''; | ||
|
||
export {DEFAULT_PROFILE_IMG, DEFAULT_ITEM_IMG} |
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