Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
12 commits
Select commit Hold shift + click to select a range
4704d2f
๐Ÿ› fix: ๋ฐ์ดํ„ฐ ๋ณ€๊ฒฝ, ๋””์ž์ธ์— ๋”ฐ๋ฅธ ๋ณ€๊ฒฝ
HaeJungg Nov 18, 2024
779f682
๐Ÿ’„ design: ์บ๋Ÿฌ์…€ ๋””์ž์ธ์— ๋”ฐ๋ผ ์Šคํƒ€์ผ ๊ฐ๊ฐ ์ง€์ •
HaeJungg Nov 18, 2024
b5fd829
๐Ÿ› fix: ํŽ˜์ด์ง€ 0๋ถ€ํ„ฐ ์‹œ์ž‘ํ•˜๋„๋ก ์ˆ˜์ •
HaeJungg Nov 18, 2024
34860bd
๐Ÿ’„ design: ๋””์ž์ธ์— ๋”ฐ๋ผ ์ˆ˜์ •
HaeJungg Nov 18, 2024
a39c327
๐Ÿ’„ design: ์Šคํฌ๋กค ๊ฐ€๋Šฅํ•˜๊ฒŒ ๋ณด์ด๋„๋ก ui ์ถ”๊ฐ€
HaeJungg Nov 18, 2024
d351bbf
๐Ÿ› fix: ๋””์ž์ธ ๋ณ€๊ฒฝ์— ๋”ฐ๋ผ ๋‚ ์งœ ๋ณ€ํ™˜ ์ˆ˜์ •
HaeJungg Nov 18, 2024
176f5d1
๐Ÿ“ฆ chore: ์ฐธ๊ฐ€์ธ์› ์ด๋ฏธ์ง€ ์ถ”๊ฐ€
HaeJungg Nov 18, 2024
c9e7071
๐Ÿ› fix: ํŒŒ์ผ๋ช… ๋ณ€๊ฒฝ, ๋ธŒ๋ผ์šฐ์ € ์‚ฌ์ด์ฆˆ ์ค„์ผ๋–„ ๊ทธ๋ผ๋ฐ์ด์…˜ ์•ˆ๋ณด์ด๋Š” ๋ฌธ์ œ ์ˆ˜์ •
HaeJungg Nov 18, 2024
deedc4d
๐Ÿ› fix: ํŒŒ์ผ๋ช… ๋ณ€๊ฒฝ์— ๋”ฐ๋ผ import ์ˆ˜์ •
HaeJungg Nov 18, 2024
129a15b
๐Ÿ’„ design: ์•ฝ์† ์นด๋“œ ๋””์ž์ธ ๋ณ€๊ฒฝ
HaeJungg Nov 18, 2024
93b3bb5
๐Ÿ› fix: ๊ฐญ์ด ์ด์ƒํ•ด ๋ณด์ด๋Š” ๋ฌธ์ œ ์ˆ˜์ •
HaeJungg Nov 18, 2024
bf84f6c
Merge branch 'develop' into Feat/131/DesignGatheringsFix
HaeJungg Nov 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions public/assets/icons/ic-gathering-person.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/_queries/liked/liked-queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ import { getLikedList } from '@/src/_apis/liked/liked-apis';
export function useGetLikedListQuery(page: number) {
return useQuery({
queryKey: ['likedList', page],
queryFn: () => getLikedList(page),
queryFn: () => getLikedList(page - 1), // 1 -> 0 ๊ธฐ๋ฐ˜์œผ๋กœ ๋ณ€ํ™˜
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { addLike, removeLike } from '@/src/_apis/liked/liked-apis';
import { useGetGatheringListQuery } from '@/src/_queries/crew/gathering-list-queries';
import { ApiError } from '@/src/utils/api';
import ConfirmModal from '@/src/components/common/modal/confirm-modal';
import GatheringCardCarousel from '@/src/components/gathering-list/gathering-card-carousel';
import CrewGatheringList from '@/src/components/gathering-list/crew-gathering-list';

interface GatheringListSectionProps {
id: number;
Expand Down Expand Up @@ -50,7 +50,7 @@ export default function GatheringListSection({ id }: GatheringListSectionProps)

return (
<>
<GatheringCardCarousel
<CrewGatheringList
gatheringData={gatheringList}
crewId={id}
onLike={handleLike}
Expand Down
50 changes: 27 additions & 23 deletions src/app/(crew)/crew/detail/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,31 +13,35 @@ export default async function CrewDetailPage({ params }: CrewDetailPageProps) {

return (
<div className="mx-auto min-h-screen w-full max-w-full overflow-x-hidden">
<div className="mx-3 my-7 space-y-10 md:mx-7 md:my-11 lg:mx-11 lg:my-16">
<section className="w-full">
<article>
<DetailCrew id={id} />
</article>
</section>
<section className="w-full space-y-6">
<article className="space-y-6">
<div className="flex items-center justify-between">
<h2 className="text-2xl font-semibold">ํฌ๋ฃจ ์•ฝ์†</h2>
<CreateGathering crewId={Number(params.id)} />
</div>
<div className="flex w-full">
{/* Detail Section */}
<section className="mx-3 my-7 md:mx-7 md:my-11 lg:mx-11 lg:my-16">
<article>
<DetailCrew id={id} />
</article>
</section>

{/* Gathering Section */}
<section className="w-full space-y-6">
<article className="space-y-6">
<div className="flex items-center justify-between px-3 md:px-7 lg:px-11">
<h2 className="text-2xl font-semibold">ํฌ๋ฃจ ์•ฝ์†</h2>
<CreateGathering crewId={Number(params.id)} />
</div>
<div className="flex w-full overflow-hidden px-3 md:px-7 lg:px-0">
<div className="relative -mx-3 w-[calc(100%+1.5rem)] px-3 md:-mx-7 md:w-[calc(100%+3.5rem)] md:px-7 lg:-mx-6 lg:w-[calc(100%+3rem)] lg:px-0">
<GatheringListSection id={id} />
</div>
</article>
</section>
{/* // TODO: ๋ฆฌ๋ทฐ ์™„์„ฑ๋˜๋ฉด ์ˆ˜์ • */}
{/* <section className="w-full">
<article className="space-y-6">
<h2 className="text-2xl font-semibold">ํฌ๋ฃจ ๋ฆฌ๋ทฐ</h2>
<CrewReviewSection />
</article>
</section> */}
</div>
</div>
</article>
</section>

{/* Crew Review Section */}
{/* <section className="w-full mx-3 md:mx-7 lg:mx-11 space-y-6">
<article className="space-y-6">
<h2 className="text-2xl font-semibold">ํฌ๋ฃจ ๋ฆฌ๋ทฐ</h2>
<CrewReviewSection />
</article>
</section> */}
</div>
);
}
73 changes: 28 additions & 45 deletions src/components/common/gathering-card/presenter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@ import { cn } from '@/src/utils/cn';
import { formatDate } from '@/src/utils/format-date';
import Button from '@/src/components/common/input/button';
import LikeBtn from '@/src/components/common/input/button/like-btn';
import IcoPerson from '@/public/assets/icons/person.svg';
import IcoPerson from '@/public/assets/icons/ic-gathering-person.svg';
import IcoTimer from '@/public/assets/icons/timer.svg';

// TODO: ์Šค์ผ€๋ ˆํ†คUI ์ ์šฉ(์ฒ˜์Œ ๋กœ๋”ฉ์‹œ ์นด๋“œ๊ฐ€ ๋Š˜์–ด๋‚˜๋Š” ํ˜„์ƒ)

export interface GatheringCardPresenterProps {
id: number;
imageUrl: string;
Expand Down Expand Up @@ -45,24 +43,16 @@ export default function GatheringCardPresenter({
}: GatheringCardPresenterProps) {
const { date, time } = formatDate(dateTime);

const handleClick = (e: MouseEvent) => {
const handleLikeClick = (e: MouseEvent) => {
e.stopPropagation();
onLikeToggle();
};

return (
<div
role="button"
tabIndex={0}
onClick={isPast ? undefined : onClick}
onKeyDown={(e) => {
if (!isPast && (e.key === 'Enter' || e.key === ' ')) {
onClick();
}
}}
className={cn(
className,
'relative h-[310px] w-full overflow-hidden rounded-lg border-white bg-white shadow-sm',
'relative h-[344px] w-full overflow-hidden rounded-lg border-white bg-white shadow-sm',
isPast ? 'pointer-events-none cursor-default' : 'cursor-pointer',
)}
>
Expand All @@ -85,53 +75,46 @@ export default function GatheringCardPresenter({

<div className="flex min-h-[150px] flex-col justify-between p-4">
<div>
<div className="flex items-center space-x-2">
<p className="overflow-hidden text-ellipsis whitespace-nowrap text-base font-semibold text-blue-500">
{date}
</p>
<div className="h-[18px] w-[1px] bg-gray-300" />
<p className="overflow-hidden text-ellipsis whitespace-nowrap text-base font-semibold text-blue-500">
{time}
</p>
</div>
<h3 className="overflow-hidden text-ellipsis whitespace-nowrap text-xl font-semibold text-gray-800">
{title}
</h3>
<div className="mb-2 flex items-center space-x-1 text-base font-medium text-gray-700">
<span className="-translate-y-[2px] leading-none tracking-tighter">|</span>
<div className="text-xm mb-2 flex items-center space-x-1 font-normal text-gray-700">
<p className="overflow-hidden text-ellipsis whitespace-nowrap">{location}</p>
</div>
<div className="space-x-2">
<Badge
size="lg"
color="#111827"
radius="sm"
classNames={{
label: 'font-pretendard, gathering-badge',
}}
>
{date}
</Badge>
<Badge
size="lg"
color="#111827"
radius="sm"
classNames={{
label: 'font-pretendard, gathering-badge',
}}
>
{time}
</Badge>
</div>
<div className="flex flex-col space-y-2">
<div className="flex items-center space-x-1">
<Image src={IcoPerson} alt="person icon" width={16} height={16} />
<p className="text-sm font-normal text-gray-900">
์ฐธ์—ฌ์ธ์› <span className="text-blue-500">{currentCount}</span>/{totalCount}
</p>
</div>
<Button className="btn-filled w-full" onClick={onClick}>
์•ฝ์† ์ž์„ธํžˆ ๋ณด๊ธฐ
</Button>
</div>
<p className="flex items-center text-base font-medium text-gray-700">
<Image src={IcoPerson} alt="person icon" width={16} height={16} />
์ฐธ์—ฌ์ธ์› {currentCount}/{totalCount}
</p>
</div>

<div className="absolute bottom-4 right-4">
<LikeBtn id={id} isLiked={isLiked} onLikeToggle={onLikeToggle} size={40} />
<div className="absolute right-4 top-[172px]">
<LikeBtn id={id} isLiked={isLiked} onLikeToggle={onLikeToggle} size={32} />
</div>

{isPast && (
<div className="pointer-events-auto absolute inset-0 flex items-center justify-center rounded-md bg-black bg-opacity-70 text-white">
<div className="text-center">
<p className="mb-2 text-lg font-semibold">๋งˆ๊ฐ๋œ ๋ชจ์ž„์ž…๋‹ˆ๋‹ค</p>
<p className="mb-2 text-lg font-semibold">๋งˆ๊ฐ๋œ ์•ฝ์†์ž…๋‹ˆ๋‹ค</p>
<p className="mb-4 text-sm">๋‹ค์Œ ๊ธฐํšŒ์— ๋งŒ๋‚˜์š” ๐Ÿ™</p>
<Button type="button" className="btn-filled px-4" onClick={handleClick}>
๋ชจ์ž„ ๋ณด๋‚ด์ฃผ๊ธฐ
<Button type="button" className="btn-filled px-4" onClick={handleLikeClick}>
์•ฝ์† ๋ณด๋‚ด์ฃผ๊ธฐ
</Button>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Meta, StoryObj } from '@storybook/react';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import GatheringCardCarousel from './gathering-card-carousel';
import CrewGatheringList from './crew-gathering-list';

// ๋”๋ฏธ ๋ฐ์ดํ„ฐ ์ •์˜
const mockGatheringData = [
Expand Down Expand Up @@ -37,25 +37,41 @@ const mockGatheringData = [
'https://images.unsplash.com/photo-1516978101789-720eacb59e79?w=500&auto=format&fit=crop&q=60&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxzZWFyY2h8NjV8fGNhdHxlbnwwfHwwfHx8Mg%3D%3D',
liked: true,
},
{
id: 4,
title: '๋Ÿฌ๋‹ ๋ชจ์ž„',
dateTime: '2024-11-15T09:00',
location: '์„œ์šธ ์˜๋“ฑํฌ๊ตฌ ์—ฌ์˜๋™๋กœ 330',
currentCount: 10,
totalCount: 20,
imageUrl:
'https://images.unsplash.com/photo-1516978101789-720eacb59e79?w=500&auto=format&fit=crop&q=60&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxzZWFyY2h8NjV8fGNhdHxlbnwwfHwwfHx8Mg%3D%3D',
liked: true,
},
Comment on lines +40 to +50
Copy link

Choose a reason for hiding this comment

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

โš ๏ธ Potential issue

์ค‘๋ณต๋œ ๋ชจ์ž„ ๋ฐ์ดํ„ฐ๋ฅผ ์ˆ˜์ •ํ•ด์ฃผ์„ธ์š”.

์ƒˆ๋กœ ์ถ”๊ฐ€๋œ ๋ชจ์ž„ ๋ฐ์ดํ„ฐ(id: 4)๊ฐ€ ๊ธฐ์กด ๋ฐ์ดํ„ฐ(id: 3)์™€ title, dateTime, location ๋“ฑ์ด ๋™์ผํ•ฉ๋‹ˆ๋‹ค. ํ…Œ์ŠคํŠธ ๋ฐ์ดํ„ฐ์˜ ์ •ํ™•์„ฑ์„ ์œ„ํ•ด ๋‹ค์Œ๊ณผ ๊ฐ™์ด ์ˆ˜์ •์ด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค:

  {
    id: 4,
-   title: '๋Ÿฌ๋‹ ๋ชจ์ž„',
-   dateTime: '2024-11-15T09:00',
-   location: '์„œ์šธ ์˜๋“ฑํฌ๊ตฌ ์—ฌ์˜๋™๋กœ 330',
+   title: '์ถ•๊ตฌ ๋ชจ์ž„',
+   dateTime: '2024-12-20T14:00',
+   location: '์„œ์šธ ๋งˆํฌ๊ตฌ ์ƒ์•”๋™ ์›”๋“œ์ปต๊ณต์›',
    currentCount: 10,
    totalCount: 20,
    imageUrl:
      'https://images.unsplash.com/photo-1516978101789-720eacb59e79?w=500&auto=format&fit=crop&q=60&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxzZWFyY2h8NjV8fGNhdHxlbnwwfHwwfHx8Mg%3D%3D',
    liked: true,
  }
๐Ÿ“ Committable suggestion

โ€ผ๏ธ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{
id: 4,
title: '๋Ÿฌ๋‹ ๋ชจ์ž„',
dateTime: '2024-11-15T09:00',
location: '์„œ์šธ ์˜๋“ฑํฌ๊ตฌ ์—ฌ์˜๋™๋กœ 330',
currentCount: 10,
totalCount: 20,
imageUrl:
'https://images.unsplash.com/photo-1516978101789-720eacb59e79?w=500&auto=format&fit=crop&q=60&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxzZWFyY2h8NjV8fGNhdHxlbnwwfHwwfHx8Mg%3D%3D',
liked: true,
},
{
id: 4,
title: '์ถ•๊ตฌ ๋ชจ์ž„',
dateTime: '2024-12-20T14:00',
location: '์„œ์šธ ๋งˆํฌ๊ตฌ ์ƒ์•”๋™ ์›”๋“œ์ปต๊ณต์›',
currentCount: 10,
totalCount: 20,
imageUrl:
'https://images.unsplash.com/photo-1516978101789-720eacb59e79?w=500&auto=format&fit=crop&q=60&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxzZWFyY2h8NjV8fGNhdHxlbnwwfHwwfHx8Mg%3D%3D',
liked: true,
},

];

const queryClient = new QueryClient();

const meta: Meta<typeof GatheringCardCarousel> = {
title: 'Components/GatheringCardCarousel',
component: GatheringCardCarousel,
const meta: Meta<typeof CrewGatheringList> = {
title: 'Components/CrewGatheringList',
component: CrewGatheringList,
parameters: {
layout: 'fullscreen',
layout: 'fulled', // layout ๋ณ€๊ฒฝ
},
Comment on lines +55 to 60
Copy link

Choose a reason for hiding this comment

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

โš ๏ธ Potential issue

๋ ˆ์ด์•„์›ƒ ํŒŒ๋ผ๋ฏธํ„ฐ์˜ ์˜คํƒ€๋ฅผ ์ˆ˜์ •ํ•ด์ฃผ์„ธ์š”.

Storybook์˜ layout ํŒŒ๋ผ๋ฏธํ„ฐ์— ์˜คํƒ€๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค. 'fulled'๋Š” ์œ ํšจํ•˜์ง€ ์•Š์€ ๊ฐ’์ž…๋‹ˆ๋‹ค.

  parameters: {
-   layout: 'fulled',
+   layout: 'fullscreen',
  },
๐Ÿ“ Committable suggestion

โ€ผ๏ธ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const meta: Meta<typeof CrewGatheringList> = {
title: 'Components/CrewGatheringList',
component: CrewGatheringList,
parameters: {
layout: 'fullscreen',
layout: 'fulled', // layout ๋ณ€๊ฒฝ
},
const meta: Meta<typeof CrewGatheringList> = {
title: 'Components/CrewGatheringList',
component: CrewGatheringList,
parameters: {
layout: 'fullscreen', // layout ๋ณ€๊ฒฝ
},

tags: ['autodocs'],
decorators: [
(Story) => (
<QueryClientProvider client={queryClient}>
<Story />
{/* ๋ถ€๋ชจ ์ปจํ…Œ์ด๋„ˆ ์ถ”๊ฐ€ */}
<div className="flex w-full justify-center bg-gray-100">
<div className="relative -mx-6 w-[calc(100%+3rem)]">
<Story />
</div>
</div>
</QueryClientProvider>
),
],
} satisfies Meta<typeof GatheringCardCarousel>;
} satisfies Meta<typeof CrewGatheringList>;

export default meta;
type Story = StoryObj<typeof meta>;
Expand Down
Loading
Loading