From 9064340584e0be98564ae908714780a071791de8 Mon Sep 17 00:00:00 2001 From: Park Dahyeon Date: Wed, 11 Nov 2026 13:48:41 +0900 Subject: [PATCH] refactor(web): restyle home schedule and results as divided lists Replace the panel cards on the home page with section lists separated by horizontal rules, sharing one schedule row layout. Remove the obsolete home history test and record the design QA notes. Co-Authored-By: Claude Fable 5.2 --- apps/web/src/pages/HomePage.tsx | 330 ++++++++++++------------ apps/web/test/home-page-history.test.ts | 32 --- design-qa.md | 74 ++++++ 3 files changed, 236 insertions(+), 200 deletions(-) delete mode 100644 apps/web/test/home-page-history.test.ts diff --git a/apps/web/src/pages/HomePage.tsx b/apps/web/src/pages/HomePage.tsx index d13c7145..76e70548 100644 --- a/apps/web/src/pages/HomePage.tsx +++ b/apps/web/src/pages/HomePage.tsx @@ -25,9 +25,7 @@ import { EmptyNote, ErrorNote, LoadingNote, - Panel, PanelHeader, - Pill, PlainPage, Skeleton, pageWidthClass, @@ -45,6 +43,9 @@ const MATCH_ARCHIVE_PAGE_SIZE = 10; const HOME_HISTORY_LIMIT = 4; const HOME_RANKING_LIMIT = 5; const DEFAULT_MAP_ID = 11; +const SCHEDULE_LIST_CLASS = 'divide-y divide-line border-y border-line'; +const SCHEDULE_ROW_CLASS = + 'grid grid-cols-[minmax(0,1fr)_auto] gap-x-3 gap-y-2 px-2 py-3.5 md:grid-cols-[7.5rem_minmax(0,1fr)_auto] md:items-center md:gap-4'; const RANKING_COLUMNS_CLASS = 'grid grid-cols-[1.5rem_minmax(0,1fr)_3rem] items-center gap-3 px-3'; /** 순위 카드의 슬라이드 순서. undefined는 종합 순위. */ @@ -128,60 +129,129 @@ function NextMatch({ match }: { match: MatchDetailResponse }) { function UpcomingMatches({ matches, title = '이어지는 내전', + actions, footer, }: { matches: MatchDetailResponse[]; title?: string; + actions?: ReactNode; footer?: ReactNode; }) { return ( - - -
    - {matches.map((match) => { - const schedule = getHomeMatchSchedule(match.scheduledAt); - const { capacity, label } = getHomeMatchEnrollment(match); - return ( -
  • - - -

    - {match.title} -

    -

    - {match.status === 'recruiting' - ? label - : getMatchStageLabel(match)}{' '} - · {capacity} -

    -
  • - ); - })} +
    + +
      + {matches.map((match) => ( +
    • + +
    • + ))}
    {matches.length === 0 && ( )} {footer} - +
    + ); +} + +function ScheduleMatchRow({ match }: { match: MatchDetailResponse }) { + const { capacity, label } = getHomeMatchEnrollment(match); + return ( + } + /> + ); +} + +function ScheduleStatus({ + match, + label = getMatchStageLabel(match), +}: { + match: Pick; + label?: string; +}) { + const stage = match.eventProgress?.stage ?? match.status; + const statusColor = stage === 'in-progress' + ? 'text-leaf' + : stage === 'auction' + ? 'text-gold' + : 'text-content-muted'; + + return ( + + {stage === 'in-progress' && ( + + ); +} + +function ScheduleRow({ + href, + scheduledAt, + title, + meta, + result, + resultBelowOnMobile = false, +}: { + href: string; + scheduledAt: string; + title: string; + meta: ReactNode; + result: ReactNode; + resultBelowOnMobile?: boolean; +}) { + const schedule = getHomeMatchSchedule(scheduledAt); + + return ( + + +
    +

    + {title} +

    +

    + {meta} +

    +
    +
    + + {result} + +
    + ); } function HistoryResult({ match }: { match: MatchSummaryResponse }) { const result = match.historyResult; - const teamLabelClass = 'min-w-0 break-words text-content-muted md:truncate'; + const teamLabelClass = 'min-w-0 text-content-muted [overflow-wrap:anywhere]'; if (match.status === 'finished' && result) { switch (result.type) { case 'score': { @@ -240,14 +310,7 @@ function HistoryResult({ match }: { match: MatchSummaryResponse }) { } } if (match.status === 'team-built' || match.status === 'in-progress') { - return ( - - {getMatchStageLabel(match)} - - ); + return ; } return ( @@ -256,65 +319,25 @@ function HistoryResult({ match }: { match: MatchSummaryResponse }) { ); } -function HistoryTableColumns() { - return ( - <> - - - - - - - - - 일정 - 대회 - 상태·결과 - - 참가 - - - - - ); -} - function HistoryRecordsSkeleton({ limit }: { limit: number }) { - const rows = Array.from({ length: limit }); return ( - <> -
    - - - - {rows.map((_, index) => ( - - - - - - - ))} - - -
    -
); } @@ -335,67 +358,26 @@ function HistoryRecords({ match, title: getHistoryMatchTitle(match.title, schedule), href: `/match/${match._id}`, - schedule: schedule?.compact ?? '일정 미정', map: match.mapId === DEFAULT_MAP_ID ? undefined : mapIdToLabel(match.mapId), }; }); return ( - <> -
- - - - {rows.map(({ match, title, href, schedule, map }) => ( - - - - - - - ))} - -
- - - - {title} - - {map &&

{map}

} -
- - - {match.participants.length}명 -
-
-
    - {rows.map(({ match, title, href, schedule, map }) => ( -
  • - -
    - - {match.participants.length}명 -
    -

    - {title} -

    -
    - - {map && · {map}} -
    - -
  • - ))} -
- +
    + {rows.map(({ match, title, href, map }) => ( +
  • + 참가 {match.participants.length}명{map && <> · {map}}} + result={} + resultBelowOnMobile + /> +
  • + ))} +
); } @@ -772,6 +754,7 @@ function RankingPreview({ statsPath }: { statsPath: string }) { } interface MatchPaginationProps { + label: string; page: number; pageCount: number; total: number; @@ -781,6 +764,7 @@ interface MatchPaginationProps { } function MatchPagination({ + label, page, pageCount, total, @@ -789,7 +773,7 @@ function MatchPagination({ onNext, }: MatchPaginationProps) { return ( -
+
- + ); } @@ -893,9 +877,8 @@ export default function HomePage({ eventType }: { eventType?: MatchEventType }) const hasHistoryError = Boolean(historyMatchesQuery.error) && !historyMatchesQuery.data; const statsPath = `/communities/${DEFAULT_COMMUNITY_ID}/internal-stats`; - const HistorySection = showArchive ? Panel : 'section'; const UpcomingStatusHeading = showArchive ? 'p' : 'h1'; - const contentSpacing = showArchive ? 'space-y-5 pb-16' : 'space-y-8 pb-10 md:pb-16'; + const contentSpacing = 'space-y-8 pb-10 md:pb-16'; const contentTopPadding = bannerMatch ? 'pt-10 md:pt-16' : 'pt-5 sm:pt-6'; const content = ( @@ -909,17 +892,27 @@ export default function HomePage({ eventType }: { eventType?: MatchEventType }) void activeMatchesQuery.refetch()} />} /> ) : activeMatchesQuery.isPlaceholderData ? ( - - +
+ - +
) : activeMatchesQuery.data && (activeMatchesQuery.data.matches.length > 0 || activePage > 1) ? ( + 전체 일정 +