Skip to content
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

Merged
merged 5 commits into from
Nov 1, 2023
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',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

๋”ฐ๋กœ ์ƒ์ˆ˜ํ™”ํ•ด์„œ ์‚ฌ์šฉํ•˜๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™์•„์š”.
const DEFAULT_PROFILE_IMAGE = '~~' ์ด๋Ÿฐ ์‹์œผ๋กœ?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avatar ์ปดํฌ๋„ŒํŠธ ์ž์ฒด์— default๋กœ ๋„ฃ์–ด๋†”๋„ ์ข‹์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์˜ค ๊ทธ๋ ‡๋„ค์š”!! avatar ์ปดํฌ๋„ŒํŠธ ์ž์ฒด์— ๋””ํดํŠธ๋กœ ํ•ด๋†“๊ฒ ์Šต๋‹ˆ๋‹ค! ํ˜น์‹œ ํ”„๋กœํ•„ ์ด๋ฏธ์ง€๋ฅผ ๋ฐ”๊ฟ€ ์ˆ˜๋„ ์žˆ์œผ๋‹ˆ๊นŒ ๋ชจ๋ฅด๋‹ˆ๊นŒ ์ƒ์ˆ˜ํ™”๋„ ํ•ด๋†“๊ฒ ์Šต๋‹ˆ๋‹ค

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>
Copy link
Contributor

Choose a reason for hiding this comment

The 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
19 changes: 19 additions & 0 deletions src/app/(root)/(routes)/items/[itemId]/page.tsx
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="์ž„์‹œ์ด๋ฆ„" />
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์ž„์‹œ profileImg ๋Š” ์ผ๋‹จ ๋นผ๋‘์‹ ๊ฑด๊ฐ€์š”?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์•— profileImg๊ฐ€ ๋น ์กŒ๊ตฐ์š”!! ๋ฐฑ์—”๋“œํŒ€๊ณผ ์–˜๊ธฐํ–ˆ์„ ๋•Œ ์ด๋ฏธ์ง€๊ฐ€ ์—†์„๋•Œ์—๋Š” ๋ฐฑ์—”๋“œ์—์„œ null๊ฐ’์œผ๋กœ ๋ฐ˜ํ™˜ํ•ด์ฃผ๋Š”๊ฑธ๋กœ ์–˜๊ธฐ๊ฐ€ ๋‚˜์™€์„œ null๋กœ ์˜ฌ๋•Œ๋„ ๋””ํดํŠธ ์ด๋ฏธ์ง€๊ฐ€ ๋ณด์ด๊ฒŒ ํ•ด๋†จ์Šต๋‹ˆ๋‹ค!

<div>์•„์ดํ…œ ์ƒ์„ธ์ •๋ณด ์˜์—ญ</div>
</main>
)
}

export default ItemPage
1 change: 1 addition & 0 deletions src/styles/sizes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const TYPHOGRAPHY = {
description: 'text-[12px]',
date: 'text-[10px] text-[#BFBFBF]',
icon: 'text-[10px]',
profile: 'text-color text-[12px] font-bold'
}
const HEIGHT = {
'card-lg': '161px',
Expand Down