feat: improve tournament workflows and prune outdated docs
This commit is contained in:
1 parent
da7b502936
commit
38a89b5374
53 files changed
+3308
-3276
No files matched your search
@@ -411,55 +411,6 @@ function ItemGrid({
|
||||
);
|
||||
}
|
||||
|
||||
function TeamMini({
|
||||
match,
|
||||
manifest,
|
||||
ownerParticipantId,
|
||||
}: {
|
||||
match: ApiRecentMatchView;
|
||||
manifest: DdragonManifest | null | undefined;
|
||||
ownerParticipantId: string;
|
||||
}) {
|
||||
return (
|
||||
<div className="grid flex-1 grid-cols-2 gap-x-3 text-[10px] leading-tight min-w-0">
|
||||
{match.teams.map((team) => (
|
||||
<div key={`${match.matchId}-${team.side}`} className="min-w-0">
|
||||
{team.participants.map((participant) => {
|
||||
const championName =
|
||||
championDisplayName(manifest, participant.championId) ??
|
||||
String(participant.championId);
|
||||
const isOwner = participant.puuid === ownerParticipantId;
|
||||
return (
|
||||
<div
|
||||
key={`${participant.puuid}-${participant.championId}`}
|
||||
className="flex items-center gap-1 min-w-0"
|
||||
>
|
||||
<ChampionIcon
|
||||
championId={participant.championId}
|
||||
manifest={manifest}
|
||||
size="xs"
|
||||
className={
|
||||
isOwner ? "ring-1 ring-primary ring-inset" : undefined
|
||||
}
|
||||
/>
|
||||
<span
|
||||
className={`truncate ${
|
||||
isOwner
|
||||
? "font-bold text-base-content/80"
|
||||
: "text-base-content/40"
|
||||
}`}
|
||||
>
|
||||
{participant.gameName || championName}
|
||||
</span>
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
type MatchDetailScales = {
|
||||
maxDamage: number;
|
||||
};
|
||||
@@ -884,146 +835,56 @@ function RecentMatchCard({
|
||||
loss: "border-loss-line bg-loss-tint",
|
||||
remake: "border-line bg-card",
|
||||
}[outcome];
|
||||
const bar = { win: "bg-win", loss: "bg-loss", remake: "bg-content-disabled" }[
|
||||
outcome
|
||||
];
|
||||
const bar = { win: "bg-win", loss: "bg-loss", remake: "bg-content-disabled" }[outcome];
|
||||
const resultClass = {
|
||||
win: "text-win",
|
||||
loss: "text-loss",
|
||||
remake: "text-content-muted",
|
||||
}[outcome];
|
||||
const toggleSurface = {
|
||||
win: "lg:bg-win/15 lg:text-win",
|
||||
loss: "lg:bg-loss/15 lg:text-loss",
|
||||
remake: "lg:bg-sunken-strong",
|
||||
}[outcome];
|
||||
|
||||
return (
|
||||
<article
|
||||
className={`relative overflow-hidden rounded-box border ${surface}`}
|
||||
>
|
||||
<span aria-hidden="true" className={`absolute inset-y-0 left-0 w-1.5 ${bar}`} />
|
||||
<div className="grid items-center gap-3 py-3 pl-5 pr-3 lg:grid-cols-[112px_1fr_120px_1.5fr_36px] lg:pr-0">
|
||||
<div className="text-center lg:text-left">
|
||||
<div className={`text-sm font-extrabold ${resultClass}`}>
|
||||
{match.remake ? "다시하기" : match.win ? "승리" : "패배"}
|
||||
</div>
|
||||
<div className="text-xs font-bold text-base-content/45 mt-1">
|
||||
{match.queueLabel}
|
||||
</div>
|
||||
<div className="mt-1 text-xs text-base-content/25">
|
||||
{formatDate(match.gameCreation)}
|
||||
</div>
|
||||
<div className="text-xs text-base-content/25">
|
||||
{formatDuration(match.gameDuration)}
|
||||
</div>
|
||||
<article className={`relative overflow-hidden rounded-box border ${surface}`}>
|
||||
<span aria-hidden="true" className={`absolute inset-y-0 left-0 w-1 ${bar}`} />
|
||||
<div className="grid min-w-0 grid-cols-[minmax(0,1fr)_auto] items-center gap-x-3 gap-y-2 py-3 pl-4 pr-2 sm:grid-cols-[minmax(0,1fr)_auto_auto] sm:gap-x-5 sm:px-5">
|
||||
<div className="col-span-2 flex flex-wrap items-baseline gap-x-2 text-xs text-content-muted sm:col-span-3">
|
||||
<strong className={`text-sm ${resultClass}`}>{match.remake ? "다시하기" : match.win ? "승리" : "패배"}</strong>
|
||||
<span>{formatDate(match.gameCreation)} · {match.queueLabel}</span>
|
||||
</div>
|
||||
|
||||
<div className="flex items-center gap-2 min-w-0">
|
||||
<ChampionIcon
|
||||
championId={match.championId}
|
||||
manifest={manifest}
|
||||
size="lg"
|
||||
/>
|
||||
<LoadoutIcons
|
||||
summonerSpells={match.summonerSpells}
|
||||
perks={match.perks}
|
||||
manifest={manifest}
|
||||
/>
|
||||
<div className="flex min-w-0 items-center gap-2">
|
||||
<ChampionIcon championId={match.championId} manifest={manifest} />
|
||||
<div className="min-w-0">
|
||||
<div className="font-bold text-base-content truncate">
|
||||
{championName}
|
||||
</div>
|
||||
<div className="text-xs text-base-content/35">
|
||||
Lv.{match.championLevel} ·{" "}
|
||||
{(LANE_LABELS[match.teamPosition] ?? match.teamPosition) ||
|
||||
"포지션 없음"}
|
||||
<div className="truncate font-bold text-content" title={championName}>{championName}</div>
|
||||
<div className="text-xs text-content-muted">
|
||||
{LANE_LABELS[match.teamPosition] ?? (match.teamPosition || "포지션 미확인")}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="text-center">
|
||||
<div className="text-lg font-bold tabular-nums">
|
||||
<span>{match.kills}</span>
|
||||
<span className="text-base-content/25"> / </span>
|
||||
<span className="text-loss">{match.deaths}</span>
|
||||
<span className="text-base-content/25"> / </span>
|
||||
<span>{match.assists}</span>
|
||||
</div>
|
||||
<div
|
||||
className={`text-xs font-bold tabular-nums ${kdaClass(match.kda)}`}
|
||||
>
|
||||
{match.deaths === 0 ? "Perfect" : `${match.kda} KDA`}
|
||||
</div>
|
||||
<div className="mt-1 text-xs text-base-content/35">
|
||||
킬 관여 {match.killParticipation}%
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="grid sm:grid-cols-[100px_1fr] gap-3 items-center min-w-0">
|
||||
<div className="space-y-1 text-xs text-base-content/45">
|
||||
<div>
|
||||
CS{" "}
|
||||
<span className="font-bold text-base-content/70">
|
||||
{match.totalCs}
|
||||
</span>{" "}
|
||||
({match.csPerMin}/m)
|
||||
</div>
|
||||
<div>
|
||||
시야{" "}
|
||||
<span className="font-bold text-base-content/70">
|
||||
{match.visionScore}
|
||||
</span>{" "}
|
||||
제어와드 {match.controlWardsBought}
|
||||
</div>
|
||||
<div>
|
||||
피해량{" "}
|
||||
<span className="font-bold text-base-content/70">
|
||||
{match.damageDealtToChampions.toLocaleString()}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex items-start gap-3 min-w-0">
|
||||
<ItemGrid
|
||||
items={match.items}
|
||||
trinket={match.trinket}
|
||||
manifest={manifest}
|
||||
itemKey={match.matchId}
|
||||
/>
|
||||
<TeamMini
|
||||
match={match}
|
||||
manifest={manifest}
|
||||
ownerParticipantId={ownerParticipantId}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="flex justify-end lg:-my-3 lg:self-stretch">
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setExpanded((current) => !current)}
|
||||
className={`flex h-10 w-full items-center justify-center gap-1 rounded-field border border-line-strong bg-card text-content-muted transition-colors hover:text-content sm:w-auto sm:px-3 lg:h-full lg:w-9 lg:rounded-none lg:border-0 lg:px-0 ${toggleSurface}`}
|
||||
aria-expanded={expanded}
|
||||
aria-label={expanded ? "상세 전적 접기" : "상세 전적 펼치기"}
|
||||
>
|
||||
<span className="text-xs font-bold lg:hidden">
|
||||
{expanded ? "상세 접기" : "상세 보기"}
|
||||
</span>
|
||||
{expanded ? (
|
||||
<ChevronUp className="h-4 w-4" aria-hidden="true" />
|
||||
) : (
|
||||
<ChevronDown className="h-4 w-4" aria-hidden="true" />
|
||||
)}
|
||||
</button>
|
||||
<div className="tabular whitespace-nowrap text-right">
|
||||
<strong className="text-sm sm:text-base">{match.kills} / {match.deaths} / {match.assists}</strong>
|
||||
<div className="text-xs text-content-muted">{match.deaths === 0 ? "Perfect" : `${match.kda} KDA`}</div>
|
||||
</div>
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setExpanded((current) => !current)}
|
||||
className="col-span-2 flex min-h-9 items-center justify-end gap-1 rounded-field px-2 text-xs font-semibold text-content-muted hover:text-content focus-visible:-outline-offset-2 sm:col-span-1"
|
||||
aria-expanded={expanded}
|
||||
aria-label={expanded ? "상세 전적 접기" : "상세 전적 펼치기"}
|
||||
>
|
||||
{expanded ? "상세 접기" : "상세 보기"}
|
||||
{expanded ? <ChevronUp className="size-4" aria-hidden="true" /> : <ChevronDown className="size-4" aria-hidden="true" />}
|
||||
</button>
|
||||
</div>
|
||||
{expanded && (
|
||||
<div className="border-t border-line bg-card">
|
||||
<MatchDetailTabs
|
||||
match={match}
|
||||
manifest={manifest}
|
||||
ownerParticipantId={ownerParticipantId}
|
||||
/>
|
||||
<div className="flex flex-wrap items-center gap-x-4 gap-y-2 border-b border-line px-4 py-3 text-xs text-content-muted">
|
||||
<LoadoutIcons summonerSpells={match.summonerSpells} perks={match.perks} manifest={manifest} />
|
||||
<span>Lv.{match.championLevel} · {formatDuration(match.gameDuration)}</span>
|
||||
<span>킬 관여 {match.killParticipation}%</span>
|
||||
<span>CS {match.totalCs} ({match.csPerMin}/분)</span>
|
||||
<span>시야 {match.visionScore} · 제어와드 {match.controlWardsBought}</span>
|
||||
<span>챔피언 피해량 {match.damageDealtToChampions.toLocaleString()}</span>
|
||||
</div>
|
||||
<MatchDetailTabs match={match} manifest={manifest} ownerParticipantId={ownerParticipantId} />
|
||||
</div>
|
||||
)}
|
||||
</article>
|
||||
@@ -1036,45 +897,14 @@ function SkeletonBlock({ className = "" }: { className?: string }) {
|
||||
|
||||
function MatchCardSkeleton() {
|
||||
return (
|
||||
<article className="border border-l-4 border-l-base-content/10 border-base-content/10 bg-base-100">
|
||||
<div className="grid items-center gap-3 p-3 lg:grid-cols-[120px_1fr_120px_1.5fr_40px]">
|
||||
<div className="space-y-1.5">
|
||||
<SkeletonBlock className="h-3.5 w-12" />
|
||||
<SkeletonBlock className="h-2.5 w-16" />
|
||||
<SkeletonBlock className="h-2.5 w-20" />
|
||||
</div>
|
||||
<article className="space-y-2 rounded-box border border-line bg-card p-4">
|
||||
<SkeletonBlock className="h-3 w-32" />
|
||||
<div className="flex items-center justify-between gap-3">
|
||||
<div className="flex items-center gap-2">
|
||||
<SkeletonBlock className="h-12 w-12" />
|
||||
<div className="grid grid-cols-2 gap-0.5">
|
||||
{Array.from({ length: 4 }).map((_, index) => (
|
||||
<SkeletonBlock key={index} className="h-5 w-5" />
|
||||
))}
|
||||
</div>
|
||||
<div className="space-y-1.5">
|
||||
<SkeletonBlock className="h-3.5 w-24" />
|
||||
<SkeletonBlock className="h-2.5 w-16" />
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex flex-col items-center gap-1.5">
|
||||
<SkeletonBlock className="size-9 rounded-field" />
|
||||
<SkeletonBlock className="h-4 w-20" />
|
||||
<SkeletonBlock className="h-2.5 w-12" />
|
||||
</div>
|
||||
<div className="flex items-start gap-3">
|
||||
<div className="grid grid-cols-3 gap-1">
|
||||
{Array.from({ length: 6 }).map((_, index) => (
|
||||
<SkeletonBlock key={index} className="h-6 w-6" />
|
||||
))}
|
||||
</div>
|
||||
<SkeletonBlock className="h-6 w-6" />
|
||||
<div className="grid flex-1 grid-cols-2 gap-x-3 gap-y-1">
|
||||
{Array.from({ length: 10 }).map((_, index) => (
|
||||
<SkeletonBlock key={index} className="h-2.5 w-full" />
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
<div className="hidden justify-end lg:flex">
|
||||
<SkeletonBlock className="h-8 w-8" />
|
||||
</div>
|
||||
<SkeletonBlock className="h-4 w-16" />
|
||||
</div>
|
||||
</article>
|
||||
);
|
||||
@@ -1422,7 +1252,7 @@ export default function UserHistoryPage() {
|
||||
</div>
|
||||
))}
|
||||
|
||||
<div className="lts-panel sticky top-[60px] z-30 p-1">
|
||||
<div className="lts-panel sticky top-(--app-header-height) z-30 p-1">
|
||||
<div
|
||||
className="no-scrollbar flex gap-1 overflow-x-auto"
|
||||
role="tablist"
|
||||
@@ -1442,70 +1272,64 @@ export default function UserHistoryPage() {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="flex flex-wrap items-center justify-between gap-3">
|
||||
{!isInternalQueue ? (
|
||||
<div
|
||||
className="flex flex-wrap gap-1.5"
|
||||
role="group"
|
||||
aria-label="큐 종류"
|
||||
>
|
||||
{RANK_FILTER_TABS.map((tab) => (
|
||||
<Chip
|
||||
key={tab.value}
|
||||
selected={rank === tab.value}
|
||||
onClick={() =>
|
||||
updateSearch({ rank: tab.value, championId: null })
|
||||
}
|
||||
>
|
||||
{tab.label}
|
||||
</Chip>
|
||||
))}
|
||||
</div>
|
||||
) : (
|
||||
<p className="text-[13px] text-content-muted">
|
||||
토너먼트 코드로 수집한 내전 결과만 집계합니다.
|
||||
</p>
|
||||
)}
|
||||
<div className="flex flex-wrap items-center gap-2">
|
||||
{selectedChampionName && (
|
||||
<Chip
|
||||
selected
|
||||
onClick={() => updateSearch({ championId: null })}
|
||||
aria-label={`${selectedChampionName} 필터 해제`}
|
||||
>
|
||||
{selectedChampionName}
|
||||
<X className="size-3.5" aria-hidden="true" />
|
||||
</Chip>
|
||||
)}
|
||||
{profile.seasons.length > 0 && (
|
||||
<select
|
||||
aria-label="시즌"
|
||||
value={filters.seasonId ?? profile.season.id}
|
||||
onChange={(event) =>
|
||||
updateSearch({
|
||||
seasonId: event.target.value,
|
||||
championId: null,
|
||||
})
|
||||
}
|
||||
className="lts-select !w-auto"
|
||||
>
|
||||
{profile.seasons.map((season) => (
|
||||
<option key={season.id} value={season.id}>
|
||||
{season.label}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{profile.tierHistory.length > 0 && !isInternalQueue && (
|
||||
<Suspense fallback={<div className="lts-panel h-[180px]" />}>
|
||||
<TierHistoryChart entries={profile.tierHistory} />
|
||||
</Suspense>
|
||||
)}
|
||||
|
||||
<Panel>
|
||||
<div className="flex flex-wrap items-center justify-between gap-3 border-b border-line px-4 py-3 sm:px-5">
|
||||
{!isInternalQueue ? (
|
||||
<div
|
||||
className="flex flex-wrap gap-1.5"
|
||||
role="group"
|
||||
aria-label="큐 종류"
|
||||
>
|
||||
{RANK_FILTER_TABS.map((tab) => (
|
||||
<Chip
|
||||
key={tab.value}
|
||||
selected={rank === tab.value}
|
||||
onClick={() =>
|
||||
updateSearch({ rank: tab.value, championId: null })
|
||||
}
|
||||
>
|
||||
{tab.label}
|
||||
</Chip>
|
||||
))}
|
||||
</div>
|
||||
) : (
|
||||
<p className="text-[13px] text-content-muted">
|
||||
토너먼트 코드로 수집한 내전 결과만 집계합니다.
|
||||
</p>
|
||||
)}
|
||||
<div className="flex flex-wrap items-center gap-2">
|
||||
{selectedChampionName && (
|
||||
<Chip
|
||||
selected
|
||||
onClick={() => updateSearch({ championId: null })}
|
||||
aria-label={`${selectedChampionName} 필터 해제`}
|
||||
>
|
||||
{selectedChampionName}
|
||||
<X className="size-3.5" aria-hidden="true" />
|
||||
</Chip>
|
||||
)}
|
||||
{profile.seasons.length > 0 && (
|
||||
<select
|
||||
aria-label="시즌"
|
||||
value={filters.seasonId ?? profile.season.id}
|
||||
onChange={(event) =>
|
||||
updateSearch({
|
||||
seasonId: event.target.value,
|
||||
championId: null,
|
||||
})
|
||||
}
|
||||
className="lts-select !w-auto"
|
||||
>
|
||||
{profile.seasons.map((season) => (
|
||||
<option key={season.id} value={season.id}>
|
||||
{season.label}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<PanelHeader
|
||||
title={`최근 ${summary?.windowSize ?? 20}게임 요약`}
|
||||
description={
|
||||
@@ -1587,6 +1411,15 @@ export default function UserHistoryPage() {
|
||||
</div>
|
||||
</Panel>
|
||||
|
||||
{profile.tierHistory.length > 0 && !isInternalQueue && (
|
||||
<details className="lts-panel">
|
||||
<summary className="cursor-pointer px-4 py-3 text-sm font-semibold">티어 그래프</summary>
|
||||
<Suspense fallback={<div className="h-[180px]" />}>
|
||||
<TierHistoryChart entries={profile.tierHistory} />
|
||||
</Suspense>
|
||||
</details>
|
||||
)}
|
||||
|
||||
<div
|
||||
className="flex items-center gap-1.5"
|
||||
role="tablist"
|
||||
|
||||
Reference in new issue
Block a user