Skip to content
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Button from '@/src/components/common/input/button';
import { Profile } from '@/src/components/common/profile';
import { GatheringDetailType } from '@/src/types/gathering-data';
import IcoClock from '@/public/assets/icons/ic-clock.svg';
import IcoUser from '@/public/assets/icons/ic-user.svg';
import IcoPerson from '@/public/assets/icons/ic-gathering-person.svg';

export interface GatheringDetailModalProps {
opened: boolean;
Expand Down Expand Up @@ -60,44 +60,31 @@ export default function GatheringDetailModalPresenter({
</figure>
<div className="flex flex-col gap-8 p-6">
<section>
<hgroup>
<h2 className="text-xl font-semibold text-gray-800 md:mr-2 md:inline-block">
{data?.title}
</h2>

<h3 className="text-base font-medium text-gray-700 md:inline-block">
<i
className="mr-2 hidden text-xl font-semibold not-italic text-gray-800 md:inline-block"
aria-hidden="true"
>
|
</i>
<span>{data?.location}</span>
</h3>
</hgroup>
<p className="mb-6 mt-2.5 flex gap-2 text-base font-semibold">
<span className="rounded-[4px] bg-gray-900 px-2 py-0.5 text-white">
{formatDate(data?.dateTime).date}
</span>
<span className="rounded-[4px] bg-gray-900 px-2 py-0.5 text-white">
<div className="mb-2 flex items-center space-x-2">
<p className="overflow-hidden text-ellipsis whitespace-nowrap text-base font-semibold text-blue-500">
{`${formatDate(data?.dateTime).date} ${formatDate(data?.dateTime).dayOfWeek}`}
</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">
{formatDate(data?.dateTime).time}
</span>
</p>
<p className="text-base font-medium text-gray-700">{data?.introduce}</p>
</p>
</div>
<h2 className="text-xl font-semibold text-gray-800">{data?.title}</h2>
<h3 className="text-base font-medium text-gray-700">{data?.location}</h3>
<div className="mt-4 w-full border-gray-200">
<p className="text-base font-semibold text-blue-500">์•ฝ์† ๊ณต์ง€์‚ฌํ•ญ</p>
<div className="overflow-y-auto text-base font-medium text-gray-700">
{data?.introduce || '์†Œ๊ฐœ ์ •๋ณด๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค.'}
</div>
</div>
Comment on lines +72 to +79
Copy link

Choose a reason for hiding this comment

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

๐Ÿ’ก Codebase verification

๋ฐ์ดํ„ฐ ์ฒ˜๋ฆฌ์— ๋Œ€ํ•œ ๋ฐฉ์–ด ๋กœ์ง์ด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค

์ฝ”๋“œ ๊ฒ€ํ†  ๊ฒฐ๊ณผ, ๋‹ค์Œ๊ณผ ๊ฐ™์€ ๊ฐœ์„ ์ด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค:

  • data?.location์ด undefined์ผ ๋•Œ ๋Œ€์ฒด ํ…์ŠคํŠธ๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค.
  • ๋‹ค๋ฅธ ํ•„๋“œ๋“ค(title, dateTime ๋“ฑ)์€ ์˜ต์…”๋„ ์ฒด์ด๋‹์œผ๋กœ ์ฒ˜๋ฆฌ๋˜์–ด ์žˆ์ง€๋งŒ, ๋นˆ ๊ฐ’์— ๋Œ€ํ•œ ๋Œ€์ฒด ํ…์ŠคํŠธ๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค.

๊ฐœ์„  ์ œ์•ˆ:

<h2 className="text-xl font-semibold text-gray-800">{data?.title || '์ œ๋ชฉ ์—†์Œ'}</h2>
<h3 className="text-base font-medium text-gray-700">{data?.location || '์œ„์น˜ ์ •๋ณด ์—†์Œ'}</h3>
๐Ÿ”— Analysis chain

์œ„์น˜ ์ •๋ณด์™€ ๊ณต์ง€์‚ฌํ•ญ ์„น์…˜์ด ์ž˜ ๊ตฌ์„ฑ๋˜์—ˆ์Šต๋‹ˆ๋‹ค!

์œ„์น˜ ์ •๋ณด ์ถ”๊ฐ€์™€ ๊ณต์ง€์‚ฌํ•ญ ์„น์…˜์˜ ๊ตฌ์กฐํ™”๊ฐ€ ์ž˜ ๋˜์—ˆ์Šต๋‹ˆ๋‹ค. ๋‹ค๋งŒ, ๋ฐ์ดํ„ฐ ์ฒ˜๋ฆฌ ๊ด€๋ จ ๋ณด์™„์ด ํ•„์š”ํ•ด ๋ณด์ž…๋‹ˆ๋‹ค.

๋‹ค์Œ ์‚ฌํ•ญ๋“ค์„ ํ™•์ธํ•ด์ฃผ์‹œ๊ธฐ ๋ฐ”๋ž๋‹ˆ๋‹ค:

  1. location ๋ฐ์ดํ„ฐ๊ฐ€ ์—†๋Š” ๊ฒฝ์šฐ์— ๋Œ€ํ•œ ์ฒ˜๋ฆฌ
  2. data ๊ฐ์ฒด๊ฐ€ undefined์ธ ๊ฒฝ์šฐ์— ๋Œ€ํ•œ ๋ฐฉ์–ด ๋กœ์ง

์•„๋ž˜ ์Šคํฌ๋ฆฝํŠธ๋กœ ๊ด€๋ จ ์ฝ”๋“œ๋ฅผ ํ™•์ธํ•ด๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค:

๐Ÿ Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# location prop์˜ ํ•„์ˆ˜ ์—ฌ๋ถ€ ํ™•์ธ
rg -A 5 "location.*:" "src/types/*"

Length of output: 89


Script:

#!/bin/bash
# ํƒ€์ž… ์ •์˜ ํŒŒ์ผ ์ฐพ๊ธฐ
fd "types?.ts" --type f

# ๋ฐ์ดํ„ฐ ํƒ€์ž… ์ •์˜ ํ™•์ธ
rg -g "*.ts" -g "*.tsx" "type.*Gathering|interface.*Gathering" -A 10

Length of output: 29688


Script:

#!/bin/bash
# ๋ชจ๋‹ฌ ์ปดํฌ๋„ŒํŠธ์˜ ๋ฐ์ดํ„ฐ ํƒ€์ž…๊ณผ ๊ตฌํ˜„ ํ™•์ธ
rg -g "*.ts*" "GatheringDetailType" -A 5 "src/app/(crew)/crew/detail/\[id\]/_components/gathering-detail-modal/"

# ๋ฐ์ดํ„ฐ ์ฒ˜๋ฆฌ ๋กœ์ง ํ™•์ธ
ast-grep --pattern 'data?.location' -l ts,tsx

Length of output: 383


Script:

#!/bin/bash
# ๋ชจ๋‹ฌ ์ปดํฌ๋„ŒํŠธ์˜ ๋ฐ์ดํ„ฐ ํƒ€์ž…๊ณผ ๊ตฌํ˜„ ํ™•์ธ
rg -g "*.tsx" "data\?" -A 2 -B 2 "src/app/(crew)/crew/detail/[id]/_components/gathering-detail-modal/presenter.tsx"

# GatheringDetailType ์ธํ„ฐํŽ˜์ด์Šค ํ™•์ธ
rg -g "*.ts" "GatheringDetailType.*{" -A 10

Length of output: 3064

</section>
<section className="text-gray-700">
<h3 className="mb-4 flex items-center text-base font-medium">
<figure className="relative h-[20px] w-[20px]">
<Image
src={IcoUser}
fill
alt="์•„์ด์ฝ˜"
style={{ width: '100%', height: '100%', objectFit: 'cover' }}
/>
</figure>
<span>
์ฐธ์—ฌ์ธ์› {data?.currentCount}/{data?.totalCount}
</span>
<h3 className="mb-4 flex items-center space-x-1">
<Image src={IcoPerson} alt="person icon" width={20} height={20} />
<p className="text-base font-medium text-gray-700">
์ฐธ์—ฌ์ธ์› <span className="text-blue-500">{data?.currentCount}</span>/
{data?.totalCount}
</p>
</h3>
<ScrollArea h={152}>
<ul className="grid grid-cols-2 gap-4">
Expand Down Expand Up @@ -135,7 +122,7 @@ export default function GatheringDetailModalPresenter({
onClick={onExit}
className="btn-filled h-11 w-29.5 text-base font-medium"
>
ํƒˆํ‡ดํ•˜๊ธฐ
์•ฝ์† ์ทจ์†Œํ•˜๊ธฐ
</Button>
)}
{data?.gatheringCaptain && (
Expand All @@ -144,7 +131,7 @@ export default function GatheringDetailModalPresenter({
onClick={onDelete}
className="btn-filled h-11 w-29.5 text-base font-medium"
>
์‚ญ์ œํ•˜๊ธฐ
์•ฝ์† ์‚ญ์ œํ•˜๊ธฐ
</Button>
)}
</footer>
Expand Down
24 changes: 12 additions & 12 deletions src/app/(crew)/my-crew/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,18 @@ export default function MyCrewLayout({ children }: { children: ReactNode }) {
}, [currentPath]);

return (
<div className="py-8 md:py-12.5">
<div className="px-3 md:px-8 lg:px-11.5">
<Tabs
variant="default"
tabs={myCrewTabs}
activeTab={currentTab}
onTabClick={(id) => {
handleTabClick(id);
}}
/>
</div>
<div className="mt-8 px-3 md:px-8 lg:px-11.5">{children}</div>
<div className="px-3 py-4 md:px-8 md:py-16 lg:px-11.5">
<div className="hidden pb-6 text-3xl font-bold md:block">๋‚˜์˜ ํฌ๋ฃจ</div>
<Tabs
variant="default"
tabs={myCrewTabs}
activeTab={currentTab}
onTabClick={(id) => {
handleTabClick(id);
}}
/>
<div className="mt-10 hidden w-full border-t-2 border-gray-200 md:block" />
<div className="mt-10">{children}</div>
</div>
);
}
4 changes: 3 additions & 1 deletion src/app/(crew)/my-favorite/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ import LikedList from '@/src/components/gathering-list/liked-list-container';

export default function FavoritePage() {
return (
<div className="mt-4 md:mt-10">
<div className="px-3 py-4 md:px-8 md:py-16 lg:px-11.5">
<div className="hidden pb-10 text-3xl font-bold md:block">์ฐœํ•œ ์•ฝ์†</div>

<LikedList />
</div>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client';

import { useMemo } from 'react';
import { formatDate, getDayOfWeek } from '@/src/utils/format-date';
import { formatDate } from '@/src/utils/format-date';
import ScheduledGatheringCard from '@/src/components/common/gathering-card/scheduled-gathering-card/container';
import { GatheringCardProps } from '@/src/types/gathering-data';

Expand All @@ -28,7 +28,7 @@ export default function GatheringListWithDate({ gatheringList }: GatheringListWi
<div className="hidden flex-nowrap md:block">
<div className="text-lg font-semibold">{formatDate(gathering.dateTime).date}</div>
<div className="text-base font-medium text-gray-500">
{getDayOfWeek(gathering.dateTime)}
{formatDate(gathering.dateTime).dayOfWeek}
</div>
</div>
)}
Expand Down
8 changes: 5 additions & 3 deletions src/app/(crew)/my-gathering/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { usePathname, useRouter } from 'next/navigation';
import Tabs from '@/src/components/common/tab';

const myGatheringTabs = [
{ id: 'my-gathering-joined', label: '์ฐธ์—ฌํ•œ ์•ฝ์†', route: '/my-gathering/joined' },
{ id: 'my-gathering-hosted', label: '๋งŒ๋“  ์•ฝ์†', route: '/my-gathering/hosted' },
{ id: 'my-gathering-joined', label: '๋‚ด๊ฐ€ ์ฐธ์—ฌํ•œ ์•ฝ์†', route: '/my-gathering/joined' },
{ id: 'my-gathering-hosted', label: '๋‚ด๊ฐ€ ๋งŒ๋“  ์•ฝ์†', route: '/my-gathering/hosted' },
];

export default function MyGatheringLayout({
Expand All @@ -29,13 +29,15 @@ export default function MyGatheringLayout({
};

return (
<div className="px-3 py-8 md:px-8 md:py-12.5 lg:px-11.5">
<div className="px-3 py-4 md:px-8 md:py-16 lg:px-11.5">
<div className="hidden pb-6 text-3xl font-bold text-gray-900 md:block">๋‚˜์˜ ์•ฝ์†</div>
<Tabs
variant="default"
tabs={myGatheringTabs}
activeTab={currentTab}
onTabClick={(id) => handleTabClick(id)}
/>
<div className="mt-10 hidden w-full border-t-2 border-gray-200 md:block" />
{children}
</div>
);
Expand Down
9 changes: 1 addition & 8 deletions src/app/(crew)/my-page/_components/review-tabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,7 @@ export default function ReviewTabs() {
<div className="mt-12 flex flex-col">
<h3 className="text-2xl font-semibold text-gray-900">๋‚˜์˜ ๋ฆฌ๋ทฐ ๋ชจ์•„๋ณด๊ธฐ</h3>
<Divider mt={16} mb={24} size={2} />
<div className="flex justify-start">
<Tabs
variant="review"
tabs={myPageTabs}
activeTab={currentTab}
onTabClick={handleTabClick}
/>
</div>
<Tabs variant="review" tabs={myPageTabs} activeTab={currentTab} onTabClick={handleTabClick} />
</div>
);
}
4 changes: 2 additions & 2 deletions src/components/common/gathering-card/presenter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default function GatheringCardPresenter({
deadlineMessage,
className,
}: GatheringCardPresenterProps) {
const { date, time } = formatDate(dateTime);
const { date, dayOfWeek, time } = formatDate(dateTime);

const handleLikeClick = (e: MouseEvent) => {
e.stopPropagation();
Expand Down Expand Up @@ -77,7 +77,7 @@ export default function GatheringCardPresenter({
<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}
{`${date} ${dayOfWeek}`}
</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">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,98 +1,57 @@
import Image from 'next/image';
import { Badge } from '@mantine/core';
import { formatDate } from '@/src/utils/format-date';
import LikeBtn from '@/src/components/common/input/button/like-btn';
import IcoPerson from '@/public/assets/icons/person.svg';
import { GatheringCardProps } from '@/src/types/gathering-data';
import IcoPerson from '@/public/assets/icons/ic-gathering-person.svg';
import Button from '../../input/button';

interface ScheduledGatheringCardPresenterProps {
data: {
id: number;
crewTitle: string;
crewMainLocation: string;
crewSubLocation: string;
title: string;
dateTime: string;
currentCount: number;
totalCount: number;
imageUrl: string;
liked: boolean;
};
data: GatheringCardProps;
onClick: () => void;
}

export default function ScheduledGatheringCardPresenter({
data,
onClick,
}: ScheduledGatheringCardPresenterProps) {
const {
id,
crewTitle,
crewMainLocation,
crewSubLocation,
title,
dateTime,
currentCount,
totalCount,
imageUrl,
liked,
} = data;
const { crewTitle, title, dateTime, location, currentCount, totalCount, imageUrl } = data;

const { date, time } = formatDate(dateTime);
const { date, dayOfWeek, time } = formatDate(dateTime);

return (
<div className="space-y-2">
<div className="ml-2 flex items-center">
<span className="text-xl font-semibold text-gray-800">{crewTitle}</span>
<div className="ml-2 mr-1 h-[18px] w-[2px] bg-black" />
<span className="text-base font-medium text-gray-700">
{crewMainLocation} {crewSubLocation}
</span>
</div>
<span className="text-xl font-semibold text-gray-800">{crewTitle}</span>
{/* eslint-disable-next-line jsx-a11y/click-events-have-key-events */}
<div
onClick={onClick}
role="button"
tabIndex={0}
className="relative flex h-44 cursor-pointer items-center space-x-4 rounded-xl bg-white p-6 shadow-xs md:space-x-6 lg:space-x-6"
className="h-80 cursor-pointer items-center rounded-xl bg-white shadow-xs md:flex md:h-44"
Copy link

Choose a reason for hiding this comment

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

๐Ÿ› ๏ธ Refactor suggestion

์ ‘๊ทผ์„ฑ ๊ฐœ์„ ์„ ์œ„ํ•œ ์ œ์•ˆ์‚ฌํ•ญ์ด ์žˆ์Šต๋‹ˆ๋‹ค.

  1. ํด๋ฆญ ์ด๋ฒคํŠธ ์ฒ˜๋ฆฌ ๊ฐœ์„ ์ด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค:
-      {/* eslint-disable-next-line jsx-a11y/click-events-have-key-events */}
       <div
         onClick={onClick}
         role="button"
         tabIndex={0}
+        onKeyDown={(e) => {
+          if (e.key === 'Enter' || e.key === ' ') {
+            onClick();
+          }
+        }}
         className="h-80 cursor-pointer items-center rounded-xl bg-white shadow-xs md:flex md:h-44"
       >
  1. ์Šคํฌ๋ฆฐ ๋ฆฌ๋” ์‚ฌ์šฉ์ž๋ฅผ ์œ„ํ•œ ์ถ”๊ฐ€ ์ •๋ณด๊ฐ€ ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค:
-              <Image src={IcoPerson} alt="person icon" width={16} height={16} className="pb-0.5" />
+              <Image src={IcoPerson} alt="์ฐธ์—ฌ ์ธ์› ์•„์ด์ฝ˜" width={16} height={16} className="pb-0.5" />
  1. ๋ฒ„ํŠผ ์ปดํฌ๋„ŒํŠธ์˜ ์ ‘๊ทผ์„ฑ ์†์„ฑ์„ ์ถ”๊ฐ€ํ•˜๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค:
-            <Button className="lg:w-1/ btn-filled w-40 md:w-1/2" onClick={onClick}>
+            <Button 
+              className="lg:w-1/ btn-filled w-40 md:w-1/2" 
+              onClick={onClick}
+              aria-label={`${title} ๋ชจ์ž„ ์ƒ์„ธ ์ •๋ณด ๋ณด๊ธฐ`}
+            >

Also applies to: 31-31, 34-53

>
{/* Image Section */}
<div className="relative h-28 w-28 flex-shrink-0 overflow-hidden rounded-lg md:h-32 md:w-32 lg:h-32 lg:w-32">
<div className="relative h-1/2 w-full flex-shrink-0 overflow-hidden rounded-t-lg md:h-full md:w-1/3 md:rounded-l-lg md:rounded-r-none">
<Image src={imageUrl} alt={title} layout="fill" className="object-cover" />
</div>

{/* Content Section */}
<div className="flex h-full w-full min-w-0 flex-grow flex-col justify-between">
<div className="space-y-2">
<h3 className="w-full overflow-hidden text-ellipsis whitespace-nowrap text-xl font-semibold text-gray-800">
{title}
</h3>
<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 className="flex h-1/2 w-full min-w-0 flex-grow flex-col justify-between p-4 md:h-full">
<div className="overflow-hidden text-ellipsis whitespace-nowrap">
<div className="mb-2 flex items-center space-x-2 text-sm font-semibold text-blue-500 md:text-base">
<p>{`${date} ${dayOfWeek}`}</p>
<div className="h-[18px] w-[1px] bg-gray-300" />
<p>{time}</p>
</div>
<h3 className="text-lg font-semibold text-gray-800 md:text-xl">{title}</h3>
<p className="text-xm mb-2 font-normal text-gray-700">{location}</p>
</div>
<div className="flex justify-between">
<div className="flex items-end space-x-1 pb-2 md:pb-0">
<Image src={IcoPerson} alt="person icon" width={16} height={16} className="pb-0.5" />
<p className="text-sm font-normal text-gray-900">
์ฐธ์—ฌ์ธ์› <span className="text-blue-500">{currentCount}</span>/{totalCount}
</p>
</div>
<Button className="lg:w-1/ btn-filled w-40 md:w-1/2" 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>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export const LikedEvent: Story = {
crewSubLocation: '๊ฐ•๋‚จ๊ตฌ ์—ญ์‚ผ๋™',
title: '๊ฐ€๋‚˜๋‹ค๋ผ๋งˆ๊ฐ€๋‚˜๋‹ค๋ผ๋งˆ๊ฐ€๋‚˜๋‹ค๋ผ๋งˆ๊ฐ€',
dateTime: '2024-10-30T00:30',
location: '์—ญ์‚ผ์—ญ 1๋ฒˆ์ถœ๊ตฌ',
currentCount: 8,
totalCount: 12,
imageUrl:
Expand All @@ -57,6 +58,7 @@ export const NotLikedEvent: Story = {
crewSubLocation: '์šฉ์‚ฐ๊ตฌ ํ•œ๊ฐ•๋กœ',
title: '๋“ฑ์‚ฐ ๋ชจ์ž„',
dateTime: '2024-11-12T09:00',
location: 'ํ•œ๊ฐ•์ง„์—ญ 1๋ฒˆ์ถœ๊ตฌ',
currentCount: 5,
totalCount: 10,
imageUrl:
Expand Down
Loading
Loading