-
Notifications
You must be signed in to change notification settings - Fork 2
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
๐ ํ๋กํ ์์ญ ์ปดํฌ๋ํธ ๊ตฌํ #25
Changes from 3 commits
71c3ddb
14f08e2
86be8c0
4cc6ba2
6333d57
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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: { userName: 'ํธ๋ฐ์ค๋ฐ์ค' }, | ||
render: () => { | ||
return <ProfileSection userName="ํธ๋ฐ์ค๋ฐ์ค" /> | ||
}, | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { Avatar, AvatarImage } from '@/components/ui/Avatar' | ||
import { TYPHOGRAPHY } from '@/styles/sizes' | ||
|
||
type ProfileSectionProps = { | ||
profileImg?: string | ||
userName: string | ||
} | ||
|
||
const ProfileSection = ({ | ||
profileImg = 'https://github.com/shadcn.png', | ||
userName, | ||
}: ProfileSectionProps) => { | ||
return ( | ||
<section className="flex w-full py-2 border-b-[1px] items-center"> | ||
<Avatar size="md"> | ||
<AvatarImage src={profileImg} /> | ||
</Avatar> | ||
<div className={`ml-9 ${TYPHOGRAPHY.profile}`}>{userName}</div> | ||
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. sizes๋ฅผ ์ ๊ฐ ์ฌ์ฉํ์๊ณ ์ ์ํ๊ธด ํ๋๋ฐ ๋ง์ ์ด๋ ๊ฒ ๋ณด๋, ๋ญ๊ฐ tailwind์ ๋๋์ ํด์น๋๊ฒ ๊ฐ์ ์ฐ๋ ค์ค๋ฝ๊ธฐ๋ ํ๋ค์. |
||
</section> | ||
) | ||
} | ||
|
||
export default ProfileSection |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import ProfileSection from './ProfileSection' | ||
|
||
export default ProfileSection |
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 userName="์์์ด๋ฆ" /> | ||
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. ์์ profileImg ๋ ์ผ๋จ ๋นผ๋์ ๊ฑด๊ฐ์? 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. ์ profileImg๊ฐ ๋น ์ก๊ตฐ์!! ๋ฐฑ์๋ํ๊ณผ ์๊ธฐํ์ ๋ ์ด๋ฏธ์ง๊ฐ ์์๋์๋ ๋ฐฑ์๋์์ null๊ฐ์ผ๋ก ๋ฐํํด์ฃผ๋๊ฑธ๋ก ์๊ธฐ๊ฐ ๋์์ null๋ก ์ฌ๋๋ ๋ํดํธ ์ด๋ฏธ์ง๊ฐ ๋ณด์ด๊ฒ ํด๋จ์ต๋๋ค! |
||
<div>์์ดํ ์์ธ์ ๋ณด ์์ญ</div> | ||
</main> | ||
) | ||
} | ||
|
||
export default ItemPage |
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.
๋ฐ๋ก ์์ํํด์ ์ฌ์ฉํ๋ฉด ์ข์ ๊ฒ ๊ฐ์์.
const DEFAULT_PROFILE_IMAGE = '~~'
์ด๋ฐ ์์ผ๋ก?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.
Avatar ์ปดํฌ๋ํธ ์์ฒด์ default๋ก ๋ฃ์ด๋๋ ์ข์ ๊ฒ ๊ฐ์ต๋๋ค.
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.
์ค ๊ทธ๋ ๋ค์!! avatar ์ปดํฌ๋ํธ ์์ฒด์ ๋ํดํธ๋ก ํด๋๊ฒ ์ต๋๋ค! ํน์ ํ๋กํ ์ด๋ฏธ์ง๋ฅผ ๋ฐ๊ฟ ์๋ ์์ผ๋๊น ๋ชจ๋ฅด๋๊น ์์ํ๋ ํด๋๊ฒ ์ต๋๋ค