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

Fix/168/stories docs #175

Merged
merged 8 commits into from
Nov 22, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import CrewGatheringList from './crew-gathering-list';
const mockGatheringData = [
{
id: 1,
title: '๊ฐ€๋‚˜๋‹ค๋ผ๋งˆ๋ฐ”์‚ฌ ์š”๊ฐ€ ๋ชจ์ž„',
title: '์š”๊ฐ€ ๋ชจ์ž„',
dateTime: '2024-12-15T07:30',
location: '์„œ์šธ, ํ•œ๊ฐ•๊ณต์›',
currentCount: 8,
Expand All @@ -18,7 +18,7 @@ const mockGatheringData = [
{
id: 2,
title: '๋“ฑ์‚ฐ ๋ชจ์ž„',
dateTime: '2024-11-12T09:00',
dateTime: '2024-12-12T09:00',
location: '์„œ์šธ ๊ฐ•๋‚จ๊ตฌ ๊ฐœํฌ๋™ ๋Œ€๋ชจ์‚ฐ',
currentCount: 5,
totalCount: 10,
Expand All @@ -29,7 +29,7 @@ const mockGatheringData = [
{
id: 3,
title: '๋Ÿฌ๋‹ ๋ชจ์ž„',
dateTime: '2024-11-15T09:00',
dateTime: '2024-12-15T09:00',
location: '์„œ์šธ ์˜๋“ฑํฌ๊ตฌ ์—ฌ์˜๋™๋กœ 330',
currentCount: 10,
totalCount: 20,
Expand All @@ -40,7 +40,7 @@ const mockGatheringData = [
{
id: 4,
title: '๋Ÿฌ๋‹ ๋ชจ์ž„',
dateTime: '2024-11-15T09:00',
dateTime: '2024-12-15T09:00',
location: '์„œ์šธ ์˜๋“ฑํฌ๊ตฌ ์—ฌ์˜๋™๋กœ 330',
currentCount: 10,
totalCount: 20,
Expand All @@ -56,13 +56,17 @@ const meta: Meta<typeof CrewGatheringList> = {
title: 'crew/crew-gathering-list',
component: CrewGatheringList,
parameters: {
layout: 'fulled', // layout ๋ณ€๊ฒฝ
docs: {
subtitle: 'ํฌ๋ฃจ ๋””ํ…Œ์ผ ํŽ˜์ด์ง€ ์—์„œ ๋ณผ ์ˆ˜ ์žˆ๋Š” ์•ฝ์† ์นด๋“œ ๋ฆฌ์ŠคํŠธ์ž…๋‹ˆ๋‹ค.',
description: {
component: ' ๋ฐ์Šคํฌํƒ‘์—์„œ๋Š” ์บ๋Ÿฌ์…€, ์ดํ•˜์˜ ์‚ฌ์ด์ฆˆ์—์„œ๋Š” ๋“œ๋ž˜๊ทธ๋กœ ์ด๋™ ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค.',
},
},
},
tags: ['autodocs'],
decorators: [
(Story) => (
<QueryClientProvider client={queryClient}>
{/* ๋ถ€๋ชจ ์ปจํ…Œ์ด๋„ˆ ์ถ”๊ฐ€ */}
<div className="flex w-full justify-center bg-gray-100">
<div className="relative -mx-6 w-[calc(100%+3rem)]">
<Story />
Expand All @@ -76,10 +80,9 @@ const meta: Meta<typeof CrewGatheringList> = {
export default meta;
type Story = StoryObj<typeof meta>;

// ์Šคํ† ๋ฆฌ๋ถ์—์„œ gatheringData prop์„ ์ „๋‹ฌ
export const Default: Story = {
args: {
gatheringData: mockGatheringData,
crewId: 1, // crewId๋ฅผ ๊ธฐ๋ณธ๊ฐ’์œผ๋กœ ์„ค์ •
crewId: 1,
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ import React, { useState } from 'react';
import type { Meta, StoryObj } from '@storybook/react';
import ClientProvider from '@/src/components/client-provider';
import { CrewReview } from '@/src/types/review';
import { CrewReviewData } from '@/src/mock/review-data';
import CrewReviewList from './crew-review-list';

const meta: Meta<typeof CrewReviewList> = {
title: 'crew/crew-review-list',
component: CrewReviewList,
parameters: {
layout: 'fulled',
docs: {
subtitle: 'ํฌ๋ฃจ์˜ ์ „์ฒด ๋ฆฌ๋ทฐ๋ฅผ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋Š” ๋ฆฌ์ŠคํŠธ ์ž…๋‹ˆ๋‹ค.',
},
},
tags: ['autodocs'],
decorators: [
Expand All @@ -24,6 +25,95 @@ const meta: Meta<typeof CrewReviewList> = {
export default meta;
type Story = StoryObj<typeof CrewReviewList>;

const CrewReviewData: { data: CrewReview[] } = {
data: [
{
crewId: 1,
id: 1,
rate: 5,
comment: '์ •๋ง ์ข‹์€ ๋ชจ์ž„์ด์—ˆ์–ด์š”! ๋งŽ์€ ๊ฑธ ๋ฐฐ์› ์Šต๋‹ˆ๋‹ค.',
createdAt: '2024-10-30T14:00:00+09:00',
reviewer: {
id: 1,
nickname: '๊น€์ฒ ์ˆ˜',
profileImageUrl: 'https://i.pinimg.com/736x/25/64/5c/25645c1cbb29c5b8e8ebe995404b5ab6.jpg',
},
},
{
crewId: 1,
id: 2,
rate: 3,
comment: '๊ดœ์ฐฎ์•˜์ง€๋งŒ, ๋‹ค์Œ์—๋Š” ์กฐ๊ธˆ ๋” ๋‚˜์•„์ง€๋ฉด ์ข‹๊ฒ ์–ด์š”.',
createdAt: '2024-10-31T09:30:00+09:00',
reviewer: {
id: 2,
nickname: '๋ฐ•์˜ํฌ',
profileImageUrl: 'https://i.pinimg.com/736x/ba/25/6f/ba256faae4c3608685067b2641507392.jpg',
},
},
{
crewId: 1,
id: 3,
rate: 1,
comment: '๊ธฐ๋Œ€์— ๋ฏธ์น˜์ง€ ๋ชปํ–ˆ์Šต๋‹ˆ๋‹ค. ๊ฐœ์„ ์ด ํ•„์š”ํ•ด์š”.',
createdAt: '2024-11-01T11:15:00+09:00',
reviewer: {
id: 3,
nickname: '์ด์˜์ˆ˜',
profileImageUrl: '',
},
},
{
crewId: 1,
id: 4,
rate: 4,
comment: '์ „์ฒด์ ์œผ๋กœ ๋งŒ์กฑ์Šค๋Ÿฌ์› ์Šต๋‹ˆ๋‹ค. ๋‹ค์Œ์—๋„ ์ฐธ์—ฌํ•˜๊ณ  ์‹ถ์–ด์š”!',
createdAt: '2024-11-03T16:45:00+09:00',
reviewer: {
id: 4,
nickname: '์ตœ์ง€ํ›ˆ',
profileImageUrl: '',
},
},
{
crewId: 1,
id: 5,
rate: 2,
comment: '์กฐ๊ธˆ ์•„์‰ฌ์› ์ง€๋งŒ ์ƒˆ๋กœ์šด ๊ฒฝํ—˜์ด์—ˆ์Šต๋‹ˆ๋‹ค.',
createdAt: '2024-11-05T13:20:00+09:00',
reviewer: {
id: 5,
nickname: '๊ฐ•์ˆ˜์ง„',
profileImageUrl: 'https://i.pinimg.com/736x/38/d2/9a/38d29a018ac0472d9c2916e9d46ca282.jpg',
},
},
{
crewId: 1,
id: 6,
rate: 2,
comment: '์กฐ๊ธˆ ์•„์‰ฌ์› ์ง€๋งŒ ์ƒˆ๋กœ์šด ๊ฒฝํ—˜์ด์—ˆ์Šต๋‹ˆ๋‹ค.',
createdAt: '2024-11-05T13:20:00+09:00',
reviewer: {
id: 5,
nickname: '๊ฐ•์ˆ˜์ง„',
profileImageUrl: '',
},
},
{
crewId: 1,
id: 7,
rate: 2,
comment: '์•„์‰ฌ์›Œ์š”',
createdAt: '2024-10-30T14:00:00+09:00',
reviewer: {
id: 1,
nickname: '๊น€์ฒ ์ˆ˜',
profileImageUrl: '',
},
},
],
};

function RenderReviewPagination() {
const [currentPage, setCurrentPage] = useState(1);
const itemsPerPage = 6;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,8 @@ export default function DetailCrewPresenter({
</div>
) : (
<div className="flex h-full flex-col items-center justify-center text-center text-gray-500">
<p className="text-base font-medium">ํฌ๋ฃจ์žฅ ์™ธ์— ์•„์ง ํฌ๋ฃจ์›์ด ์—†์Šต๋‹ˆ๋‹ค.</p>
<p className="text-sm font-medium text-blue-400">ํฌ๋ฃจ์— ์ฐธ์—ฌํ•ด๋ณด์„ธ์š”!๐Ÿ™Œ</p>
<p className="text-base font-medium">ํฌ๋ฃจ์žฅ ์™ธ์— ์•„์ง ํฌ๋ฃจ์›์ด ์—†์Šต๋‹ˆ๋‹ค</p>
<p className="text-sm font-medium text-blue-400">ํฌ๋ฃจ์— ์ฐธ์—ฌํ•ด๋ณด์„ธ์š”๐Ÿ™Œ</p>
</div>
)}
</div>
Expand Down
37 changes: 21 additions & 16 deletions src/app/(crew)/crew/detail/[id]/_components/detail-crew.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@ const meta: Meta<typeof DetailCrewPresenter> = {
title: 'crew/crew-detail',
component: DetailCrewPresenter,
parameters: {
layout: 'fullscreen',
docs: {
subtitle: 'ํฌ๋ฃจ ๋””ํ…Œ์ผ ํŽ˜์ด์ง€์—์„œ ํฌ๋ฃจ ์ •๋ณด๋ฅผ ๋‚˜ํƒ€๋ƒ…๋‹ˆ๋‹ค.',
description: {
component:
'ํฌ๋ฃจ์žฅ์ธ ๊ฒฝ์šฐ, ํฌ๋ฃจ์›์ธ ๊ฒฝ์šฐ, ๋‘˜๋‹ค ์•„๋‹Œ ๊ฒฝ์šฐ ์„ธ๊ฐ€์ง€์— ๋”ฐ๋ผ์„œ ์ผ€๋ฐฅ์ด ๋‹ค๋ฅด๊ฒŒ ๋ณด์ž…๋‹ˆ๋‹ค.',
},
},
},
tags: ['autodocs'],
argTypes: {
Expand All @@ -24,22 +30,21 @@ export const Default: Story = {
args: {
data: {
id: 1,
title: '๊ฐ™์ด ๋ฌผ์žฅ๊ตฌ์น ์‚ฌ๋žŒ',
title: '์Šคํ‚ค ์ดˆ๋ณด๋งŒ ์˜ค์„ธ์š”',
mainCategory: '๊ธฐํƒ€',
subCategory: '์Šคํ‚ค',
mainLocation: '๋Œ€์ „๊ด‘์—ญ์‹œ',
introduce:
'ํฌ๋ฃจ ์†Œ๊ฐœ ํฌ๋ฃจ ์†Œ๊ฐœ ํฌ๋ฃจ ์†Œ๊ฐœ ํฌ๋ฃจ ์†Œ๊ฐœ ํฌ๋ฃจ ์†Œ๊ฐœ ํฌ๋ฃจ ์†Œ๊ฐœ ํฌ๋ฃจ ์†Œ๊ฐœ ํฌ๋ฃจ ์†Œ๊ฐœ ํฌ๋ฃจ ์†Œ๊ฐœ ํฌ๋ฃจ ์†Œ๊ฐœ ํฌ๋ฃจ ์†Œ๊ฐœ ํฌ๋ฃจ ์†Œ๊ฐœ ํฌ๋ฃจ ์†Œ๊ฐœ ํฌ๋ฃจ ์†Œ๊ฐœ ํฌ๋ฃจ ์†Œ๊ฐœ ํฌ๋ฃจ ์†Œ๊ฐœ ํฌ๋ฃจ ์†Œ๊ฐœ ํฌ๋ฃจ ์†Œ๊ฐœ ํฌ๋ฃจ ์†Œ๊ฐœ ํฌ๋ฃจ ์†Œ๊ฐœ ํฌ๋ฃจ ์†Œ๊ฐœ ํฌ๋ฃจ ์†Œ๊ฐœ ํฌ๋ฃจ ์†Œ๊ฐœ ํฌ๋ฃจ ์†Œ๊ฐœ ํฌ๋ฃจ ์†Œ๊ฐœ ํฌ๋ฃจ ์†Œ๊ฐœ ํฌ๋ฃจ ์†Œ๊ฐœ ํฌ๋ฃจ ์†Œ๊ฐœ ํฌ๋ฃจ ์†Œ๊ฐœ',
introduce: '์Šคํ‚ค ์ดˆ๋ณด๋ฅผ ์œ„ํ•œ ๋ชจ์ž„์ž…๋‹ˆ๋‹ค.',
subLocation: '์œ ์„ฑ๊ตฌ',
participantCount: 8,
totalCount: 10,
imageUrl:
'https://crewcrew.s3.ap-northeast-2.amazonaws.com/crew/4d0c5851-e6e2-4919-897a-b8d4e88a4f72',
'https://images.unsplash.com/photo-1504827274833-7db1774520e3?q=80&w=2670&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
totalGatheringCount: 5,
crewMembers: [
{
id: 1,
nickname: 'John',
nickname: '์Šคํ‚ค์กฐ์•„',
email: '[email protected]',
profileImageUrl:
'https://i.pinimg.com/564x/e2/25/bb/e225bb492dc7a20a549f3c0abec28eb8.jpg',
Expand Down Expand Up @@ -108,17 +113,17 @@ export const IsCaptain: Story = {
args: {
data: {
id: 1,
title: '๊ฐ™์ด ๋ฌผ์žฅ๊ตฌ์น ์‚ฌ๋žŒ',
title: '์Šคํ‚ค ์ดˆ๋ณด๋งŒ ์˜ค์„ธ์š”',
mainCategory: '๊ธฐํƒ€',
subCategory: '์Šคํ‚ค',
mainLocation: '๋Œ€์ „๊ด‘์—ญ์‹œ',
introduce: 'ํฌ๋ฃจ ์†Œ๊ฐœ',
introduce: '์Šคํ‚ค ์ดˆ๋ณด๋ฅผ ์œ„ํ•œ ๋ชจ์ž„์ž…๋‹ˆ๋‹ค.',
subLocation: '์œ ์„ฑ๊ตฌ',
participantCount: 1,
participantCount: 8,
totalCount: 10,
imageUrl:
'https://crewcrew.s3.ap-northeast-2.amazonaws.com/crew/4d0c5851-e6e2-4919-897a-b8d4e88a4f72',
totalGatheringCount: 1,
'https://images.unsplash.com/photo-1504827274833-7db1774520e3?q=80&w=2670&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
totalGatheringCount: 5,
crewMembers: [
{
id: 1,
Expand All @@ -139,17 +144,17 @@ export const IsMember: Story = {
args: {
data: {
id: 1,
title: '๊ฐ™์ด ๋ฌผ์žฅ๊ตฌ์น ์‚ฌ๋žŒ',
title: '์Šคํ‚ค ์ดˆ๋ณด๋งŒ ์˜ค์„ธ์š”',
mainCategory: '๊ธฐํƒ€',
subCategory: '์Šคํ‚ค',
mainLocation: '๋Œ€์ „๊ด‘์—ญ์‹œ',
introduce: '',
introduce: '์Šคํ‚ค ์ดˆ๋ณด๋ฅผ ์œ„ํ•œ ๋ชจ์ž„์ž…๋‹ˆ๋‹ค.',
subLocation: '์œ ์„ฑ๊ตฌ',
participantCount: 2,
participantCount: 8,
totalCount: 10,
imageUrl:
'https://crewcrew.s3.ap-northeast-2.amazonaws.com/crew/4d0c5851-e6e2-4919-897a-b8d4e88a4f72',
totalGatheringCount: 1,
'https://images.unsplash.com/photo-1504827274833-7db1774520e3?q=80&w=2670&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
totalGatheringCount: 5,
crewMembers: [
{
id: 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ export default function GatheringListSection({ id }: GatheringListSectionProps)
if (!gatheringList || gatheringList.length === 0)
return (
<div className="flex items-center justify-center">
<div className="flex h-[380px] flex-col items-center justify-center">
<p className="text-xl font-semibold">์•„์ง ๋“ฑ๋ก๋œ ์•ฝ์†์ด ์—†์Šต๋‹ˆ๋‹ค!</p>
<p className="mt-2 text-base font-medium text-blue-400">์ƒˆ๋กœ์šด ์•ฝ์†์„ ๋งŒ๋“ค์–ด๋ณด์„ธ์š”! ๐Ÿ™Œ</p>
<div className="items-center justify-center py-16 text-center">
<p className="text-xl font-bold text-blue-500">์•„์ง ๋“ฑ๋ก๋œ ์•ฝ์†์ด ์—†์–ด์š”</p>
<p className="mt-4 text-gray-600">์ƒˆ๋กœ์šด ์•ฝ์†์„ ๋งŒ๋“ค์–ด๋ณด์„ธ์š”๐Ÿ™Œ</p>
</div>
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ import RatingDisplay, { ReviewRateInfo } from './rating-display';
export default {
title: 'crew/crew-rating-display',
component: RatingDisplay,
parameters: {
docs: {
subtitle: 'ํฌ๋ฃจ ๋””ํ…Œ์ผ ํŽ˜์ด์ง€์—์„œ ํฌ๋ฃจ์˜ ๋ฆฌ๋ทฐ ์ •๋ณด๋ฅผ ์•Œ ์ˆ˜ ์žˆ๋Š” ์ปดํฌ๋„ŒํŠธ ์ž…๋‹ˆ๋‹ค.',
},
},
tags: ['autodocs'],
argTypes: {
totalRate: { control: 'number', description: '์ด ํ‰๊ฐ€ ๊ฐœ์ˆ˜' },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ export default function CrewReviewSection({ crewId }: CrewReviewSectionProps) {
if (data?.reviewList.content.length === 0) {
return (
<section className="py-16 text-center">
<h3 className="text-xl font-bold text-blue-500">๋ฆฌ๋ทฐ๊ฐ€ ์•„์ง ์—†์Šต๋‹ˆ๋‹ค</h3>
<p className="mt-4 text-gray-600">ํฌ๋ฃจ์˜ ์•ฝ์†์— ์ฐธ์—ฌํ•˜๊ณ  ๋ฆฌ๋ทฐ๋ฅผ ๋‚จ๊ฒจ๋ณด์„ธ์š”!</p>
<h3 className="text-xl font-bold text-blue-500">๋ฆฌ๋ทฐ๊ฐ€ ์•„์ง ์—†์–ด์š”</h3>
<p className="mt-4 text-gray-600">ํฌ๋ฃจ์˜ ์•ฝ์†์— ์ฐธ์—ฌํ•˜๊ณ  ๋ฆฌ๋ทฐ๋ฅผ ๋‚จ๊ฒจ๋ณด์„ธ์š”๐Ÿ™Œ</p>
</section>
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/(crew)/crew/detail/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default async function CrewDetailPage({ params }: CrewDetailPageProps) {
</section>

{/* Crew Review Section */}
<section className="mx-3 mt-10 w-full space-y-6 md:mx-7 lg:mx-11">
<section className="mx-3 my-7 md:mx-7 md:my-11 lg:mx-11 lg:my-16">
<article className="space-y-6">
<h2 className="text-2xl font-semibold">ํฌ๋ฃจ ๋ฆฌ๋ทฐ</h2>
<CrewReviewSection crewId={id} />
Expand Down
Loading
Loading