From d10e2ab01102a879e5e8218662067e4608b5515b Mon Sep 17 00:00:00 2001 From: dahyeon Date: Mon, 8 Jun 2026 22:35:32 -0700 Subject: [PATCH] fix(web): keep history table shell during loading --- apps/web/src/pages/HomePage.tsx | 157 ++++++++++++++++++++++---------- 1 file changed, 108 insertions(+), 49 deletions(-) diff --git a/apps/web/src/pages/HomePage.tsx b/apps/web/src/pages/HomePage.tsx index 45136f47..6f0723aa 100644 --- a/apps/web/src/pages/HomePage.tsx +++ b/apps/web/src/pages/HomePage.tsx @@ -9,6 +9,8 @@ const UPCOMING_GRID_MATCH_LIMIT = 3; const UPCOMING_MATCH_LIST_LIMIT = UPCOMING_GRID_MATCH_LIMIT + 1; const HISTORY_MATCH_PAGE_SIZE = 10; const EMPTY_SCHEDULE_TEXT = '예정된 매치가 없습니다.'; +const HISTORY_TABLE_ROW_CLASS = + 'h-10 border-b border-base-content/5 last:border-b-0'; function SkeletonBlock({ className }: { className: string }) { return ( @@ -19,53 +21,126 @@ function SkeletonBlock({ className }: { className: string }) { ); } -function HistoryRecordsSkeleton() { - const historySkeletons = Array.from({ length: 5 }); +function SkeletonText({ + children, + className = '', + skeletonClassName, +}: { + children: string; + className?: string; + skeletonClassName: string; +}) { + return ( + + {children} + + ); +} + +function SkeletonBadge({ + children, + className, +}: { + children: string; + className: string; +}) { + return ( + + {children} + + ); +} + +function HistoryTableColGroup() { + return ( + + + + + + + + + ); +} + +function HistoryTableHeader() { + return ( + + + 날짜 + 내전 + 상태 + 맵 + 참가 + 결과 + + + ); +} + +function HistoryRecordsSkeleton({ rows = 5 }: { rows?: number }) { + const historySkeletons = Array.from({ length: rows }); return ( <>
- - - - - - - - - - - {['날짜', '내전', '상태', '맵', '참가', '결과'].map((label) => ( - - ))} - - + + {historySkeletons.map((_, index) => ( - - - ))} @@ -481,7 +556,7 @@ export default function HomePage() { 지난 내전 기록 {isHistoryPageLoading ? ( - + ) : hasHistoryError ? (
지난 내전 기록을 불러오지 못했습니다. @@ -491,30 +566,14 @@ export default function HomePage() { {/* 데스크톱: 테이블 */}
- -
- + + + 2026년 6월 8일 월 + - + + 정기 내전 + - + + 팀빌딩 + - + + 소환사의 협곡 + - + + + 10명 + - + + + 1팀 승리 +
- - - - - - - - - - - - - - - - - - + + {historyMatches.length > 0 ? ( historyMatches.map((match) => (
날짜내전상태맵참가결과
{match.date}