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
@@ -37,14 +37,14 @@ export function AdminPage({
|
||||
<PageBody width="xl">
|
||||
<nav
|
||||
aria-label="운영 메뉴"
|
||||
className="lts-panel no-scrollbar mb-5 flex gap-1 overflow-x-auto p-1"
|
||||
className="lts-panel mb-5 grid grid-cols-2 gap-1 p-1 sm:flex sm:flex-wrap"
|
||||
>
|
||||
{ADMIN_SECTIONS.map((section) => (
|
||||
<NavLink
|
||||
key={section.path}
|
||||
to={`/admin/communities/${communityId}/${section.path}`}
|
||||
className={({ isActive }) =>
|
||||
`flex h-10 shrink-0 items-center rounded-[10px] px-4 text-sm font-bold transition-colors ${
|
||||
`flex min-h-10 items-center justify-center rounded-[10px] px-2 py-2 text-center text-xs font-bold transition-colors sm:px-4 sm:text-sm ${
|
||||
isActive
|
||||
? "bg-secondary text-secondary-content dark:bg-white dark:text-[#14161b]"
|
||||
: "text-content-muted hover:bg-sunken hover:text-content"
|
||||
|
||||
@@ -16,9 +16,11 @@ import { SeriesScoreCard } from "./SeriesScoreCard";
|
||||
export function CompetitionResults({
|
||||
competition,
|
||||
view = "all",
|
||||
showTeamLink = true,
|
||||
}: {
|
||||
competition: CompetitionDetailResponse;
|
||||
view?: "all" | "bracket" | "games";
|
||||
showTeamLink?: boolean;
|
||||
}) {
|
||||
const { projection } = competition;
|
||||
const teamById = new Map(
|
||||
@@ -59,24 +61,18 @@ export function CompetitionResults({
|
||||
<section className="mb-6 space-y-4" aria-labelledby="competition-heading">
|
||||
<header className="flex flex-wrap items-end justify-between gap-3 border-b border-base-content/10 pb-3">
|
||||
<div>
|
||||
<p className="text-[11px] font-bold uppercase tracking-wider text-base-content/35">
|
||||
Competition
|
||||
</p>
|
||||
<h2 id="competition-heading" className="mt-1 text-lg font-bold">
|
||||
공식 경기 일정·결과
|
||||
대진표·순위
|
||||
</h2>
|
||||
</div>
|
||||
<div className="flex items-center gap-3">
|
||||
<span className="text-xs text-base-content/40">
|
||||
revision {competition.revision}
|
||||
</span>
|
||||
{showTeamLink && (
|
||||
<Link
|
||||
to={`/match/${competition.matchId}/team`}
|
||||
className="border border-base-content/10 px-2.5 py-1.5 text-xs font-bold text-base-content/55 hover:border-primary/30 hover:text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary"
|
||||
>
|
||||
팀 진행
|
||||
팀 경기 현황
|
||||
</Link>
|
||||
</div>
|
||||
)}
|
||||
</header>
|
||||
|
||||
{projection.outcome && (
|
||||
@@ -136,8 +132,8 @@ function GenericRoundGrid({
|
||||
teamById: Map<TeamId, CompetitionDetailResponse["teams"][number]>;
|
||||
}) {
|
||||
return (
|
||||
<div className="overflow-x-auto pb-2">
|
||||
<div className="grid min-w-max auto-cols-[17rem] grid-flow-col gap-4">
|
||||
<div className="pb-2 md:overflow-x-auto">
|
||||
<div className="grid gap-4 md:min-w-max md:auto-cols-[17rem] md:grid-flow-col">
|
||||
{rounds.map((round) => (
|
||||
<RoundColumn
|
||||
key={`${round.stage}:${round.roundNumber ?? 0}`}
|
||||
|
||||
@@ -23,6 +23,10 @@ export function DoubleEliminationMobileBracket({
|
||||
projection.series.map((series) => [series.seriesId, series]),
|
||||
);
|
||||
const nodeById = new Map(layout.nodes.map((node) => [node.seriesId, node]));
|
||||
const isCurrentRound = (seriesIds: readonly SeriesId[]) => seriesIds.some((seriesId) => {
|
||||
const status = seriesById.get(seriesId)?.status;
|
||||
return status === "ready" || status === "in-progress";
|
||||
});
|
||||
const sections = [
|
||||
{
|
||||
key: "upper",
|
||||
@@ -71,20 +75,20 @@ export function DoubleEliminationMobileBracket({
|
||||
{section.description}
|
||||
</p>
|
||||
</div>
|
||||
<div className="space-y-5">
|
||||
<div className="space-y-2">
|
||||
{groups.map((group) => (
|
||||
<section
|
||||
<details
|
||||
key={`${group.stage}:${group.roundNumber}`}
|
||||
aria-labelledby={`${bracketId}-${group.stage}-${group.roundNumber}`}
|
||||
open={groups.length === 1 || isCurrentRound(group.seriesIds)}
|
||||
className="group lts-panel"
|
||||
>
|
||||
<h4
|
||||
id={`${bracketId}-${group.stage}-${group.roundNumber}`}
|
||||
className="mb-2 text-xs font-bold text-content-muted"
|
||||
aria-label={group.accessibleLabel}
|
||||
<summary
|
||||
className="cursor-pointer px-3 py-3 text-sm font-semibold hover:bg-sunken"
|
||||
>
|
||||
{group.label}
|
||||
</h4>
|
||||
<div className="space-y-3">
|
||||
{group.accessibleLabel}
|
||||
<span className="ml-2 text-xs font-medium text-content-muted">{group.seriesIds.length}경기</span>
|
||||
</summary>
|
||||
<div className="space-y-3 border-t border-line p-3">
|
||||
{group.seriesIds.map((seriesId) => {
|
||||
const series = seriesById.get(seriesId);
|
||||
if (!series) return null;
|
||||
@@ -113,7 +117,7 @@ export function DoubleEliminationMobileBracket({
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
</section>
|
||||
</details>
|
||||
))}
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@@ -55,7 +55,7 @@ export function MatchDetailTabBar({
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="lts-panel sticky top-[60px] z-40 p-1">
|
||||
<div className="lts-panel sticky top-(--app-header-height) z-40 p-1">
|
||||
<div
|
||||
className="no-scrollbar flex gap-1 overflow-x-auto"
|
||||
role="tablist"
|
||||
|
||||
@@ -99,19 +99,10 @@ export function TeamTournamentCodes({
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<section
|
||||
className="border-t border-base-content/10"
|
||||
aria-label={`${seriesLabel} 토너먼트 코드`}
|
||||
>
|
||||
<div className="flex flex-wrap items-baseline justify-between gap-2 bg-base-200/25 px-4 py-2.5 sm:px-5">
|
||||
<h4 className="text-sm font-bold text-base-content">게임 코드</h4>
|
||||
<p className="text-xs text-content-muted">
|
||||
세트에 맞는 코드를 복사해 클라이언트에 입력하세요.
|
||||
</p>
|
||||
</div>
|
||||
<ol className="divide-y divide-base-content/10">
|
||||
{assignments.map((assignment) => {
|
||||
const nextAssignment = assignments.find((assignment) => assignment.state !== "used") ?? assignments[0];
|
||||
const otherAssignments = assignments.filter((assignment) => assignment !== nextAssignment);
|
||||
|
||||
function renderAssignment(assignment: TeamTournamentCodeView) {
|
||||
const slotId = String(assignment.gameSlotId);
|
||||
const presentation = getTournamentCodePresentation(assignment, now);
|
||||
const isCopying = copyingSlotId === slotId;
|
||||
@@ -127,7 +118,7 @@ export function TeamTournamentCodes({
|
||||
{assignment.ordinal}세트
|
||||
</p>
|
||||
<p className="mt-0.5 text-xs text-content-muted">
|
||||
전체 Game {assignment.displayNumber}
|
||||
전체 {assignment.displayNumber}경기
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -139,7 +130,7 @@ export function TeamTournamentCodes({
|
||||
/>
|
||||
) : (
|
||||
<p className="text-sm font-bold text-content-muted">
|
||||
발급 대기 중
|
||||
발급되면 이곳에서 복사할 수 있습니다.
|
||||
</p>
|
||||
)}
|
||||
{assignment.code &&
|
||||
@@ -199,8 +190,29 @@ export function TeamTournamentCodes({
|
||||
</div>
|
||||
</li>
|
||||
);
|
||||
})}
|
||||
}
|
||||
|
||||
return (
|
||||
<section
|
||||
className="border-t border-base-content/10 bg-sunken/50"
|
||||
aria-label={`${seriesLabel} 토너먼트 코드`}
|
||||
>
|
||||
<div className="px-4 pt-3 sm:px-5">
|
||||
<h4 className="text-sm font-bold text-base-content">토너먼트 코드</h4>
|
||||
</div>
|
||||
<ol>
|
||||
{renderAssignment(nextAssignment)}
|
||||
</ol>
|
||||
{otherAssignments.length > 0 && (
|
||||
<details className="border-t border-line">
|
||||
<summary className="cursor-pointer px-4 py-3 text-sm font-semibold hover:bg-sunken sm:px-5">
|
||||
다른 세트 코드 · {otherAssignments.length}개
|
||||
</summary>
|
||||
<ol className="divide-y divide-line border-t border-line">
|
||||
{otherAssignments.map(renderAssignment)}
|
||||
</ol>
|
||||
</details>
|
||||
)}
|
||||
|
||||
{feedback && (
|
||||
<p
|
||||
|
||||
Reference in new issue
Block a user