Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions apps/web/e2e/mocks/tournament.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ export const MOCK_TOURNAMENT_LIST: GetTournamentListResponseT = [
name: 'E2E 토너먼트',
status: 'PENDING',
createdAt: '2026-01-01T00:00:00Z',
/** 가짜 URL — fixture 가 가로채 로컬 이미지로 응답한다 (e2e/mocks/images.ts) */
participantProfileImages: [MOCK_IMAGE_URLS.avatar],
participantCount: 1,
playedCount: 0,
thumbnailUrls: [],
},
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ function TournamentHistoryList({ statuses, playType, statusTab }: Props) {
tournamentId={tournament.tournamentId}
status={tournament.status}
name={tournament.name}
profileImageUrls={tournament.participantProfileImages}
participantCount={tournament.participantProfileImages.length}
participantCount={tournament.participantCount}
playedCount={tournament.playedCount}
scrollRestoration={{ namespace: SCROLL_NAMESPACE.ARCHIVE_TOURNAMENT, scope: statusTab }}
/>
))}
Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/app/home/_components/tournament-list/client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ function TournamentListClient({ isGuest = false }: TournamentListClientProps) {
tournamentId={tournament.tournamentId}
status={tournament.status}
name={tournament.name}
profileImageUrls={tournament.participantProfileImages}
participantCount={tournament.participantProfileImages.length}
participantCount={tournament.participantCount}
playedCount={tournament.playedCount}
showMorePopover={false}
/>
))}
Expand Down
26 changes: 17 additions & 9 deletions apps/web/src/components/tournament-card/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import Link from 'next/link';
import type { MouseEvent } from 'react';

import { PersonIconFill } from '@/assets/icons';
import StatusChip from '@/components/status-chip';
import UserProfileGroup from '@/components/user-profile-group';
import { ROUTES } from '@/consts/route';
import type { TournamentStatusT } from '@/types/tournament';
import { cn } from '@/utils/cn';
Expand All @@ -16,12 +16,12 @@ type TournamentCardProps = {
tournamentId: number;
status: TournamentStatusT;
name: string;
profileImageUrls: string[];
/** 토너먼트 아이템 썸네일. 최대 2개. */
imageUrls: string[];
maxProfiles?: number;
/** 본인 포함 참여자 수. 2명 이상이면 더보기에 '친구 목록 보기' 메뉴 노출. */
participantCount?: number;
/** 본인 포함 함께 담은 참여자 수. 2명 이상이면 더보기에 '친구 목록 보기' 메뉴 노출. */
participantCount: number;
/** 실제로 플레이한 인원 수 */
playedCount: number;
className?: string;
showMorePopover?: boolean;
scrollRestoration?: ScrollRestorationTargetT;
Expand All @@ -31,10 +31,9 @@ function TournamentCard({
tournamentId,
status,
name,
profileImageUrls,
imageUrls = [],
maxProfiles = 3,
participantCount,
playedCount,
className,
showMorePopover = true,
scrollRestoration,
Expand Down Expand Up @@ -76,7 +75,7 @@ function TournamentCard({

<ItemImageThumbnails imageUrls={imageUrls} />

<div className="flex flex-1 flex-col items-start gap-2 self-center">
<div className="flex flex-1 flex-col items-start gap-2.5 self-center">
<div className="flex w-full items-center justify-between gap-2">
<div className="flex items-center gap-2">
<StatusChip status={status} />
Expand All @@ -94,7 +93,16 @@ function TournamentCard({
)}
</div>

<UserProfileGroup profileImageUrls={profileImageUrls} max={maxProfiles} size="sm" />
<div className="flex items-center gap-1 caption-1-regular">
<PersonIconFill className="size-3 shrink-0 text-sky-blue-500" aria-hidden />
<span className="text-text-neutral-secondary">
함께 담은 <span className="text-text-neutral-primary">{participantCount}</span>
</span>
<div className="mx-2 h-2 w-px shrink-0 bg-border-neutral-muted" aria-hidden />
<span className="text-text-neutral-secondary">
플레이한 <span className="text-text-neutral-primary">{playedCount}</span>
</span>
</div>
</div>
</article>
);
Expand Down
3 changes: 2 additions & 1 deletion apps/web/src/types/tournament.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ export type GetTournamentListResponseT = {
name: string;
status: TournamentStatusT;
createdAt: string;
participantProfileImages: string[];
participantCount: number;
playedCount: number;
thumbnailUrls: string[];
}[];

Expand Down
Loading