feat(web): refresh the app with Astryx and coral branding
This commit is contained in:
1 parent
f649490cd2
commit
da7b502936
140 files changed
+4531
-2368
No files matched your search
@@ -1 +0,0 @@
|
||||
/* App-specific styles — currently using Tailwind + daisyUI */
|
||||
+162
-58
@@ -1,10 +1,10 @@
|
||||
import { BrowserRouter, Link, Route, Routes } from "react-router";
|
||||
import { BrowserRouter, Link, NavLink, Route, Routes } from "react-router";
|
||||
import type { ReactNode } from "react";
|
||||
import { useMsal } from "@azure/msal-react";
|
||||
import { Moon, Sun } from "lucide-react";
|
||||
import { LogOut, Moon, Sun } from "lucide-react";
|
||||
import DevAuthSwitcher from "./components/DevAuthSwitcher";
|
||||
import { DEFAULT_COMMUNITY_ID, setTheme, useTheme } from "./config";
|
||||
import { useCommunity } from "./api/hooks";
|
||||
import { useCommunity, useMe } from "./api/hooks";
|
||||
import { isMsalConfigured } from "./lib/auth/msal.config";
|
||||
import AuthCallbackPage from "./pages/AuthCallback";
|
||||
import HomePage from "./pages/HomePage";
|
||||
@@ -20,6 +20,24 @@ import LegacyImportPage from "./pages/admin/LegacyImportPage";
|
||||
import LegacyMatchesPage from "./pages/admin/LegacyMatchesPage";
|
||||
import MatchAdminPage from "./pages/admin/MatchAdminPage";
|
||||
import TournamentCodesPage from "./pages/admin/TournamentCodesPage";
|
||||
import { PlainPage, Tooltip, pageWidthClass } from "./ui";
|
||||
|
||||
const NAV_ICON_BUTTON_CLASS =
|
||||
"grid size-9 place-items-center rounded-field text-on-ink-muted transition-colors hover:bg-white/10 hover:text-on-ink";
|
||||
|
||||
function BrandMark() {
|
||||
return (
|
||||
<svg viewBox="0 0 28 28" className="size-7 shrink-0" aria-hidden="true">
|
||||
<rect width="28" height="28" rx="8" fill="var(--color-brand-coral)" />
|
||||
<path
|
||||
d="M5.5 20.5 11 10l3.4 5.6L16.6 12l5.9 8.5Z"
|
||||
fill="#2a1704"
|
||||
strokeLinejoin="round"
|
||||
/>
|
||||
<circle cx="19.2" cy="8.4" r="1.9" fill="#2a1704" />
|
||||
</svg>
|
||||
);
|
||||
}
|
||||
|
||||
function MsalHeaderActions() {
|
||||
const { accounts, instance } = useMsal();
|
||||
@@ -28,7 +46,7 @@ function MsalHeaderActions() {
|
||||
if (!account) {
|
||||
return (
|
||||
<Link
|
||||
className="btn btn-ghost btn-sm px-2 text-base-content/60 hover:text-base-content"
|
||||
className="inline-flex h-9 items-center rounded-field bg-white/10 px-3.5 text-[13px] font-semibold text-on-ink transition-colors hover:bg-white/20"
|
||||
to="/login"
|
||||
>
|
||||
로그인
|
||||
@@ -36,15 +54,24 @@ function MsalHeaderActions() {
|
||||
);
|
||||
}
|
||||
|
||||
const name = account.name ?? account.username;
|
||||
|
||||
return (
|
||||
<button
|
||||
type="button"
|
||||
className="btn btn-ghost btn-sm px-3 max-w-[45vw] sm:max-w-none"
|
||||
onClick={() => void instance.logoutRedirect()}
|
||||
>
|
||||
<span className="truncate">{account.name ?? account.username}</span>
|
||||
<span className="hidden shrink-0 sm:inline">로그아웃</span>
|
||||
</button>
|
||||
<div className="flex min-w-0 items-center gap-1">
|
||||
<span className="hidden max-w-40 truncate text-[13px] font-medium text-on-ink-muted sm:block">
|
||||
{name}
|
||||
</span>
|
||||
<Tooltip content="로그아웃" placement="below">
|
||||
<button
|
||||
type="button"
|
||||
className={NAV_ICON_BUTTON_CLASS}
|
||||
aria-label={`${name} 로그아웃`}
|
||||
onClick={() => void instance.logoutRedirect()}
|
||||
>
|
||||
<LogOut className="size-4" aria-hidden="true" />
|
||||
</button>
|
||||
</Tooltip>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -56,32 +83,117 @@ function ThemeToggle() {
|
||||
const Icon = nextTheme === "dark" ? Moon : Sun;
|
||||
|
||||
return (
|
||||
<span className="tooltip tooltip-bottom" data-tip={label}>
|
||||
<Tooltip content={label} placement="below">
|
||||
<button
|
||||
type="button"
|
||||
className="btn btn-ghost btn-sm btn-square text-base-content/60 hover:text-base-content"
|
||||
className={NAV_ICON_BUTTON_CLASS}
|
||||
aria-label={label}
|
||||
onClick={() => setTheme(nextTheme)}
|
||||
>
|
||||
<Icon className="size-4" aria-hidden="true" />
|
||||
</button>
|
||||
</span>
|
||||
</Tooltip>
|
||||
);
|
||||
}
|
||||
|
||||
function PrimaryNavLink({
|
||||
to,
|
||||
end,
|
||||
children,
|
||||
}: {
|
||||
to: string;
|
||||
end?: boolean;
|
||||
children: ReactNode;
|
||||
}) {
|
||||
return (
|
||||
<NavLink
|
||||
to={to}
|
||||
end={end}
|
||||
className={({ isActive }) =>
|
||||
`relative inline-flex h-14 items-center px-3 text-sm font-semibold transition-colors ${
|
||||
isActive
|
||||
? "text-on-ink after:absolute after:inset-x-3 after:bottom-0 after:h-[3px] after:rounded-t-full after:bg-brand-coral"
|
||||
: "text-on-ink-muted hover:text-on-ink"
|
||||
}`
|
||||
}
|
||||
>
|
||||
{children}
|
||||
</NavLink>
|
||||
);
|
||||
}
|
||||
|
||||
function AppHeader() {
|
||||
const communityQuery = useCommunity(DEFAULT_COMMUNITY_ID);
|
||||
const meQuery = useMe();
|
||||
const communityLabel = communityQuery.data?.name ?? "LOLYMPUS";
|
||||
const role = meQuery.data?.memberships.find(
|
||||
(membership) => membership.community?._id === DEFAULT_COMMUNITY_ID,
|
||||
)?.user?.role;
|
||||
const canManage = role === "owner" || role === "admin";
|
||||
|
||||
return (
|
||||
<header className="sticky top-0 z-50 border-b border-ink-line bg-ink">
|
||||
<div
|
||||
className={`${pageWidthClass("xl")} flex h-14 items-center justify-between gap-3`}
|
||||
>
|
||||
<div className="flex min-w-0 items-center gap-2 sm:gap-5">
|
||||
<Link
|
||||
className="flex shrink-0 items-center gap-2.5 text-on-ink"
|
||||
to="/"
|
||||
aria-label={`${communityLabel} 홈`}
|
||||
>
|
||||
<BrandMark />
|
||||
<span className="hidden text-[17px] font-extrabold tracking-[-0.02em] sm:block">
|
||||
{communityLabel}
|
||||
</span>
|
||||
</Link>
|
||||
{DEFAULT_COMMUNITY_ID && (
|
||||
<nav aria-label="주 메뉴" className="flex items-center">
|
||||
<PrimaryNavLink to="/" end>
|
||||
내전
|
||||
</PrimaryNavLink>
|
||||
<PrimaryNavLink
|
||||
to={`/communities/${DEFAULT_COMMUNITY_ID}/internal-stats`}
|
||||
>
|
||||
전적
|
||||
</PrimaryNavLink>
|
||||
{canManage && (
|
||||
<PrimaryNavLink
|
||||
to={`/admin/communities/${DEFAULT_COMMUNITY_ID}/matches`}
|
||||
>
|
||||
운영
|
||||
</PrimaryNavLink>
|
||||
)}
|
||||
</nav>
|
||||
)}
|
||||
</div>
|
||||
<div className="flex shrink-0 items-center gap-1">
|
||||
<ThemeToggle />
|
||||
{isMsalConfigured && <MsalHeaderActions />}
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
);
|
||||
}
|
||||
|
||||
function AppFooter() {
|
||||
return (
|
||||
<footer className="border-t border-base-content/10 bg-base-100">
|
||||
<div className="max-w-5xl mx-auto px-4 sm:px-6 py-8 text-xs text-base-content/35">
|
||||
<nav className="flex items-center gap-4 mb-4 font-semibold text-base-content/45">
|
||||
<Link to="/terms" className="hover:text-base-content">
|
||||
<footer className="border-t border-line">
|
||||
<div
|
||||
className={`${pageWidthClass("xl")} flex flex-col gap-3 py-8 text-xs text-content-subtle`}
|
||||
>
|
||||
<nav
|
||||
aria-label="정책"
|
||||
className="flex items-center gap-4 font-semibold text-content-muted"
|
||||
>
|
||||
<Link to="/terms" className="hover:text-content">
|
||||
서비스 이용약관
|
||||
</Link>
|
||||
<Link to="/privacy" className="hover:text-base-content">
|
||||
<Link to="/privacy" className="hover:text-content">
|
||||
개인정보처리방침
|
||||
</Link>
|
||||
</nav>
|
||||
<p className="leading-relaxed max-w-4xl">
|
||||
<p className="max-w-4xl leading-relaxed">
|
||||
© 2026 LOLYMPUS. LOLYMPUS is not endorsed by Riot Games and does not
|
||||
reflect the views or opinions of Riot Games or anyone officially
|
||||
involved in producing or managing League of Legends. League of Legends
|
||||
@@ -101,51 +213,42 @@ function LegalPage({
|
||||
children: ReactNode;
|
||||
}) {
|
||||
return (
|
||||
<main className="max-w-3xl mx-auto px-4 sm:px-6 py-12">
|
||||
<Link
|
||||
to="/"
|
||||
className="inline-flex text-xs text-base-content/40 hover:text-base-content mb-5"
|
||||
>
|
||||
← 홈으로
|
||||
</Link>
|
||||
<h1 className="text-2xl font-black text-base-content">{title}</h1>
|
||||
<div className="mt-6 space-y-4 text-sm leading-7 text-base-content/60">
|
||||
<PlainPage width="md" className="py-12">
|
||||
<h1 className="text-2xl font-extrabold text-content">{title}</h1>
|
||||
<div className="lts-panel mt-6 space-y-4 p-6 text-sm leading-7 text-content-muted">
|
||||
{children}
|
||||
</div>
|
||||
</main>
|
||||
</PlainPage>
|
||||
);
|
||||
}
|
||||
|
||||
function NotFoundPage() {
|
||||
return (
|
||||
<PlainPage width="md" className="py-24 text-center">
|
||||
<p className="tabular text-5xl font-extrabold text-content-disabled">
|
||||
404
|
||||
</p>
|
||||
<h1 className="mt-4 text-xl font-bold text-content">
|
||||
페이지를 찾을 수 없습니다
|
||||
</h1>
|
||||
<p className="mt-2 text-sm text-content-muted">
|
||||
주소가 바뀌었거나 삭제된 내전일 수 있습니다.
|
||||
</p>
|
||||
<Link
|
||||
to="/"
|
||||
className="mt-6 inline-flex h-10 items-center rounded-field bg-primary px-5 text-sm font-bold text-primary-content"
|
||||
>
|
||||
내전 목록으로
|
||||
</Link>
|
||||
</PlainPage>
|
||||
);
|
||||
}
|
||||
|
||||
function App() {
|
||||
const communityQuery = useCommunity(DEFAULT_COMMUNITY_ID);
|
||||
const communityLabel = communityQuery.data?.name ?? "LOLYMPUS";
|
||||
|
||||
return (
|
||||
<BrowserRouter>
|
||||
<div className="min-h-screen bg-base-100 flex flex-col">
|
||||
<nav className="bg-base-100 border-b border-base-content/10 sticky top-0 z-50">
|
||||
<div className="max-w-5xl mx-auto px-4 sm:px-6 flex items-center justify-between h-12">
|
||||
<Link
|
||||
className="text-base font-bold tracking-tight text-base-content"
|
||||
to="/"
|
||||
>
|
||||
{communityLabel}
|
||||
</Link>
|
||||
<div className="flex items-center gap-3">
|
||||
{/* {DEFAULT_COMMUNITY_ID ? (
|
||||
<span className="text-xs uppercase tracking-wider text-base-content/25">
|
||||
API Live
|
||||
</span>
|
||||
) : (
|
||||
<span className="text-xs uppercase tracking-wider text-amber-500/70">
|
||||
Set `VITE_DEFAULT_COMMUNITY_ID`
|
||||
</span>
|
||||
)} */}
|
||||
<ThemeToggle />
|
||||
{isMsalConfigured && <MsalHeaderActions />}
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
<div className="flex min-h-screen flex-col bg-body">
|
||||
<AppHeader />
|
||||
|
||||
<div className="flex-1">
|
||||
<Routes>
|
||||
@@ -226,6 +329,7 @@ function App() {
|
||||
</LegalPage>
|
||||
}
|
||||
/>
|
||||
<Route path="*" element={<NotFoundPage />} />
|
||||
</Routes>
|
||||
</div>
|
||||
<AppFooter />
|
||||
|
||||
@@ -354,15 +354,15 @@ export function formatTierLabel(tier?: ApiTierInfo) {
|
||||
export function getTierColorToken(tier?: ApiTierInfo) {
|
||||
switch (tier?.tier) {
|
||||
case "CHALLENGER":
|
||||
return "text-amber-400";
|
||||
return "text-gold";
|
||||
case "GRANDMASTER":
|
||||
return "text-red-400";
|
||||
return "text-loss";
|
||||
case "MASTER":
|
||||
return "text-fuchsia-400";
|
||||
case "DIAMOND":
|
||||
return "text-cyan-400";
|
||||
case "EMERALD":
|
||||
return "text-emerald-400";
|
||||
return "text-leaf";
|
||||
case "PLATINUM":
|
||||
return "text-teal-300";
|
||||
case "GOLD":
|
||||
@@ -370,7 +370,7 @@ export function getTierColorToken(tier?: ApiTierInfo) {
|
||||
case "SILVER":
|
||||
return "text-gray-300";
|
||||
case "BRONZE":
|
||||
return "text-amber-700";
|
||||
return "text-gold";
|
||||
case "IRON":
|
||||
return "text-stone-400";
|
||||
default:
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
import type { ReactNode } from "react";
|
||||
import { NavLink } from "react-router";
|
||||
import { PageBody, PageHero } from "../ui";
|
||||
|
||||
const ADMIN_SECTIONS = [
|
||||
{ path: "matches", label: "내전 관리" },
|
||||
{ path: "tournament-codes", label: "토너먼트 코드" },
|
||||
{ path: "legacy-import", label: "과거 기록 가져오기" },
|
||||
{ path: "legacy-matches", label: "과거 기록 정리" },
|
||||
] as const;
|
||||
|
||||
/**
|
||||
* 운영 화면 공통 틀. 네 개의 운영 도구를 한 줄 탭으로 오갈 수 있게 한다.
|
||||
*/
|
||||
export function AdminPage({
|
||||
communityId,
|
||||
title,
|
||||
description,
|
||||
actions,
|
||||
children,
|
||||
}: {
|
||||
communityId: string;
|
||||
title: string;
|
||||
description?: string;
|
||||
actions?: ReactNode;
|
||||
children: ReactNode;
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<PageHero
|
||||
width="xl"
|
||||
eyebrow="운영"
|
||||
title={title}
|
||||
meta={description}
|
||||
actions={actions}
|
||||
/>
|
||||
<PageBody width="xl">
|
||||
<nav
|
||||
aria-label="운영 메뉴"
|
||||
className="lts-panel no-scrollbar mb-5 flex gap-1 overflow-x-auto p-1"
|
||||
>
|
||||
{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 ${
|
||||
isActive
|
||||
? "bg-secondary text-secondary-content dark:bg-white dark:text-[#14161b]"
|
||||
: "text-content-muted hover:bg-sunken hover:text-content"
|
||||
}`
|
||||
}
|
||||
>
|
||||
{section.label}
|
||||
</NavLink>
|
||||
))}
|
||||
</nav>
|
||||
{children}
|
||||
</PageBody>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
/** 운영 화면의 권한·설정 안내. */
|
||||
export function AdminNotice({
|
||||
title,
|
||||
children,
|
||||
}: {
|
||||
title: string;
|
||||
children?: ReactNode;
|
||||
}) {
|
||||
return (
|
||||
<main className="mx-auto w-full max-w-3xl px-4 py-16 sm:px-6">
|
||||
<div className="lts-panel px-6 py-10 text-center">
|
||||
<h1 className="text-lg font-bold text-content">{title}</h1>
|
||||
{children && (
|
||||
<div className="mt-2 text-sm text-content-muted">{children}</div>
|
||||
)}
|
||||
</div>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
import { useState } from 'react';
|
||||
import { useQueryClient } from '@tanstack/react-query';
|
||||
import { FlaskConical, X } from 'lucide-react';
|
||||
import { setAuthUserId, useAuthUserId } from '../config';
|
||||
import { Button } from '../ui';
|
||||
|
||||
export default function DevAuthSwitcher() {
|
||||
const authUserId = useAuthUserId();
|
||||
@@ -17,12 +19,16 @@ export default function DevAuthSwitcher() {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 개발 서버 전용 인증 전환기. 기본은 접힌 알약이라 화면을 가리지 않는다.
|
||||
*/
|
||||
function DevAuthSwitcherForm({
|
||||
authUserId,
|
||||
}: {
|
||||
authUserId: string | null;
|
||||
}) {
|
||||
const queryClient = useQueryClient();
|
||||
const [isOpen, setIsOpen] = useState(false);
|
||||
const [inputValue, setInputValue] = useState(authUserId ?? '');
|
||||
|
||||
function updateAuthUserId(nextValue: string | null) {
|
||||
@@ -30,37 +36,60 @@ function DevAuthSwitcherForm({
|
||||
void queryClient.invalidateQueries();
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="fixed right-4 bottom-4 z-50 w-72 border border-base-content/10 bg-base-100/95 backdrop-blur px-3 py-3 shadow-xl">
|
||||
<div className="text-xs font-bold uppercase tracking-wider text-base-content/35">
|
||||
if (!isOpen) {
|
||||
return (
|
||||
<button
|
||||
type="button"
|
||||
className="dev-auth-switcher fixed bottom-3 right-3 z-50 inline-flex h-8 items-center gap-1.5 rounded-full border border-line-strong bg-card px-3 text-xs font-semibold text-content-muted shadow-card hover:text-content"
|
||||
onClick={() => setIsOpen(true)}
|
||||
>
|
||||
<FlaskConical className="size-3.5" aria-hidden="true" />
|
||||
Dev Auth
|
||||
</div>
|
||||
<div className="mt-2 text-xs text-base-content/45">
|
||||
X-Auth-User-Id
|
||||
<span
|
||||
aria-hidden="true"
|
||||
className={`size-1.5 rounded-full ${authUserId ? 'bg-leaf' : 'bg-content-disabled'}`}
|
||||
/>
|
||||
</button>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="dev-auth-switcher lts-panel fixed bottom-3 right-3 z-50 w-72 p-3">
|
||||
<div className="flex items-center justify-between">
|
||||
<span className="text-xs font-bold text-content-muted">
|
||||
Dev Auth · X-Auth-User-Id
|
||||
</span>
|
||||
<button
|
||||
type="button"
|
||||
aria-label="닫기"
|
||||
className="grid size-6 place-items-center rounded-full text-content-subtle hover:bg-sunken hover:text-content"
|
||||
onClick={() => setIsOpen(false)}
|
||||
>
|
||||
<X className="size-3.5" aria-hidden="true" />
|
||||
</button>
|
||||
</div>
|
||||
<input
|
||||
value={inputValue}
|
||||
onChange={(event) => setInputValue(event.target.value)}
|
||||
placeholder="Mongo User ID"
|
||||
className="mt-1 w-full border border-base-content/10 bg-transparent px-2 py-2 text-xs text-base-content focus:outline-none focus:border-primary/30"
|
||||
aria-label="Mongo User ID"
|
||||
className="lts-input mt-2 text-xs"
|
||||
/>
|
||||
<div className="mt-2 flex items-center gap-2">
|
||||
<button
|
||||
type="button"
|
||||
className="btn btn-primary btn-xs px-3"
|
||||
<Button
|
||||
label="Set"
|
||||
size="sm"
|
||||
variant="primary"
|
||||
onClick={() => updateAuthUserId(inputValue)}
|
||||
>
|
||||
Set
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className="btn btn-ghost btn-xs px-3"
|
||||
/>
|
||||
<Button
|
||||
label="Clear"
|
||||
size="sm"
|
||||
variant="ghost"
|
||||
onClick={() => updateAuthUserId(null)}
|
||||
>
|
||||
Clear
|
||||
</button>
|
||||
/>
|
||||
</div>
|
||||
<div className="mt-2 text-xs text-base-content/35 break-all">
|
||||
<div className="mt-2 break-all text-xs text-content-subtle">
|
||||
현재값: {authUserId ?? '없음'}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -16,6 +16,7 @@ import {
|
||||
} from "../lib/internal-game-matchups";
|
||||
import { ItemIcon, RuneIcon, RuneStyleIcon } from "./ItemTooltip";
|
||||
|
||||
import { Tab, TabList } from "@astryxdesign/core/TabList";
|
||||
export type InternalGameDetailTab = "scoreboard" | "matchup" | "build";
|
||||
|
||||
type InternalGameDetail = ApiInternalMatchDetailResponse["games"][number];
|
||||
@@ -36,10 +37,10 @@ const SKILL_ROWS: Array<{
|
||||
label: string;
|
||||
className: string;
|
||||
}> = [
|
||||
{ slot: 1, label: "Q", className: "bg-blue-500 text-white" },
|
||||
{ slot: 1, label: "Q", className: "bg-win text-white" },
|
||||
{ slot: 2, label: "W", className: "bg-cyan-500 text-white" },
|
||||
{ slot: 3, label: "E", className: "bg-amber-500 text-black" },
|
||||
{ slot: 4, label: "R", className: "bg-red-500 text-white" },
|
||||
{ slot: 4, label: "R", className: "bg-loss text-white" },
|
||||
];
|
||||
|
||||
const STAT_PERK_LABELS: Record<number, string> = {
|
||||
@@ -71,16 +72,16 @@ function formatSignedNumber(value: number) {
|
||||
function sideTone(side: TeamSide) {
|
||||
return side === "blue"
|
||||
? {
|
||||
border: "border-blue-500/20",
|
||||
bg: "bg-blue-500/5",
|
||||
text: "text-blue-400",
|
||||
bar: "bg-blue-500",
|
||||
border: "border-win-line",
|
||||
bg: "bg-win-tint",
|
||||
text: "text-win",
|
||||
bar: "bg-win",
|
||||
}
|
||||
: {
|
||||
border: "border-red-500/20",
|
||||
bg: "bg-red-500/5",
|
||||
text: "text-red-400",
|
||||
bar: "bg-red-500",
|
||||
border: "border-loss-line",
|
||||
bg: "bg-loss-tint",
|
||||
text: "text-loss",
|
||||
bar: "bg-loss",
|
||||
};
|
||||
}
|
||||
|
||||
@@ -672,7 +673,7 @@ function MatchupMetricRow({
|
||||
<div className="grid grid-cols-[1fr_auto_1fr] items-center gap-2 px-3 py-1.5 text-xs">
|
||||
<span
|
||||
className={`text-right tabular-nums ${
|
||||
blueLead ? "font-bold text-blue-400" : "text-base-content/55"
|
||||
blueLead ? "font-bold text-win" : "text-base-content/55"
|
||||
}`}
|
||||
>
|
||||
{blueText}
|
||||
@@ -687,7 +688,7 @@ function MatchupMetricRow({
|
||||
</span>
|
||||
<span
|
||||
className={`tabular-nums ${
|
||||
redLead ? "font-bold text-red-400" : "text-base-content/55"
|
||||
redLead ? "font-bold text-loss" : "text-base-content/55"
|
||||
}`}
|
||||
>
|
||||
{redText}
|
||||
@@ -899,11 +900,11 @@ function LaneMatchupPanel({
|
||||
<section className="overflow-hidden border border-base-content/10 bg-base-100">
|
||||
<div className="border-b border-base-content/8 px-4 py-3">
|
||||
<div className="grid grid-cols-[1fr_auto_1fr] items-center gap-3 text-xs font-bold">
|
||||
<span className="truncate text-right text-blue-400">
|
||||
<span className="truncate text-right text-win">
|
||||
{blueTeamName}
|
||||
</span>
|
||||
<span className="text-base-content/20">VS</span>
|
||||
<span className="truncate text-red-400">{redTeamName}</span>
|
||||
<span className="truncate text-loss">{redTeamName}</span>
|
||||
</div>
|
||||
<div
|
||||
className="mx-auto mt-3 flex w-fit border border-base-content/10"
|
||||
@@ -959,28 +960,19 @@ export function InternalGameDetailTabBar({
|
||||
onChange: (tab: InternalGameDetailTab) => void;
|
||||
}) {
|
||||
return (
|
||||
<div
|
||||
className="flex flex-wrap border-b border-base-content/8"
|
||||
role="tablist"
|
||||
<TabList
|
||||
aria-label="상세 분석"
|
||||
value={activeTab}
|
||||
hasDivider
|
||||
onChange={(next) => {
|
||||
const tab = DETAIL_TABS.find((candidate) => candidate.id === next);
|
||||
if (tab) onChange(tab.id);
|
||||
}}
|
||||
>
|
||||
{DETAIL_TABS.map((tab) => (
|
||||
<button
|
||||
key={tab.id}
|
||||
type="button"
|
||||
role="tab"
|
||||
aria-selected={activeTab === tab.id}
|
||||
onClick={() => onChange(tab.id)}
|
||||
className={`border-b-2 px-3 py-2 text-xs font-semibold transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-primary ${
|
||||
activeTab === tab.id
|
||||
? "border-primary bg-primary/5 text-primary"
|
||||
: "border-transparent text-base-content/45 hover:text-base-content"
|
||||
}`}
|
||||
>
|
||||
{tab.label}
|
||||
</button>
|
||||
<Tab key={tab.id} value={tab.id} label={tab.label} />
|
||||
))}
|
||||
</div>
|
||||
</TabList>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import type { ApiTierInfo } from "../api/types";
|
||||
import { Tooltip } from "@astryxdesign/core/Tooltip";
|
||||
import { formatRankBadge, formatRankDetail } from "./rankBadgeUtils";
|
||||
|
||||
type RankBadgeSize = "sm" | "md";
|
||||
@@ -9,9 +10,12 @@ const SIZE_CLASSES: Record<RankBadgeSize, string> = {
|
||||
md: "h-[18px] min-w-[20px]",
|
||||
};
|
||||
|
||||
const TOOLTIP_CLASSES: Record<RankBadgeTooltipPlacement, string> = {
|
||||
left: "tooltip-left",
|
||||
bottom: "tooltip-bottom",
|
||||
const TOOLTIP_PLACEMENT: Record<
|
||||
RankBadgeTooltipPlacement,
|
||||
"start" | "below"
|
||||
> = {
|
||||
left: "start",
|
||||
bottom: "below",
|
||||
};
|
||||
|
||||
function rankBadgeClass(tier: ApiTierInfo | undefined) {
|
||||
@@ -53,17 +57,14 @@ export function RankBadge({
|
||||
const tooltip = formatRankDetail(tier);
|
||||
|
||||
return (
|
||||
<span
|
||||
className={`tooltip ${TOOLTIP_CLASSES[tooltipPlacement]}`}
|
||||
data-tip={tooltip}
|
||||
>
|
||||
<Tooltip content={tooltip} placement={TOOLTIP_PLACEMENT[tooltipPlacement]}>
|
||||
<span
|
||||
className={`inline-flex ${SIZE_CLASSES[size]} shrink-0 items-center justify-center whitespace-nowrap rounded-[3px] border px-1 text-xs font-black leading-none ${rankBadgeClass(tier)}`}
|
||||
className={`inline-flex ${SIZE_CLASSES[size]} shrink-0 items-center justify-center whitespace-nowrap rounded-[5px] border px-1 text-[11px] font-extrabold leading-none ${rankBadgeClass(tier)}`}
|
||||
aria-label={tooltip}
|
||||
>
|
||||
{formatRankBadge(tier)}
|
||||
</span>
|
||||
</span>
|
||||
</Tooltip>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -406,7 +406,7 @@ export default function TierHistoryChart({
|
||||
</button>
|
||||
))}
|
||||
<select
|
||||
className="h-7 border border-base-content/10 bg-base-100 px-2 text-xs text-base-content focus:border-primary/30 focus:outline-none"
|
||||
className="lts-select"
|
||||
value={period}
|
||||
onChange={(event) => {
|
||||
const nextPeriod = event.target.value as PeriodKey;
|
||||
@@ -526,13 +526,13 @@ export default function TierHistoryChart({
|
||||
r={3}
|
||||
stroke="currentColor"
|
||||
fill="currentColor"
|
||||
className="text-amber-400"
|
||||
className="text-gold"
|
||||
label={{
|
||||
value: formatTierCompactLabel(summary.peak),
|
||||
position: "top",
|
||||
fill: "currentColor",
|
||||
fontSize: 10,
|
||||
className: "text-amber-400",
|
||||
className: "text-gold",
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
@@ -544,7 +544,7 @@ export default function TierHistoryChart({
|
||||
fill="currentColor"
|
||||
className={
|
||||
isSamePoint(summary.peak, summary.last)
|
||||
? "text-amber-400"
|
||||
? "text-gold"
|
||||
: "text-primary"
|
||||
}
|
||||
label={{
|
||||
@@ -553,7 +553,7 @@ export default function TierHistoryChart({
|
||||
fill: "currentColor",
|
||||
fontSize: 10,
|
||||
className: isSamePoint(summary.peak, summary.last)
|
||||
? "text-amber-400"
|
||||
? "text-gold"
|
||||
: "text-primary",
|
||||
}}
|
||||
/>
|
||||
@@ -582,7 +582,7 @@ export default function TierHistoryChart({
|
||||
</span>
|
||||
<span className="text-base-content/45">
|
||||
최고{" "}
|
||||
<span className="font-bold text-amber-400">
|
||||
<span className="font-bold text-gold">
|
||||
{formatTierLabel(summary.peak)}
|
||||
</span>
|
||||
</span>
|
||||
@@ -591,9 +591,9 @@ export default function TierHistoryChart({
|
||||
<span
|
||||
className={`font-bold ${
|
||||
summary.direction === "up"
|
||||
? "text-green-500"
|
||||
? "text-leaf"
|
||||
: summary.direction === "down"
|
||||
? "text-red-400"
|
||||
? "text-loss"
|
||||
: "text-base-content/55"
|
||||
}`}
|
||||
>
|
||||
|
||||
@@ -16,6 +16,7 @@ import {
|
||||
} from "../../api/hooks";
|
||||
import { ApiError } from "../../lib/api";
|
||||
|
||||
import { Btn } from "../../ui/Btn";
|
||||
type AdjudicationType = SeriesAdjudicationDecision["type"];
|
||||
|
||||
const ADJUDICATION_LABELS: Record<AdjudicationType, string> = {
|
||||
@@ -312,7 +313,7 @@ export function CompetitionAdminControls({
|
||||
<label className="mt-4 block text-xs font-bold text-base-content/55">
|
||||
Series
|
||||
<select
|
||||
className="mt-1.5 h-10 w-full border border-base-content/15 bg-base-100 px-3 text-sm focus:border-warning/50 focus:outline-none"
|
||||
className="lts-select mt-1.5 w-full"
|
||||
value={effectiveSelectedSeriesId}
|
||||
disabled={commandPending}
|
||||
onChange={(event) => handleSelectedSeriesChange(event.target.value)}
|
||||
@@ -364,7 +365,7 @@ export function CompetitionAdminControls({
|
||||
<label className="text-xs font-bold text-base-content/50">
|
||||
판정 유형
|
||||
<select
|
||||
className="mt-1.5 h-10 w-full border border-base-content/15 bg-base-100 px-3 text-sm focus:border-warning/50 focus:outline-none"
|
||||
className="lts-select mt-1.5 w-full"
|
||||
value={effectiveAdjudicationType}
|
||||
disabled={adjudicationMutation.isPending}
|
||||
onChange={(event) => {
|
||||
@@ -395,7 +396,7 @@ export function CompetitionAdminControls({
|
||||
<label className="text-xs font-bold text-base-content/50">
|
||||
승리 팀
|
||||
<select
|
||||
className="mt-1.5 h-10 w-full border border-base-content/15 bg-base-100 px-3 text-sm focus:border-warning/50 focus:outline-none"
|
||||
className="lts-select mt-1.5 w-full"
|
||||
value={effectiveWinnerTeamId}
|
||||
disabled={adjudicationMutation.isPending}
|
||||
onChange={(event) => {
|
||||
@@ -419,7 +420,7 @@ export function CompetitionAdminControls({
|
||||
<label className="block text-xs font-bold text-base-content/50">
|
||||
판정 사유
|
||||
<textarea
|
||||
className="mt-1.5 min-h-24 w-full resize-y border border-base-content/15 bg-base-100 px-3 py-2 text-sm focus:border-warning/50 focus:outline-none"
|
||||
className="lts-textarea mt-1.5 min-h-24 w-full resize-y"
|
||||
maxLength={2000}
|
||||
value={adjudicationReason}
|
||||
disabled={adjudicationMutation.isPending}
|
||||
@@ -432,9 +433,9 @@ export function CompetitionAdminControls({
|
||||
required
|
||||
/>
|
||||
</label>
|
||||
<button
|
||||
<Btn
|
||||
type="submit"
|
||||
className="btn btn-warning btn-sm px-4 text-xs"
|
||||
variant="secondary"
|
||||
disabled={
|
||||
adjudicationMutation.isPending ||
|
||||
!adjudicationReason.trim() ||
|
||||
@@ -443,7 +444,7 @@ export function CompetitionAdminControls({
|
||||
}
|
||||
>
|
||||
{adjudicationMutation.isPending ? "기록 중..." : "판정 기록"}
|
||||
</button>
|
||||
</Btn>
|
||||
</form>
|
||||
) : canReverse && selectedSeries ? (
|
||||
<form className="mt-4 space-y-3" onSubmit={handlePreviewSubmit}>
|
||||
@@ -464,7 +465,7 @@ export function CompetitionAdminControls({
|
||||
<input
|
||||
type="radio"
|
||||
name="reversal-mode"
|
||||
className="radio radio-warning radio-xs mt-0.5"
|
||||
className="lts-checkbox mt-0.5"
|
||||
value={mode}
|
||||
checked={reversalMode === mode}
|
||||
disabled={
|
||||
@@ -495,7 +496,7 @@ export function CompetitionAdminControls({
|
||||
<label className="block text-xs font-bold text-base-content/50">
|
||||
되돌리기 사유
|
||||
<textarea
|
||||
className="mt-1.5 min-h-24 w-full resize-y border border-base-content/15 bg-base-100 px-3 py-2 text-sm focus:border-warning/50 focus:outline-none"
|
||||
className="lts-textarea mt-1.5 min-h-24 w-full resize-y"
|
||||
maxLength={2000}
|
||||
value={reversalReason}
|
||||
disabled={previewMutation.isPending || reversalMutation.isPending}
|
||||
@@ -511,9 +512,9 @@ export function CompetitionAdminControls({
|
||||
/>
|
||||
</label>
|
||||
|
||||
<button
|
||||
<Btn
|
||||
type="submit"
|
||||
className="btn btn-outline btn-sm px-4 text-xs"
|
||||
variant="secondary"
|
||||
disabled={
|
||||
previewMutation.isPending ||
|
||||
reversalMutation.isPending ||
|
||||
@@ -521,7 +522,7 @@ export function CompetitionAdminControls({
|
||||
}
|
||||
>
|
||||
{previewMutation.isPending ? "계산 중..." : "영향 미리보기"}
|
||||
</button>
|
||||
</Btn>
|
||||
|
||||
{reversalPreview && (
|
||||
<ReversalImpactPanel
|
||||
@@ -632,21 +633,20 @@ function ReversalImpactPanel({
|
||||
<label className="mt-3 flex items-start gap-2 text-xs text-base-content/60">
|
||||
<input
|
||||
type="checkbox"
|
||||
className="checkbox checkbox-error checkbox-xs mt-0.5"
|
||||
className="lts-checkbox mt-0.5"
|
||||
checked={confirmed}
|
||||
disabled={!previewIsCurrent || executing}
|
||||
onChange={(event) => onConfirmedChange(event.target.checked)}
|
||||
/>
|
||||
표시된 Series, 사실, 코드 및 통계 영향을 확인했습니다.
|
||||
</label>
|
||||
<button
|
||||
type="button"
|
||||
className="btn btn-error btn-sm mt-3 px-4 text-xs"
|
||||
<Btn
|
||||
variant="destructive" className="mt-3"
|
||||
disabled={!confirmed || !previewIsCurrent || executing}
|
||||
onClick={onExecute}
|
||||
>
|
||||
{executing ? "되돌리는 중..." : "Hash 확인 후 되돌리기"}
|
||||
</button>
|
||||
</Btn>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -55,9 +55,9 @@ export function MatchDetailTabBar({
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="sticky top-12 z-40 -mx-4 border-y border-base-content/10 bg-base-100/95 px-4 backdrop-blur sm:-mx-6 sm:px-6">
|
||||
<div className="lts-panel sticky top-[60px] z-40 p-1">
|
||||
<div
|
||||
className="flex overflow-x-auto"
|
||||
className="no-scrollbar flex gap-1 overflow-x-auto"
|
||||
role="tablist"
|
||||
aria-label="내전 상세"
|
||||
>
|
||||
@@ -77,10 +77,10 @@ export function MatchDetailTabBar({
|
||||
tabIndex={selected ? 0 : -1}
|
||||
onClick={() => onChange(tab.id)}
|
||||
onKeyDown={(event) => handleKeyDown(event, tab.id)}
|
||||
className={`min-h-11 flex-none whitespace-nowrap border-b-2 px-4 text-xs font-bold transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-primary ${
|
||||
className={`h-10 flex-none whitespace-nowrap rounded-[10px] px-4 text-sm font-bold transition-colors sm:px-5 ${
|
||||
selected
|
||||
? "border-primary bg-primary/5 text-base-content"
|
||||
: "border-transparent text-base-content/45 hover:bg-base-content/[0.03] hover:text-base-content"
|
||||
? "bg-secondary text-secondary-content dark:bg-white dark:text-[#14161b]"
|
||||
: "text-content-muted hover:bg-sunken hover:text-content"
|
||||
}`}
|
||||
>
|
||||
{tab.label}
|
||||
|
||||
@@ -251,7 +251,7 @@ function AutoSizingCodeField({
|
||||
<textarea
|
||||
ref={fieldRef}
|
||||
aria-label={label}
|
||||
className="block min-h-11 w-full resize-none overflow-hidden border border-base-content/15 bg-base-100 px-3 py-2 font-mono text-sm font-bold leading-5 text-base-content focus-visible:ring-2 focus-visible:ring-primary"
|
||||
className="lts-textarea min-h-11 w-full resize-none overflow-hidden font-mono font-bold leading-5"
|
||||
onClick={(event) => event.currentTarget.select()}
|
||||
onFocus={(event) => event.currentTarget.select()}
|
||||
readOnly
|
||||
|
||||
+353
-129
@@ -1,137 +1,384 @@
|
||||
@import url("https://fonts.googleapis.com/css2?family=Asta+Sans:wght@300..800&family=Gamja+Flower&display=swap");
|
||||
/*
|
||||
* LOLYMPUS 스타일 진입점.
|
||||
*
|
||||
* 레이어 순서(낮음 → 높음):
|
||||
* reset → theme → base → astryx-base → astryx-theme → lolympus → components → utilities
|
||||
*
|
||||
* Astryx(core + Neutral 테마)가 프리미티브의 모양을 맡고, `lolympus` 레이어가
|
||||
* Neutral 토큰을 LOLYMPUS 팔레트로 덮는다. Tailwind 유틸리티는 아래 @theme 매핑을
|
||||
* 통해 같은 토큰을 읽으므로 라이트/다크 전환은 토큰 한 곳에서만 일어난다.
|
||||
*/
|
||||
@layer reset, theme, base, astryx-base, astryx-theme, lolympus, components, utilities;
|
||||
|
||||
@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.min.css");
|
||||
|
||||
@import "tailwindcss/theme.css" layer(theme);
|
||||
@import "tailwindcss/preflight.css" layer(base);
|
||||
@import "@astryxdesign/core/reset.css";
|
||||
@import "@astryxdesign/core/astryx.css";
|
||||
@import "@astryxdesign/theme-neutral/theme.css";
|
||||
@import "tailwindcss/utilities.css" layer(utilities);
|
||||
|
||||
@import "tailwindcss";
|
||||
@custom-variant dark (&:where([data-theme=dark], [data-theme=dark] *));
|
||||
@plugin "daisyui" {
|
||||
themes:
|
||||
light --default,
|
||||
dark;
|
||||
}
|
||||
|
||||
/* ── 브랜드 원색 ──
|
||||
실제 색상값은 이곳에서만 관리하고, 화면에서는 아래의 의미 토큰을 사용한다. */
|
||||
/* ── 원색 ──
|
||||
실제 색상값은 이곳에서만 관리한다. 화면은 아래 역할 토큰을 쓴다. */
|
||||
@theme static {
|
||||
--color-brand-coral: oklch(0.708008 0.234375 24);
|
||||
--color-brand-violet: oklch(0.481934 0.285938 285);
|
||||
--color-brand-gold: oklch(0.853027 0.2 90);
|
||||
--color-brand-cyan: oklch(70% 0.14523 200);
|
||||
--color-brand-coral: oklch(70.8008% .234375 24);
|
||||
--color-brand-ink: #22252e;
|
||||
--color-brand-gold: #f2b01e;
|
||||
--color-brand-leaf: #2f9e58;
|
||||
}
|
||||
|
||||
html {
|
||||
scrollbar-gutter: stable;
|
||||
@layer lolympus {
|
||||
:root,
|
||||
[data-astryx-theme="neutral"] {
|
||||
/* 글자 */
|
||||
--font-family-body:
|
||||
"Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
|
||||
system-ui, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic",
|
||||
sans-serif;
|
||||
--font-family-heading: var(--font-family-body);
|
||||
|
||||
/* 모서리: 카드는 넉넉하게, 조작 요소는 한 단계 작게 */
|
||||
--radius-inner: 0.375rem;
|
||||
--radius-element: 0.5rem;
|
||||
--radius-container: 0.875rem;
|
||||
--radius-page: 1.25rem;
|
||||
|
||||
/* 표면 */
|
||||
--color-background-body: light-dark(#f1f2f6, #14161b);
|
||||
--color-background-card: light-dark(#ffffff, #1e2129);
|
||||
--color-background-surface: light-dark(#ffffff, #1e2129);
|
||||
--color-background-popover: light-dark(#ffffff, #272b35);
|
||||
--color-background-muted: light-dark(#f4f5f8, #262a33);
|
||||
|
||||
/* 글자·선 */
|
||||
--color-text-primary: light-dark(#1b1e26, #f1f2f5);
|
||||
--color-text-secondary: light-dark(#5a6170, #a4abb8);
|
||||
--color-text-disabled: light-dark(#a6acb8, #5d6471);
|
||||
--color-icon-primary: var(--color-text-primary);
|
||||
--color-icon-secondary: var(--color-text-secondary);
|
||||
--color-border: light-dark(#1b1e2614, #ffffff17);
|
||||
--color-border-emphasized: light-dark(#d3d7df, #414653);
|
||||
|
||||
/* 주 액션: 브랜드 코랄 위에 짙은 글자 */
|
||||
--color-accent: var(--color-brand-coral);
|
||||
--color-on-accent: light-dark(#2a1704, #1f1203);
|
||||
--color-accent-muted: light-dark(
|
||||
color-mix(in oklab, var(--color-brand-coral) 18%, white),
|
||||
color-mix(in oklab, var(--color-brand-coral) 25%, var(--color-background-body))
|
||||
);
|
||||
--color-text-accent: light-dark(
|
||||
color-mix(in oklab, var(--color-brand-coral) 75%, black),
|
||||
color-mix(in oklab, var(--color-brand-coral) 78%, white)
|
||||
);
|
||||
--color-icon-accent: var(--color-text-accent);
|
||||
|
||||
/* ── LOLYMPUS 전용 역할 ── */
|
||||
/* 상단 내비게이션과 페이지 머리 띠. 두 테마 모두 짙은 잉크색이다. */
|
||||
--lts-ink: light-dark(var(--color-brand-ink), #0e1014);
|
||||
--lts-ink-raised: light-dark(#2e323d, #1a1d24);
|
||||
--lts-ink-line: #ffffff1f;
|
||||
--lts-on-ink: #f4f5f7;
|
||||
--lts-on-ink-muted: #b3b9c6;
|
||||
|
||||
/* 들어간 표면(표 머리, 통계 칸, 입력 배경) */
|
||||
--lts-sunken: light-dark(#f6f7f9, #181b21);
|
||||
--lts-sunken-strong: light-dark(#eceef2, #2b2f39);
|
||||
--lts-text-tertiary: light-dark(#7d8493, #848b99);
|
||||
|
||||
/* 경기 결과와 진영 */
|
||||
--lts-win: light-dark(#2c6be0, #7fabff);
|
||||
--lts-win-fill: light-dark(#4d8bf5, #4d8bf5);
|
||||
--lts-win-tint: light-dark(#eaf1ff, #1c2a47);
|
||||
--lts-win-line: light-dark(#c9dbfb, #2f4470);
|
||||
--lts-loss: light-dark(#d93a4d, #ff8c97);
|
||||
--lts-loss-fill: light-dark(#ec5567, #ec5567);
|
||||
--lts-loss-tint: light-dark(#ffeef0, #40212a);
|
||||
--lts-loss-line: light-dark(#f8cfd5, #6a3140);
|
||||
--lts-gold: light-dark(#a86a00, #f5c451);
|
||||
--lts-gold-fill: var(--color-brand-gold);
|
||||
--lts-gold-tint: light-dark(#fff5d9, #3d3113);
|
||||
--lts-leaf: light-dark(#23804a, #74d199);
|
||||
--lts-leaf-fill: light-dark(var(--color-brand-leaf), #3bb56d);
|
||||
--lts-leaf-tint: light-dark(#e6f6ec, #17352a);
|
||||
|
||||
--lts-shadow-card:
|
||||
0 1px 2px light-dark(#1b1e260a, #00000040),
|
||||
0 2px 8px light-dark(#1b1e260a, #00000033);
|
||||
}
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
font-family:
|
||||
"Asta Sans",
|
||||
-apple-system,
|
||||
BlinkMacSystemFont,
|
||||
system-ui,
|
||||
Roboto,
|
||||
"Helvetica Neue",
|
||||
"Segoe UI",
|
||||
"Apple SD Gothic Neo",
|
||||
"Noto Sans KR",
|
||||
"Malgun Gothic",
|
||||
"Apple Color Emoji",
|
||||
"Segoe UI Emoji",
|
||||
"Segoe UI Symbol",
|
||||
sans-serif;
|
||||
font-size: 15px;
|
||||
line-height: 1.55;
|
||||
@layer base {
|
||||
html {
|
||||
scrollbar-gutter: stable;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
background: var(--color-background-body);
|
||||
color: var(--color-text-primary);
|
||||
font-family: var(--font-family-body);
|
||||
font-size: 15px;
|
||||
line-height: 1.55;
|
||||
font-feature-settings: "ss06";
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
}
|
||||
|
||||
/* ── 가독성 개선: 의미 기반 텍스트 대비 토큰 ──
|
||||
폰트 크기는 표준 스케일 토큰(text-xs=12px / text-sm=14px …)을 사용한다.
|
||||
새 코드에서는 text-content-subtle/muted/disabled를 우선 사용한다. */
|
||||
:root,
|
||||
[data-theme="light"] {
|
||||
--lts-text-subtle-strength: 66%;
|
||||
--lts-text-muted-strength: 72%;
|
||||
--lts-text-disabled-strength: 50%;
|
||||
--lts-content-subtle: color-mix(
|
||||
in oklab,
|
||||
var(--color-base-content) var(--lts-text-subtle-strength),
|
||||
transparent
|
||||
);
|
||||
--lts-content-muted: color-mix(
|
||||
in oklab,
|
||||
var(--color-base-content) var(--lts-text-muted-strength),
|
||||
transparent
|
||||
);
|
||||
--lts-content-disabled: color-mix(
|
||||
in oklab,
|
||||
var(--color-base-content) var(--lts-text-disabled-strength),
|
||||
transparent
|
||||
);
|
||||
}
|
||||
@layer lolympus {
|
||||
/* Neutral의 prose 초기화는 h/p에 크기·색을 직접 지정한다. 화면 마크업은
|
||||
부모에게서 상속받는 것을 전제로 작성했으므로 상속으로 되돌린다.
|
||||
Astryx의 Heading/Text는 자체 클래스로 모양을 정하므로 영향이 없다. */
|
||||
:where(h1, h2, h3, h4, h5, h6, p, small) {
|
||||
font-family: inherit;
|
||||
font-size: inherit;
|
||||
font-weight: inherit;
|
||||
line-height: inherit;
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
[data-theme="dark"] {
|
||||
--lts-text-subtle-strength: 66%;
|
||||
--lts-text-muted-strength: 76%;
|
||||
--lts-text-disabled-strength: 52%;
|
||||
/* 테두리를 두른 상자·칩의 기본 모서리. rounded-* 유틸리티가 항상 이긴다. */
|
||||
:where(
|
||||
div,
|
||||
section,
|
||||
article,
|
||||
aside,
|
||||
li,
|
||||
ul,
|
||||
a,
|
||||
form,
|
||||
label,
|
||||
details,
|
||||
summary,
|
||||
span,
|
||||
button,
|
||||
img
|
||||
).border {
|
||||
border-radius: var(--radius-element);
|
||||
}
|
||||
|
||||
:where(button, [role="button"]) {
|
||||
border-radius: var(--radius-element);
|
||||
}
|
||||
|
||||
/* 챔피언·아이템·프로필 그림과 그 틀은 살짝 둥글린다. */
|
||||
:where(img) {
|
||||
border-radius: var(--radius-inner);
|
||||
}
|
||||
:where(div, span).overflow-hidden:has(> img:only-child) {
|
||||
border-radius: var(--radius-inner);
|
||||
}
|
||||
|
||||
:focus-visible {
|
||||
outline: 2px solid var(--color-text-accent);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
}
|
||||
|
||||
/* ── Tailwind 유틸리티 ↔ 토큰 매핑 ──
|
||||
base-100·primary 같은 이름은 기존 마크업과의 호환을 위해 유지한다. 새 코드는
|
||||
card / sunken / ink / win / loss 같은 역할 이름을 쓴다. */
|
||||
@theme inline {
|
||||
--color-content-subtle: var(--lts-content-subtle);
|
||||
--color-content-muted: var(--lts-content-muted);
|
||||
--color-content-disabled: var(--lts-content-disabled);
|
||||
--color-bracket-winner: var(--color-brand-coral);
|
||||
--font-sans: var(--font-family-body);
|
||||
|
||||
--color-base-100: var(--color-background-card);
|
||||
--color-base-200: var(--lts-sunken);
|
||||
--color-base-300: var(--lts-sunken-strong);
|
||||
--color-base-content: var(--color-text-primary);
|
||||
|
||||
--color-body: var(--color-background-body);
|
||||
--color-card: var(--color-background-card);
|
||||
--color-sunken: var(--lts-sunken);
|
||||
--color-sunken-strong: var(--lts-sunken-strong);
|
||||
--color-line: var(--color-border);
|
||||
--color-line-strong: var(--color-border-emphasized);
|
||||
|
||||
--color-content: var(--color-text-primary);
|
||||
--color-content-muted: var(--color-text-secondary);
|
||||
--color-content-subtle: var(--lts-text-tertiary);
|
||||
--color-content-disabled: var(--color-text-disabled);
|
||||
|
||||
--color-ink: var(--lts-ink);
|
||||
--color-ink-raised: var(--lts-ink-raised);
|
||||
--color-ink-line: var(--lts-ink-line);
|
||||
--color-on-ink: var(--lts-on-ink);
|
||||
--color-on-ink-muted: var(--lts-on-ink-muted);
|
||||
|
||||
/* primary: 채움은 브랜드 코랄, 글자·선은 테마에 맞춘 코랄 */
|
||||
--color-primary: var(--color-accent);
|
||||
--text-color-primary: var(--color-text-accent);
|
||||
--text-decoration-color-primary: var(--color-text-accent);
|
||||
--color-primary-content: var(--color-on-accent);
|
||||
--color-primary-tint: var(--color-accent-muted);
|
||||
|
||||
--color-secondary: var(--lts-ink);
|
||||
--color-secondary-content: var(--lts-on-ink);
|
||||
--text-color-secondary: var(--color-text-secondary);
|
||||
|
||||
--color-accent: var(--lts-gold-fill);
|
||||
--text-color-accent: var(--lts-gold);
|
||||
--color-accent-content: #2a1f04;
|
||||
|
||||
--color-win: var(--lts-win-fill);
|
||||
--text-color-win: var(--lts-win);
|
||||
--color-win-tint: var(--lts-win-tint);
|
||||
--color-win-line: var(--lts-win-line);
|
||||
--color-loss: var(--lts-loss-fill);
|
||||
--text-color-loss: var(--lts-loss);
|
||||
--color-loss-tint: var(--lts-loss-tint);
|
||||
--color-loss-line: var(--lts-loss-line);
|
||||
--color-gold: var(--lts-gold-fill);
|
||||
--text-color-gold: var(--lts-gold);
|
||||
--color-gold-tint: var(--lts-gold-tint);
|
||||
--color-leaf: var(--lts-leaf-fill);
|
||||
--text-color-leaf: var(--lts-leaf);
|
||||
--color-leaf-tint: var(--lts-leaf-tint);
|
||||
|
||||
--color-info: var(--lts-win-fill);
|
||||
--text-color-info: var(--lts-win);
|
||||
--color-info-content: #ffffff;
|
||||
--color-success: var(--lts-leaf-fill);
|
||||
--text-color-success: var(--lts-leaf);
|
||||
--color-success-content: #ffffff;
|
||||
--color-warning: var(--lts-gold-fill);
|
||||
--text-color-warning: var(--lts-gold);
|
||||
--color-warning-content: #2a1f04;
|
||||
--color-error: var(--lts-loss-fill);
|
||||
--text-color-error: var(--lts-loss);
|
||||
--color-error-content: #ffffff;
|
||||
|
||||
--color-bracket-winner: var(--color-text-accent);
|
||||
|
||||
--radius-box: var(--radius-container);
|
||||
--radius-field: var(--radius-element);
|
||||
--shadow-card: var(--lts-shadow-card);
|
||||
}
|
||||
|
||||
@layer utilities {
|
||||
/* 기존 text-base-content/nn 알파 클래스 호환 shim.
|
||||
hover/focus 상태 유틸이 specificity로 이길 수 있도록 !important를 쓰지 않는다. */
|
||||
/* 낮은 알파의 본문색 글자는 대비가 무너진다. 3단 역할색으로 올려 붙인다.
|
||||
hover/focus 유틸이 specificity로 이길 수 있도록 !important를 쓰지 않는다. */
|
||||
.text-base-content\/15,
|
||||
.text-base-content\/20,
|
||||
.text-base-content\/25,
|
||||
.text-base-content\/30,
|
||||
.text-base-content\/35 {
|
||||
color: var(--lts-content-subtle);
|
||||
}
|
||||
|
||||
.text-base-content\/35,
|
||||
.text-base-content\/40,
|
||||
.text-base-content\/45,
|
||||
.text-base-content\/45 {
|
||||
color: var(--lts-text-tertiary);
|
||||
}
|
||||
|
||||
.text-base-content\/50,
|
||||
.text-base-content\/55 {
|
||||
color: var(--lts-content-muted);
|
||||
.text-base-content\/55,
|
||||
.text-base-content\/60,
|
||||
.text-base-content\/65,
|
||||
.text-base-content\/70 {
|
||||
color: var(--color-text-secondary);
|
||||
}
|
||||
|
||||
.tabular {
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
|
||||
/* 이전/다음 조작이 따로 있는 가로 스크롤 띠에서 스크롤바를 숨긴다. */
|
||||
.no-scrollbar {
|
||||
scrollbar-width: none;
|
||||
}
|
||||
.no-scrollbar::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
/* ── 라이트 테마 의미 색상 ── */
|
||||
[data-theme="light"] {
|
||||
/* ── 포인트 4색 (primary 주 액션 / secondary 강조 / accent 하이라이트 / info 정보·보조) ── */
|
||||
@layer components {
|
||||
/* 흰 카드. 페이지의 기본 데이터 그릇이다. */
|
||||
.lts-panel {
|
||||
background: var(--color-background-card);
|
||||
border: 1px solid var(--color-border);
|
||||
border-radius: var(--radius-container);
|
||||
box-shadow: var(--lts-shadow-card);
|
||||
}
|
||||
|
||||
/* 코랄레드 — primary 117곳 즉시 반영 */
|
||||
--color-primary: var(--color-brand-coral);
|
||||
--color-primary-content: oklch(98% 0 0); /* 흰 글자 */
|
||||
/* 표: 머리는 들어간 표면, 행은 선 하나로만 나눈다. */
|
||||
.lts-table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
font-size: 0.875rem;
|
||||
}
|
||||
.lts-table thead th {
|
||||
background: var(--lts-sunken);
|
||||
color: var(--lts-text-tertiary);
|
||||
font-size: 0.75rem;
|
||||
font-weight: 600;
|
||||
text-align: left;
|
||||
padding: 0.5rem 0.75rem;
|
||||
white-space: nowrap;
|
||||
border-bottom: 1px solid var(--color-border);
|
||||
}
|
||||
.lts-table tbody td {
|
||||
padding: 0.625rem 0.75rem;
|
||||
border-bottom: 1px solid var(--color-border);
|
||||
}
|
||||
.lts-table tbody tr:last-child td {
|
||||
border-bottom: 0;
|
||||
}
|
||||
|
||||
/* 바이올렛 — 버튼·뱃지·보더용 */
|
||||
--color-secondary: var(--color-brand-violet);
|
||||
--color-secondary-content: oklch(98% 0 0); /* 흰 글자 */
|
||||
|
||||
/* 골드 — 배경·보더·아이콘만. 텍스트색(text-accent)으론 쓰지 말 것 */
|
||||
--color-accent: var(--color-brand-gold);
|
||||
--color-accent-content: oklch(22% 0.03 80); /* 어두운 글자 */
|
||||
|
||||
/* 시안 — 정보·링크·보조 강조. L70이라 흰배경 텍스트는 약함 → 배경/보더 위주 */
|
||||
--color-info: var(--color-brand-cyan);
|
||||
--color-info-content: oklch(24% 0.03 215); /* 어두운 글자 */
|
||||
|
||||
/* 텍스트 기본 진하기 (회색 알파의 기준색). 낮출수록 전체가 진해짐 */
|
||||
--color-base-content: oklch(21% 0.006 285.885);
|
||||
|
||||
/* 표면 톤 */
|
||||
--color-base-100: oklch(100% 0 0); /* 페이지/카드 배경 */
|
||||
--color-base-200: oklch(98% 0 0); /* 살짝 들어간 표면 */
|
||||
--color-base-300: oklch(95% 0 0); /* 구분선/보더 */
|
||||
}
|
||||
|
||||
/* 경기 결과 기록의 링크 강조는 양쪽 테마에서 같은 브랜드 코랄을 쓴다.
|
||||
전역 dark primary는 유지해 다른 화면의 기존 색상 의미를 바꾸지 않는다. */
|
||||
.competition-series-history {
|
||||
--color-primary: var(--color-brand-coral);
|
||||
/* 네이티브 입력. 옵션이 많은 운영 폼은 네이티브 조작을 유지하고 모양만 맞춘다. */
|
||||
.lts-input,
|
||||
.lts-select,
|
||||
.lts-textarea {
|
||||
width: 100%;
|
||||
min-height: 2.25rem;
|
||||
padding: 0.375rem 0.75rem;
|
||||
background: var(--color-background-card);
|
||||
color: var(--color-text-primary);
|
||||
border: 1px solid var(--color-border-emphasized);
|
||||
border-radius: var(--radius-element);
|
||||
font-size: 0.875rem;
|
||||
line-height: 1.4;
|
||||
transition:
|
||||
border-color 120ms,
|
||||
box-shadow 120ms;
|
||||
}
|
||||
.lts-input::placeholder,
|
||||
.lts-textarea::placeholder {
|
||||
color: var(--color-text-disabled);
|
||||
}
|
||||
.lts-input:hover,
|
||||
.lts-select:hover,
|
||||
.lts-textarea:hover {
|
||||
border-color: var(--lts-text-tertiary);
|
||||
}
|
||||
.lts-input:focus-visible,
|
||||
.lts-select:focus-visible,
|
||||
.lts-textarea:focus-visible {
|
||||
outline: none;
|
||||
border-color: var(--color-text-accent);
|
||||
box-shadow: 0 0 0 3px var(--color-accent-muted);
|
||||
}
|
||||
.lts-input:disabled,
|
||||
.lts-select:disabled,
|
||||
.lts-textarea:disabled {
|
||||
background: var(--lts-sunken);
|
||||
color: var(--color-text-disabled);
|
||||
cursor: not-allowed;
|
||||
}
|
||||
.lts-select {
|
||||
appearance: none;
|
||||
padding-right: 2rem;
|
||||
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237d8493' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
|
||||
background-repeat: no-repeat;
|
||||
background-position: right 0.625rem center;
|
||||
}
|
||||
.lts-textarea {
|
||||
min-height: 5rem;
|
||||
resize: vertical;
|
||||
}
|
||||
.lts-checkbox {
|
||||
width: 1rem;
|
||||
height: 1rem;
|
||||
accent-color: var(--color-text-accent);
|
||||
}
|
||||
}
|
||||
|
||||
/* ── 실시간 입찰 피드백 모션 ──
|
||||
@@ -178,26 +425,3 @@ body {
|
||||
animation: none;
|
||||
}
|
||||
}
|
||||
|
||||
/* poro.gg style: 모든 모서리 각지게 */
|
||||
*,
|
||||
*::before,
|
||||
*::after {
|
||||
border-radius: 0 !important;
|
||||
}
|
||||
|
||||
/* daisyUI badge만 살짝 둥글게 (pill 형태) */
|
||||
.badge {
|
||||
border-radius: 2px !important;
|
||||
}
|
||||
|
||||
/* 버튼도 각지게 */
|
||||
.btn {
|
||||
border-radius: 0 !important;
|
||||
}
|
||||
|
||||
/* daisyUI 버튼의 흰색 inset 하이라이트 제거 — 색 위에 흰색을 6% 얹어
|
||||
채도를 깎던 주범(P3/쨍한 색일수록 도드라짐). drop shadow(입체감)는 유지. */
|
||||
.btn {
|
||||
box-shadow: var(--btn-shadow) !important;
|
||||
}
|
||||
+41
-16
@@ -23,30 +23,55 @@ export const positionIcon: Record<Position, string> = {
|
||||
SUP: supportIcon,
|
||||
};
|
||||
|
||||
// 팀 식별색. 8팀 대회까지 서로 다른 색을 쓰고 그 이상은 순환한다.
|
||||
const TEAM_TONES = [
|
||||
{
|
||||
border: 'border-blue-500/20',
|
||||
bg: 'bg-blue-500/5',
|
||||
text: 'text-blue-400',
|
||||
bar: 'bg-blue-500',
|
||||
border: "border-blue-500/30",
|
||||
bg: "bg-blue-500/8",
|
||||
text: "text-blue-600 dark:text-blue-300",
|
||||
bar: "bg-blue-500",
|
||||
},
|
||||
{
|
||||
border: 'border-red-500/20',
|
||||
bg: 'bg-red-500/5',
|
||||
text: 'text-red-400',
|
||||
bar: 'bg-red-500',
|
||||
border: "border-red-500/30",
|
||||
bg: "bg-red-500/8",
|
||||
text: "text-red-600 dark:text-red-300",
|
||||
bar: "bg-red-500",
|
||||
},
|
||||
{
|
||||
border: 'border-emerald-500/20',
|
||||
bg: 'bg-emerald-500/5',
|
||||
text: 'text-emerald-400',
|
||||
bar: 'bg-emerald-500',
|
||||
border: "border-emerald-500/30",
|
||||
bg: "bg-emerald-500/8",
|
||||
text: "text-emerald-600 dark:text-emerald-300",
|
||||
bar: "bg-emerald-500",
|
||||
},
|
||||
{
|
||||
border: 'border-amber-500/20',
|
||||
bg: 'bg-amber-500/5',
|
||||
text: 'text-amber-400',
|
||||
bar: 'bg-amber-500',
|
||||
border: "border-amber-500/30",
|
||||
bg: "bg-amber-500/8",
|
||||
text: "text-amber-700 dark:text-amber-300",
|
||||
bar: "bg-amber-500",
|
||||
},
|
||||
{
|
||||
border: "border-violet-500/30",
|
||||
bg: "bg-violet-500/8",
|
||||
text: "text-violet-600 dark:text-violet-300",
|
||||
bar: "bg-violet-500",
|
||||
},
|
||||
{
|
||||
border: "border-cyan-500/30",
|
||||
bg: "bg-cyan-500/8",
|
||||
text: "text-cyan-600 dark:text-cyan-300",
|
||||
bar: "bg-cyan-500",
|
||||
},
|
||||
{
|
||||
border: "border-pink-500/30",
|
||||
bg: "bg-pink-500/8",
|
||||
text: "text-pink-600 dark:text-pink-300",
|
||||
bar: "bg-pink-500",
|
||||
},
|
||||
{
|
||||
border: "border-lime-500/30",
|
||||
bg: "bg-lime-500/8",
|
||||
text: "text-lime-700 dark:text-lime-300",
|
||||
bar: "bg-lime-500",
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ import './index.css';
|
||||
import App from './App.tsx';
|
||||
import { MsalAppProvider } from './lib/auth/MsalAppProvider.tsx';
|
||||
import { initializeTheme } from './config.ts';
|
||||
import { AppTheme } from './ui/AppTheme.tsx';
|
||||
|
||||
initializeNewRelicBrowserAgent();
|
||||
initializeTheme();
|
||||
@@ -24,7 +25,9 @@ createRoot(document.getElementById('root')!).render(
|
||||
<StrictMode>
|
||||
<MsalAppProvider>
|
||||
<QueryClientProvider client={queryClient}>
|
||||
<App />
|
||||
<AppTheme>
|
||||
<App />
|
||||
</AppTheme>
|
||||
</QueryClientProvider>
|
||||
</MsalAppProvider>
|
||||
</StrictMode>,
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
import { Button } from "@astryxdesign/core/Button";
|
||||
import { Tab, TabList } from "@astryxdesign/core/TabList";
|
||||
import { useId, type ButtonHTMLAttributes, type ReactNode } from "react";
|
||||
|
||||
export function AuctionAstryxTabs<T extends string>({
|
||||
label,
|
||||
value,
|
||||
onChange,
|
||||
tabs,
|
||||
panelClassName,
|
||||
children,
|
||||
}: {
|
||||
label: string;
|
||||
value: T;
|
||||
onChange: (value: T) => void;
|
||||
tabs: readonly { value: T; label: string; count?: number }[];
|
||||
panelClassName: string;
|
||||
children: ReactNode;
|
||||
}) {
|
||||
const id = useId();
|
||||
|
||||
return (
|
||||
<>
|
||||
<TabList
|
||||
className="auction-astryx-tabs"
|
||||
role="tablist"
|
||||
aria-label={label}
|
||||
size="md"
|
||||
hasDivider
|
||||
value={value}
|
||||
onChange={(next) => {
|
||||
const tab = tabs.find((tab) => tab.value === next);
|
||||
if (tab) onChange(tab.value);
|
||||
}}
|
||||
>
|
||||
{tabs.map((tab) => (
|
||||
<Tab
|
||||
key={tab.value}
|
||||
id={`${id}-${tab.value}-tab`}
|
||||
panelId={`${id}-${tab.value}-panel`}
|
||||
value={tab.value}
|
||||
label={tab.label}
|
||||
endContent={
|
||||
tab.count === undefined ? undefined : (
|
||||
<span className="auction-tab-count">{tab.count}</span>
|
||||
)
|
||||
}
|
||||
/>
|
||||
))}
|
||||
</TabList>
|
||||
{tabs.map((tab) => (
|
||||
<div
|
||||
key={tab.value}
|
||||
role="tabpanel"
|
||||
id={`${id}-${tab.value}-panel`}
|
||||
aria-labelledby={`${id}-${tab.value}-tab`}
|
||||
hidden={tab.value !== value}
|
||||
tabIndex={0}
|
||||
className={tab.value === value ? panelClassName : undefined}
|
||||
>
|
||||
{tab.value === value && children}
|
||||
</div>
|
||||
))}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
export function AuctionAction({
|
||||
variant = "primary",
|
||||
icon,
|
||||
type = "button",
|
||||
disabled,
|
||||
onClick,
|
||||
title,
|
||||
children,
|
||||
}: Pick<
|
||||
ButtonHTMLAttributes<HTMLButtonElement>,
|
||||
"type" | "className" | "disabled" | "onClick" | "title"
|
||||
> & {
|
||||
variant?: "primary" | "secondary" | "destructive";
|
||||
icon?: ReactNode;
|
||||
children: string;
|
||||
}) {
|
||||
return (
|
||||
<Button
|
||||
variant={variant}
|
||||
size="md"
|
||||
type={type}
|
||||
isDisabled={disabled}
|
||||
onClick={onClick}
|
||||
tooltip={title}
|
||||
icon={icon}
|
||||
label={children}
|
||||
width={type === "submit" ? "100%" : undefined}
|
||||
/>
|
||||
);
|
||||
}
|
||||
+445
-321
File diff suppressed because it is too large.
Load diff
@@ -1,5 +1,6 @@
|
||||
import { useEffect } from 'react';
|
||||
import { useNavigate } from 'react-router';
|
||||
import { LoadingNote, PlainPage } from '../ui';
|
||||
|
||||
export default function AuthCallbackPage() {
|
||||
const navigate = useNavigate();
|
||||
@@ -10,8 +11,8 @@ export default function AuthCallbackPage() {
|
||||
}, [navigate]);
|
||||
|
||||
return (
|
||||
<main className="max-w-5xl mx-auto px-4 sm:px-6 py-20 text-center">
|
||||
<span className="text-sm text-base-content/45">로그인 처리 중...</span>
|
||||
</main>
|
||||
<PlainPage>
|
||||
<LoadingNote label="로그인 처리 중" />
|
||||
</PlainPage>
|
||||
);
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
import { ChevronRight } from 'lucide-react';
|
||||
import { Link, useLocation, useSearchParams } from 'react-router';
|
||||
import {
|
||||
useCommunity,
|
||||
@@ -10,39 +11,48 @@ import type {
|
||||
ApiInternalMatchCard,
|
||||
ApiLeaderHighlight,
|
||||
ApiLeaderboardRow,
|
||||
TeamSide,
|
||||
} from '../api/types';
|
||||
import { DEFAULT_COMMUNITY_ID } from '../config';
|
||||
import { championDisplayName, championIconUrl, profileIconUrl } from '../lib/ddragon';
|
||||
import { sideShortLabel, teamIndexColorClasses, teamIndexLabel } from '../lib/league';
|
||||
import { teamIndexColorClasses, teamIndexLabel } from '../lib/league';
|
||||
import {
|
||||
Btn,
|
||||
Chip,
|
||||
EmptyNote,
|
||||
ErrorNote,
|
||||
LoadingNote,
|
||||
MetaDot,
|
||||
PageBody,
|
||||
PageHero,
|
||||
Panel,
|
||||
PanelHeader,
|
||||
Pill,
|
||||
PlainPage,
|
||||
Skeleton,
|
||||
} from '../ui';
|
||||
|
||||
type Manifest = ReturnType<typeof useDdragonManifest>['data'];
|
||||
|
||||
function formatDateTime(value: string) {
|
||||
return new Intl.DateTimeFormat('ko-KR', {
|
||||
month: 'long',
|
||||
day: 'numeric',
|
||||
weekday: 'short',
|
||||
hour: '2-digit',
|
||||
minute: '2-digit',
|
||||
}).format(new Date(value));
|
||||
}
|
||||
|
||||
function formatDuration(seconds: number) {
|
||||
const minutes = Math.floor(seconds / 60);
|
||||
const rest = seconds % 60;
|
||||
return `${minutes}:${String(rest).padStart(2, '0')}`;
|
||||
}
|
||||
|
||||
function sideLabel(side: TeamSide) {
|
||||
return sideShortLabel(side);
|
||||
}
|
||||
|
||||
function sideText(side: TeamSide) {
|
||||
return side === 'blue' ? 'text-blue-400' : 'text-red-400';
|
||||
}
|
||||
|
||||
function ratioClass(value: number) {
|
||||
if (value >= 55) return 'text-blue-400';
|
||||
if (value >= 50) return 'text-amber-400';
|
||||
return 'text-base-content/45';
|
||||
if (value >= 60) return 'text-loss';
|
||||
if (value >= 50) return 'text-win';
|
||||
return 'text-content-muted';
|
||||
}
|
||||
|
||||
function kdaClass(value: number) {
|
||||
if (value >= 5) return 'text-gold';
|
||||
if (value >= 3) return 'text-leaf';
|
||||
return 'text-content-muted';
|
||||
}
|
||||
|
||||
function ChampionChip({
|
||||
@@ -50,143 +60,233 @@ function ChampionChip({
|
||||
manifest,
|
||||
}: {
|
||||
championId: number;
|
||||
manifest: ReturnType<typeof useDdragonManifest>['data'];
|
||||
manifest: Manifest;
|
||||
}) {
|
||||
const icon = championIconUrl(manifest, championId);
|
||||
const name = championDisplayName(manifest, championId) ?? String(championId);
|
||||
return (
|
||||
<span className="inline-flex items-center gap-1.5">
|
||||
<span className="w-5 h-5 bg-base-content/10 overflow-hidden">
|
||||
{icon ? <img src={icon} alt="" className="w-full h-full object-cover" /> : null}
|
||||
</span>
|
||||
<span>{name}</span>
|
||||
<span
|
||||
className="size-7 overflow-hidden rounded-full bg-sunken-strong"
|
||||
title={name}
|
||||
>
|
||||
{icon ? (
|
||||
<img
|
||||
src={icon}
|
||||
alt={name}
|
||||
className="size-full scale-[1.15] object-cover"
|
||||
loading="lazy"
|
||||
/>
|
||||
) : null}
|
||||
</span>
|
||||
);
|
||||
}
|
||||
|
||||
function AvatarStack({
|
||||
members,
|
||||
manifest,
|
||||
}: {
|
||||
members: ApiInternalMatchCard['teams'][number]['members'];
|
||||
manifest: Manifest;
|
||||
}) {
|
||||
return (
|
||||
<span className="flex shrink-0 -space-x-1.5">
|
||||
{members.slice(0, 5).map((member) => (
|
||||
<img
|
||||
key={member.userId}
|
||||
src={profileIconUrl(manifest, member.profileIconId)}
|
||||
alt=""
|
||||
title={member.summonerName}
|
||||
className="size-6 rounded-full bg-sunken-strong object-cover ring-2 ring-card"
|
||||
loading="lazy"
|
||||
/>
|
||||
))}
|
||||
</span>
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 내전 한 건. 두 팀 내전이면 시리즈 점수를, 여러 팀 대회면 우승 팀과
|
||||
* 규모를 보여 준다. 대회의 첫 시리즈 점수를 대회 점수처럼 보이게 하지 않는다.
|
||||
*/
|
||||
function MatchCard({
|
||||
match,
|
||||
manifest,
|
||||
}: {
|
||||
match: ApiInternalMatchCard;
|
||||
manifest: ReturnType<typeof useDdragonManifest>['data'];
|
||||
manifest: Manifest;
|
||||
}) {
|
||||
const primarySeries = match.seriesResults[0];
|
||||
const isHeadToHead = match.teams.length === 2;
|
||||
const series = isHeadToHead ? match.seriesResults[0] : undefined;
|
||||
const winnerTeam = match.teams.find(
|
||||
(team) => team.teamIndex === match.winnerTeamIndex,
|
||||
);
|
||||
const teamName = (teamIndex: number) =>
|
||||
teamIndexLabel(
|
||||
teamIndex,
|
||||
match.teams.find((team) => team.teamIndex === teamIndex)?.name,
|
||||
);
|
||||
const finishedGames = match.games.filter(
|
||||
(game) => game.winnerTeamIndex !== null,
|
||||
).length;
|
||||
|
||||
return (
|
||||
<Link
|
||||
to={`/communities/${DEFAULT_COMMUNITY_ID}/internal-stats/match/${match.matchId}`}
|
||||
className="block group"
|
||||
>
|
||||
<article className="border border-base-content/10 bg-base-100 hover:border-primary/25 transition-colors">
|
||||
<div className="p-4 grid lg:grid-cols-[1fr_auto_1fr] gap-4 items-center">
|
||||
<div className="min-w-0">
|
||||
<div className="text-xs text-base-content/35">
|
||||
{formatDateTime(match.scheduledAt)}
|
||||
</div>
|
||||
<h3 className="mt-1 text-base font-black text-base-content truncate group-hover:text-primary">
|
||||
{match.title}
|
||||
</h3>
|
||||
<div className="mt-2 flex flex-wrap gap-1.5">
|
||||
{match.games.map((game) => (
|
||||
<span
|
||||
key={game.gameNumber}
|
||||
className="inline-flex items-center gap-1 border border-base-content/10 px-2 py-1 text-xs text-base-content/45"
|
||||
>
|
||||
{game.gameNumber}경기
|
||||
{game.winnerSide && game.winnerTeamIndex ? (
|
||||
<span className={sideText(game.winnerSide)}>
|
||||
{teamName(game.winnerTeamIndex)} 승 ({sideLabel(game.winnerSide)})
|
||||
</span>
|
||||
) : (
|
||||
'대기'
|
||||
)}
|
||||
<span>{formatDuration(game.gameDuration)}</span>
|
||||
</span>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="text-center px-8">
|
||||
{primarySeries && (
|
||||
<div className="flex items-center justify-center gap-5">
|
||||
<div className={primarySeries.winnerTeamIndex === primarySeries.teamAIndex ? teamIndexColorClasses(primarySeries.teamAIndex).text : 'text-base-content/30'}>
|
||||
<div className="text-4xl font-black tabular-nums">{primarySeries.teamAWins}</div>
|
||||
<div className="text-xs font-bold uppercase tracking-wider">
|
||||
{teamName(primarySeries.teamAIndex)}
|
||||
</div>
|
||||
</div>
|
||||
<div className="text-base-content/15 text-xs font-black">VS</div>
|
||||
<div className={primarySeries.winnerTeamIndex === primarySeries.teamBIndex ? teamIndexColorClasses(primarySeries.teamBIndex).text : 'text-base-content/30'}>
|
||||
<div className="text-4xl font-black tabular-nums">{primarySeries.teamBWins}</div>
|
||||
<div className="text-xs font-bold uppercase tracking-wider">
|
||||
{teamName(primarySeries.teamBIndex)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<li>
|
||||
<Link
|
||||
to={`/communities/${DEFAULT_COMMUNITY_ID}/internal-stats/match/${match.matchId}`}
|
||||
className="group grid gap-x-6 gap-y-3 px-4 py-4 transition-colors hover:bg-sunken sm:px-5 lg:grid-cols-[minmax(0,1fr)_minmax(0,1.3fr)_20px] lg:items-center"
|
||||
>
|
||||
<div className="min-w-0">
|
||||
<div className="flex flex-wrap items-center gap-2 text-xs text-content-subtle">
|
||||
<span className="tabular">{formatDateTime(match.scheduledAt)}</span>
|
||||
{match.status === 'in-progress' && (
|
||||
<Pill tone="accent" dot pulse>
|
||||
진행중
|
||||
</Pill>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div className="grid sm:grid-cols-2 gap-2">
|
||||
{match.teams.map((team) => (
|
||||
<div
|
||||
key={team.teamIndex}
|
||||
className={`border ${teamIndexColorClasses(team.teamIndex).border} p-2`}
|
||||
>
|
||||
<div className={`text-xs font-black uppercase tracking-wider ${teamIndexColorClasses(team.teamIndex).text}`}>
|
||||
{team.name}
|
||||
</div>
|
||||
<div className="mt-2 space-y-1">
|
||||
{team.members.slice(0, 5).map((member) => (
|
||||
<div key={member.userId} className="flex items-center gap-1.5 min-w-0">
|
||||
<span className="w-5 h-5 bg-base-content/10 overflow-hidden shrink-0">
|
||||
<img
|
||||
src={profileIconUrl(manifest, member.profileIconId)}
|
||||
alt=""
|
||||
className="w-full h-full object-cover"
|
||||
loading="lazy"
|
||||
/>
|
||||
</span>
|
||||
<span className="text-xs truncate text-base-content/65">
|
||||
{member.summonerName}
|
||||
</span>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
<h3 className="mt-1 truncate text-base font-bold text-content group-hover:text-primary">
|
||||
{match.title}
|
||||
</h3>
|
||||
<p className="mt-1 flex flex-wrap items-center gap-2 text-[13px] text-content-muted">
|
||||
<span>{match.teams.length}팀</span>
|
||||
<MetaDot />
|
||||
<span className="tabular">
|
||||
{finishedGames === match.gameCount
|
||||
? `${match.gameCount}경기`
|
||||
: `${finishedGames}/${match.gameCount}경기 완료`}
|
||||
</span>
|
||||
</p>
|
||||
</div>
|
||||
</article>
|
||||
</Link>
|
||||
|
||||
{series ? (
|
||||
<div className="grid grid-cols-[minmax(0,1fr)_auto_minmax(0,1fr)] items-center gap-3">
|
||||
{[series.teamAIndex, series.teamBIndex].map((teamIndex, side) => {
|
||||
const team = match.teams.find(
|
||||
(candidate) => candidate.teamIndex === teamIndex,
|
||||
);
|
||||
const won = series.winnerTeamIndex === teamIndex;
|
||||
return (
|
||||
<div
|
||||
key={teamIndex}
|
||||
className={`flex min-w-0 items-center gap-2 ${
|
||||
side === 0
|
||||
? 'order-1 flex-row-reverse text-right'
|
||||
: 'order-3'
|
||||
}`}
|
||||
>
|
||||
{team && (
|
||||
<AvatarStack members={team.members} manifest={manifest} />
|
||||
)}
|
||||
<span
|
||||
className={`truncate text-sm ${
|
||||
won
|
||||
? 'font-bold text-content'
|
||||
: 'font-medium text-content-muted'
|
||||
}`}
|
||||
>
|
||||
{teamName(teamIndex)}
|
||||
</span>
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
<div className="tabular order-2 flex items-baseline gap-1.5 rounded-field bg-sunken px-3 py-1 text-xl font-extrabold">
|
||||
<span
|
||||
className={
|
||||
series.winnerTeamIndex === series.teamAIndex
|
||||
? 'text-content'
|
||||
: 'text-content-subtle'
|
||||
}
|
||||
>
|
||||
{series.teamAWins}
|
||||
</span>
|
||||
<span className="text-sm text-content-disabled">:</span>
|
||||
<span
|
||||
className={
|
||||
series.winnerTeamIndex === series.teamBIndex
|
||||
? 'text-content'
|
||||
: 'text-content-subtle'
|
||||
}
|
||||
>
|
||||
{series.teamBWins}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
) : (
|
||||
<div className="flex flex-wrap items-center gap-x-4 gap-y-2">
|
||||
{winnerTeam ? (
|
||||
<div className="flex items-center gap-2">
|
||||
<Pill tone="gold">우승</Pill>
|
||||
<AvatarStack members={winnerTeam.members} manifest={manifest} />
|
||||
<span className="text-sm font-bold text-content">
|
||||
{winnerTeam.name}
|
||||
</span>
|
||||
</div>
|
||||
) : (
|
||||
<span className="text-[13px] text-content-muted">
|
||||
우승 팀 미정
|
||||
</span>
|
||||
)}
|
||||
<div className="flex flex-wrap gap-1.5">
|
||||
{match.teams
|
||||
.filter((team) => team.teamIndex !== winnerTeam?.teamIndex)
|
||||
.slice(0, 7)
|
||||
.map((team) => (
|
||||
<span
|
||||
key={team.teamIndex}
|
||||
className={`inline-flex h-6 max-w-28 items-center rounded-full border px-2 text-xs font-medium ${teamIndexColorClasses(team.teamIndex).border} ${teamIndexColorClasses(team.teamIndex).text}`}
|
||||
>
|
||||
<span className="truncate">{team.name}</span>
|
||||
</span>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<ChevronRight
|
||||
className="hidden size-5 text-content-disabled group-hover:text-primary lg:block"
|
||||
aria-hidden="true"
|
||||
/>
|
||||
</Link>
|
||||
</li>
|
||||
);
|
||||
}
|
||||
|
||||
function HighlightCard({
|
||||
function HighlightCell({
|
||||
title,
|
||||
highlight,
|
||||
suffix = '',
|
||||
isLoading,
|
||||
}: {
|
||||
title: string;
|
||||
highlight: ApiLeaderHighlight | null | undefined;
|
||||
suffix?: string;
|
||||
isLoading: boolean;
|
||||
}) {
|
||||
const location = useLocation();
|
||||
|
||||
return (
|
||||
<div className="border border-base-content/10 bg-base-100 p-4">
|
||||
<div className="text-xs font-black uppercase tracking-wider text-base-content/30">
|
||||
{title}
|
||||
</div>
|
||||
<div className="mt-2 text-xl font-black text-base-content tabular-nums">
|
||||
{highlight ? `${highlight.metric}${suffix}` : '-'}
|
||||
</div>
|
||||
<div className="mt-1 text-xs text-base-content/45">
|
||||
{highlight?.summonerName ?? '기록 없음'}
|
||||
</div>
|
||||
<div className="min-w-0 px-4 py-3.5 sm:px-5">
|
||||
<div className="text-xs font-semibold text-content-subtle">{title}</div>
|
||||
{isLoading ? (
|
||||
<Skeleton width={64} height={26} className="mt-1.5" />
|
||||
) : (
|
||||
<div className="tabular mt-1 text-[22px] font-extrabold leading-tight text-content">
|
||||
{highlight ? `${highlight.metric}${suffix}` : '—'}
|
||||
</div>
|
||||
)}
|
||||
{highlight ? (
|
||||
<Link
|
||||
to={`/users/${highlight.userId}/history?queueGroup=internal`}
|
||||
state={{ backTo: `${location.pathname}${location.search}` }}
|
||||
className="mt-0.5 block truncate text-[13px] font-medium text-content-muted hover:text-primary"
|
||||
>
|
||||
{highlight.summonerName}
|
||||
</Link>
|
||||
) : (
|
||||
<div className="mt-0.5 text-[13px] text-content-subtle">
|
||||
{isLoading ? ' ' : '기록 없음'}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -196,100 +296,144 @@ function LeaderboardTable({
|
||||
manifest,
|
||||
}: {
|
||||
rows: ApiLeaderboardRow[];
|
||||
manifest: ReturnType<typeof useDdragonManifest>['data'];
|
||||
manifest: Manifest;
|
||||
}) {
|
||||
const location = useLocation();
|
||||
const historyBackTo = `${location.pathname}${location.search}${location.hash}`;
|
||||
|
||||
return (
|
||||
<div className="border border-base-content/10 bg-base-100 overflow-hidden">
|
||||
<div className="overflow-x-auto">
|
||||
<table className="w-full text-left min-w-[920px]">
|
||||
<thead>
|
||||
<tr className="border-b border-base-content/10 bg-base-200/50 text-xs uppercase tracking-wider text-base-content/35">
|
||||
<th className="px-3 py-2.5">#</th>
|
||||
<th className="px-3 py-2.5">소환사</th>
|
||||
<th className="px-3 py-2.5 text-center">승률</th>
|
||||
<th className="px-3 py-2.5 text-center">게임</th>
|
||||
<th className="px-3 py-2.5 text-center">KDA</th>
|
||||
<th className="px-3 py-2.5 text-center">GPM</th>
|
||||
<th className="px-3 py-2.5 text-center">킬관여</th>
|
||||
<th className="px-3 py-2.5 text-center">분당 CS</th>
|
||||
<th className="px-3 py-2.5">주 챔피언</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{rows.map((row, index) => (
|
||||
<tr key={row.userId} className="border-b border-base-content/5 last:border-b-0">
|
||||
<td className="px-3 py-2.5 text-xs text-base-content/30">
|
||||
{index + 1}
|
||||
</td>
|
||||
<td className="px-3 py-2.5">
|
||||
<Link
|
||||
to={`/users/${row.userId}/history?queueGroup=internal`}
|
||||
state={{ backTo: historyBackTo }}
|
||||
className="flex items-center gap-2 group"
|
||||
<div className="overflow-x-auto">
|
||||
<table className="lts-table min-w-[860px]">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" className="w-12 !text-center">
|
||||
순위
|
||||
</th>
|
||||
<th scope="col">소환사</th>
|
||||
<th scope="col" className="!text-right">
|
||||
승률
|
||||
</th>
|
||||
<th scope="col" className="!text-right">
|
||||
전적
|
||||
</th>
|
||||
<th scope="col" className="!text-right">
|
||||
KDA
|
||||
</th>
|
||||
<th scope="col" className="!text-right">
|
||||
GPM
|
||||
</th>
|
||||
<th scope="col" className="!text-right">
|
||||
킬관여
|
||||
</th>
|
||||
<th scope="col" className="!text-right">
|
||||
분당 CS
|
||||
</th>
|
||||
<th scope="col">주 챔피언</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{rows.map((row, index) => (
|
||||
<tr key={row.userId} className="transition-colors hover:bg-sunken">
|
||||
<td className="tabular text-center">
|
||||
{index < 3 ? (
|
||||
<span
|
||||
className={`inline-grid size-6 place-items-center rounded-full text-xs font-extrabold ${
|
||||
index === 0
|
||||
? 'bg-gold text-accent-content'
|
||||
: 'bg-sunken-strong text-content-muted'
|
||||
}`}
|
||||
>
|
||||
<span className="w-7 h-7 bg-base-content/10 overflow-hidden">
|
||||
<img
|
||||
src={profileIconUrl(manifest, row.profileIconId)}
|
||||
alt=""
|
||||
className="w-full h-full object-cover"
|
||||
loading="lazy"
|
||||
/>
|
||||
</span>
|
||||
<span className="font-bold text-sm group-hover:text-primary">
|
||||
{row.summonerName}
|
||||
</span>
|
||||
</Link>
|
||||
</td>
|
||||
<td className={`px-3 py-2.5 text-center text-sm font-black ${ratioClass(row.winRate)}`}>
|
||||
{row.winRate}%
|
||||
</td>
|
||||
<td className="px-3 py-2.5 text-center text-xs tabular-nums">
|
||||
{row.games}
|
||||
</td>
|
||||
<td className="px-3 py-2.5 text-center text-xs font-bold tabular-nums">
|
||||
{row.kda}
|
||||
</td>
|
||||
<td className="px-3 py-2.5 text-center text-xs tabular-nums">
|
||||
{row.avgGoldPerMin}
|
||||
</td>
|
||||
<td className="px-3 py-2.5 text-center text-xs tabular-nums">
|
||||
{row.avgKillParticipation}%
|
||||
</td>
|
||||
<td className="px-3 py-2.5 text-center text-xs tabular-nums">
|
||||
{row.avgCsPerMin}
|
||||
</td>
|
||||
<td className="px-3 py-2.5">
|
||||
<div className="flex flex-wrap gap-2 text-xs text-base-content/55">
|
||||
{row.topChampions.map((champion) => (
|
||||
<ChampionChip
|
||||
key={champion.championId}
|
||||
championId={champion.championId}
|
||||
manifest={manifest}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
))}
|
||||
{rows.length === 0 && (
|
||||
<tr>
|
||||
<td colSpan={9} className="py-10 text-center text-sm text-base-content/35">
|
||||
아직 집계할 내전 기록이 없습니다.
|
||||
</td>
|
||||
</tr>
|
||||
)}
|
||||
</tbody>
|
||||
</table>
|
||||
{index + 1}
|
||||
</span>
|
||||
) : (
|
||||
<span className="text-[13px] text-content-subtle">
|
||||
{index + 1}
|
||||
</span>
|
||||
)}
|
||||
</td>
|
||||
<td>
|
||||
<Link
|
||||
to={`/users/${row.userId}/history?queueGroup=internal`}
|
||||
state={{ backTo: historyBackTo }}
|
||||
className="group flex items-center gap-2.5"
|
||||
>
|
||||
<img
|
||||
src={profileIconUrl(manifest, row.profileIconId)}
|
||||
alt=""
|
||||
className="size-8 rounded-full bg-sunken-strong object-cover"
|
||||
loading="lazy"
|
||||
/>
|
||||
<span className="font-semibold text-content group-hover:text-primary">
|
||||
{row.summonerName}
|
||||
</span>
|
||||
</Link>
|
||||
</td>
|
||||
<td
|
||||
className={`tabular text-right font-bold ${ratioClass(row.winRate)}`}
|
||||
>
|
||||
{row.winRate}%
|
||||
</td>
|
||||
<td className="tabular whitespace-nowrap text-right text-[13px] text-content-muted">
|
||||
{row.games}전 {row.wins}승 {row.losses}패
|
||||
</td>
|
||||
<td
|
||||
className={`tabular text-right font-semibold ${kdaClass(row.kda)}`}
|
||||
>
|
||||
{row.kda}
|
||||
</td>
|
||||
<td className="tabular text-right text-[13px]">
|
||||
{row.avgGoldPerMin}
|
||||
</td>
|
||||
<td className="tabular text-right text-[13px]">
|
||||
{row.avgKillParticipation}%
|
||||
</td>
|
||||
<td className="tabular text-right text-[13px]">
|
||||
{row.avgCsPerMin}
|
||||
</td>
|
||||
<td>
|
||||
<div className="flex gap-1">
|
||||
{row.topChampions.map((champion) => (
|
||||
<ChampionChip
|
||||
key={champion.championId}
|
||||
championId={champion.championId}
|
||||
manifest={manifest}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
))}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function SideWinRate({ blue, red }: { blue: number; red: number }) {
|
||||
const total = blue + red;
|
||||
const blueShare = total > 0 ? (blue / total) * 100 : 50;
|
||||
|
||||
return (
|
||||
<div className="w-full max-w-64 sm:w-64">
|
||||
<div className="tabular flex justify-between text-xs font-semibold">
|
||||
<span className="text-[#8fb6ff]">블루 {blue}%</span>
|
||||
<span className="text-[#ff99a5]">레드 {red}%</span>
|
||||
</div>
|
||||
<div
|
||||
className="mt-1.5 flex h-1.5 gap-0.5 overflow-hidden rounded-full"
|
||||
role="img"
|
||||
aria-label={`진영 승률 블루 ${blue}%, 레드 ${red}%`}
|
||||
>
|
||||
<span className="bg-win" style={{ width: `${blueShare}%` }} />
|
||||
<span className="flex-1 bg-loss" />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default function CommunityInternalStatsPage() {
|
||||
const [searchParams] = useSearchParams();
|
||||
const [searchParams, setSearchParams] = useSearchParams();
|
||||
const view = searchParams.get('view') === 'ranking' ? 'ranking' : 'matches';
|
||||
const championIdParam = Number(searchParams.get('championId'));
|
||||
const championId =
|
||||
Number.isFinite(championIdParam) && championIdParam > 0
|
||||
@@ -308,99 +452,191 @@ export default function CommunityInternalStatsPage() {
|
||||
const matches = matchesQuery.data?.pages.flatMap((page) => page.matches) ?? [];
|
||||
const season =
|
||||
leaderboardQuery.data?.season ?? matchesQuery.data?.pages[0]?.season ?? null;
|
||||
const insights = insightsQuery.data;
|
||||
const leaderboardRows = leaderboardQuery.data?.rows ?? [];
|
||||
|
||||
if (!DEFAULT_COMMUNITY_ID) {
|
||||
return (
|
||||
<main className="max-w-6xl mx-auto px-4 py-20 text-center text-sm text-amber-600">
|
||||
`VITE_DEFAULT_COMMUNITY_ID` 설정이 필요합니다.
|
||||
</main>
|
||||
<PlainPage className="py-16">
|
||||
<ErrorNote
|
||||
title="커뮤니티가 설정되지 않았습니다"
|
||||
description="VITE_DEFAULT_COMMUNITY_ID 설정이 필요합니다."
|
||||
/>
|
||||
</PlainPage>
|
||||
);
|
||||
}
|
||||
|
||||
function setView(next: 'matches' | 'ranking') {
|
||||
const params = new URLSearchParams(searchParams);
|
||||
if (next === 'matches') params.delete('view');
|
||||
else params.set('view', next);
|
||||
setSearchParams(params, { preventScrollReset: true });
|
||||
}
|
||||
|
||||
return (
|
||||
<main className="max-w-6xl mx-auto px-4 sm:px-6 py-6">
|
||||
<Link to="/" className="text-xs text-base-content/40 hover:text-base-content">
|
||||
← 홈으로
|
||||
</Link>
|
||||
|
||||
<section className="mt-5 mb-6 border border-base-content/10 bg-base-100 p-5">
|
||||
<div className="flex flex-col sm:flex-row sm:items-end sm:justify-between gap-4">
|
||||
<div>
|
||||
<p className="text-xs font-black uppercase tracking-[0.24em] text-primary">
|
||||
Community Records
|
||||
</p>
|
||||
<h1 className="mt-2 text-3xl font-black text-base-content">
|
||||
{communityQuery.data?.name ?? '커뮤니티'} 내전 전적
|
||||
</h1>
|
||||
<p className="mt-2 text-sm text-base-content/45">
|
||||
토너먼트 코드로 수집된 결과를 기준으로 매치, 선수 순위, 팀 인사이트를 보여줍니다.
|
||||
</p>
|
||||
</div>
|
||||
<div className="border border-base-content/10 px-4 py-3 text-sm text-base-content/55">
|
||||
<div className="text-xs uppercase tracking-wider text-base-content/30">
|
||||
시즌
|
||||
<>
|
||||
<PageHero
|
||||
eyebrow={season?.label ?? '현재 시즌'}
|
||||
title={`${communityQuery.data?.name ?? '커뮤니티'} 내전 전적`}
|
||||
meta="토너먼트 코드로 수집한 내전 결과를 집계합니다."
|
||||
actions={
|
||||
insights ? (
|
||||
<SideWinRate
|
||||
blue={insights.sideWinRate.blue}
|
||||
red={insights.sideWinRate.red}
|
||||
/>
|
||||
) : undefined
|
||||
}
|
||||
/>
|
||||
<PageBody className="space-y-5">
|
||||
<Panel aria-busy={insightsQuery.isLoading}>
|
||||
<PanelHeader title="시즌 기록" />
|
||||
{insightsQuery.error ? (
|
||||
<div className="p-4">
|
||||
<ErrorNote
|
||||
title="시즌 기록을 불러오지 못했습니다"
|
||||
action={
|
||||
<Btn size="sm" onClick={() => void insightsQuery.refetch()}>
|
||||
다시 시도
|
||||
</Btn>
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
<div className="mt-1 font-bold">{season?.label ?? '현재 시즌'}</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
) : (
|
||||
<div className="grid grid-cols-2 divide-line max-lg:[&>*:nth-child(even)]:border-l max-lg:[&>*:nth-child(n+3)]:border-t lg:grid-cols-5 lg:divide-x">
|
||||
<HighlightCell
|
||||
title="최고 KDA"
|
||||
highlight={insights?.topKda}
|
||||
isLoading={insightsQuery.isLoading}
|
||||
/>
|
||||
<HighlightCell
|
||||
title="누적 킬"
|
||||
highlight={insights?.mostKills}
|
||||
isLoading={insightsQuery.isLoading}
|
||||
/>
|
||||
<HighlightCell
|
||||
title="단일 경기 GPM"
|
||||
highlight={insights?.topTeamGpm}
|
||||
isLoading={insightsQuery.isLoading}
|
||||
/>
|
||||
<HighlightCell
|
||||
title="킬 관여율"
|
||||
highlight={insights?.topKillParticipation}
|
||||
suffix="%"
|
||||
isLoading={insightsQuery.isLoading}
|
||||
/>
|
||||
<HighlightCell
|
||||
title="분당 CS"
|
||||
highlight={insights?.bestFarm}
|
||||
isLoading={insightsQuery.isLoading}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</Panel>
|
||||
|
||||
<section className="grid sm:grid-cols-2 lg:grid-cols-5 gap-3 mb-6">
|
||||
<HighlightCard title="최고 KDA" highlight={insightsQuery.data?.topKda} />
|
||||
<HighlightCard title="누적 킬 1위" highlight={insightsQuery.data?.mostKills} />
|
||||
<HighlightCard title="단일 경기 GPM" highlight={insightsQuery.data?.topTeamGpm} />
|
||||
<HighlightCard title="킬 관여율" highlight={insightsQuery.data?.topKillParticipation} suffix="%" />
|
||||
<HighlightCard title="분당 CS" highlight={insightsQuery.data?.bestFarm} />
|
||||
</section>
|
||||
|
||||
<section className="mb-8">
|
||||
<div className="flex items-center justify-between gap-3 mb-3">
|
||||
<h2 className="text-sm font-black text-base-content">최근 내전</h2>
|
||||
<div className="text-xs text-base-content/35">
|
||||
블루 승률 {insightsQuery.data?.sideWinRate.blue ?? 0}% · 레드 승률{' '}
|
||||
{insightsQuery.data?.sideWinRate.red ?? 0}%
|
||||
</div>
|
||||
<div
|
||||
className="flex items-center gap-1.5"
|
||||
role="tablist"
|
||||
aria-label="전적 보기"
|
||||
>
|
||||
<Chip
|
||||
role="tab"
|
||||
aria-selected={view === 'matches'}
|
||||
selected={view === 'matches'}
|
||||
onClick={() => setView('matches')}
|
||||
>
|
||||
최근 내전
|
||||
</Chip>
|
||||
<Chip
|
||||
role="tab"
|
||||
aria-selected={view === 'ranking'}
|
||||
selected={view === 'ranking'}
|
||||
onClick={() => setView('ranking')}
|
||||
>
|
||||
선수 순위
|
||||
{leaderboardRows.length > 0 && (
|
||||
<span className="tabular opacity-70">
|
||||
{leaderboardRows.length}
|
||||
</span>
|
||||
)}
|
||||
</Chip>
|
||||
</div>
|
||||
{matchesQuery.isLoading ? (
|
||||
<div className="border border-base-content/10 bg-base-100 px-4 py-12 text-center text-sm text-base-content/35">
|
||||
내전 기록을 불러오는 중...
|
||||
</div>
|
||||
) : (
|
||||
<div className="space-y-3">
|
||||
{matches.map((match) => (
|
||||
<MatchCard key={match.matchId} match={match} manifest={ddragon} />
|
||||
))}
|
||||
{matches.length === 0 && (
|
||||
<div className="border border-base-content/10 bg-base-100 px-4 py-12 text-center text-sm text-base-content/35">
|
||||
아직 수집된 내전 결과가 없습니다.
|
||||
|
||||
{view === 'matches' ? (
|
||||
<Panel>
|
||||
{matchesQuery.isLoading ? (
|
||||
<LoadingNote label="내전 기록을 불러오는 중" />
|
||||
) : matchesQuery.error ? (
|
||||
<div className="p-4">
|
||||
<ErrorNote
|
||||
title="내전 기록을 불러오지 못했습니다"
|
||||
action={
|
||||
<Btn size="sm" onClick={() => void matchesQuery.refetch()}>
|
||||
다시 시도
|
||||
</Btn>
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
) : matches.length === 0 ? (
|
||||
<EmptyNote
|
||||
title="아직 수집된 내전 결과가 없습니다"
|
||||
description="내전이 끝나고 결과가 수집되면 이곳에 표시됩니다."
|
||||
/>
|
||||
) : (
|
||||
<ul className="divide-y divide-line">
|
||||
{matches.map((match) => (
|
||||
<MatchCard
|
||||
key={match.matchId}
|
||||
match={match}
|
||||
manifest={ddragon}
|
||||
/>
|
||||
))}
|
||||
</ul>
|
||||
)}
|
||||
{matchesQuery.hasNextPage && (
|
||||
<div className="border-t border-line p-3">
|
||||
<Btn
|
||||
variant="ghost"
|
||||
className="w-full"
|
||||
disabled={matchesQuery.isFetchingNextPage}
|
||||
loading={matchesQuery.isFetchingNextPage}
|
||||
onClick={() => void matchesQuery.fetchNextPage()}
|
||||
>
|
||||
더 보기
|
||||
</Btn>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</Panel>
|
||||
) : (
|
||||
<Panel>
|
||||
<PanelHeader
|
||||
title="선수 순위"
|
||||
description="승률 순. 포지션은 Riot 매치의 라인 정보를 기준으로 합니다."
|
||||
/>
|
||||
{leaderboardQuery.isLoading ? (
|
||||
<LoadingNote label="순위를 불러오는 중" />
|
||||
) : leaderboardQuery.error ? (
|
||||
<div className="p-4">
|
||||
<ErrorNote
|
||||
title="순위를 불러오지 못했습니다"
|
||||
action={
|
||||
<Btn
|
||||
size="sm"
|
||||
onClick={() => void leaderboardQuery.refetch()}
|
||||
>
|
||||
다시 시도
|
||||
</Btn>
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
) : leaderboardRows.length === 0 ? (
|
||||
<EmptyNote title="아직 집계할 내전 기록이 없습니다" />
|
||||
) : (
|
||||
<LeaderboardTable rows={leaderboardRows} manifest={ddragon} />
|
||||
)}
|
||||
</Panel>
|
||||
)}
|
||||
{matchesQuery.hasNextPage && (
|
||||
<button
|
||||
type="button"
|
||||
className="mt-3 w-full border border-base-content/15 bg-base-100 py-3 text-sm font-bold text-base-content/60 hover:text-primary hover:border-primary/30 disabled:opacity-40"
|
||||
disabled={matchesQuery.isFetchingNextPage}
|
||||
onClick={() => matchesQuery.fetchNextPage()}
|
||||
>
|
||||
{matchesQuery.isFetchingNextPage ? '불러오는 중...' : '+ 더 보기'}
|
||||
</button>
|
||||
)}
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<div className="flex items-center justify-between gap-3 mb-3">
|
||||
<h2 className="text-sm font-black text-base-content">선수 순위</h2>
|
||||
<div className="text-xs text-base-content/35">
|
||||
포지션은 Riot Match의 라인 정보를 기준으로 합니다.
|
||||
</div>
|
||||
</div>
|
||||
<LeaderboardTable
|
||||
rows={leaderboardQuery.data?.rows ?? []}
|
||||
manifest={ddragon}
|
||||
/>
|
||||
</section>
|
||||
</main>
|
||||
</PageBody>
|
||||
</>
|
||||
);
|
||||
}
|
||||
+392
-585
File diff suppressed because it is too large.
Load diff
@@ -8,13 +8,23 @@ import {
|
||||
} from "../lib/ddragon";
|
||||
import {
|
||||
sideShortLabel,
|
||||
teamIndexColorClasses,
|
||||
teamIndexLabel,
|
||||
} from "../lib/league";
|
||||
import { internalMatchGamePath } from "../lib/internal-match-routes";
|
||||
import { LANE_LABELS } from "../lib/riot-history";
|
||||
import { ItemIcon } from "../components/ItemTooltip";
|
||||
|
||||
import {
|
||||
Btn,
|
||||
EmptyNote,
|
||||
LoadingNote,
|
||||
MetaDot,
|
||||
PageBody,
|
||||
PageHero,
|
||||
Panel,
|
||||
PlainPage,
|
||||
} from "../ui";
|
||||
|
||||
function formatDateTime(value: string | number) {
|
||||
return new Intl.DateTimeFormat("ko-KR", {
|
||||
month: "long",
|
||||
@@ -36,8 +46,8 @@ function sideLabel(side: TeamSide) {
|
||||
|
||||
function sideClass(side: TeamSide) {
|
||||
return side === "blue"
|
||||
? "text-blue-400 border-blue-500/20"
|
||||
: "text-red-400 border-red-500/20";
|
||||
? "text-win border-win-line"
|
||||
: "text-loss border-loss-line";
|
||||
}
|
||||
|
||||
function ChampionCell({
|
||||
@@ -101,8 +111,8 @@ function GamePanel({
|
||||
const historyBackTo = `${location.pathname}${location.search}${location.hash}`;
|
||||
|
||||
return (
|
||||
<section className="border border-base-content/10 bg-base-100 overflow-hidden">
|
||||
<div className="px-4 py-3 border-b border-base-content/10 bg-base-200/40 flex flex-wrap items-center justify-between gap-3">
|
||||
<section className="lts-panel overflow-hidden">
|
||||
<div className="flex flex-wrap items-center justify-between gap-3 border-b border-line px-4 py-3 sm:px-5">
|
||||
<div>
|
||||
<h2 className="text-sm font-black text-base-content">
|
||||
{game.gameNumber}경기
|
||||
@@ -117,15 +127,19 @@ function GamePanel({
|
||||
<Link
|
||||
to={internalMatchGamePath(communityId, matchId, game.gameNumber)}
|
||||
state={{ backTo: historyBackTo }}
|
||||
className="border border-primary/20 px-2 py-1 text-xs font-black text-primary transition-colors hover:bg-primary/8"
|
||||
className="inline-flex h-7 items-center rounded-full bg-primary-tint px-3 text-xs font-bold text-primary transition-colors hover:brightness-95"
|
||||
>
|
||||
상세 분석
|
||||
</Link>
|
||||
{game.teams.map((team) => (
|
||||
<span
|
||||
key={team.side}
|
||||
className={`border px-2 py-1 text-xs font-black ${sideClass(team.side)} ${
|
||||
team.win ? "bg-base-content/5" : "opacity-40"
|
||||
className={`inline-flex h-7 items-center rounded-full px-3 text-xs font-bold ${
|
||||
team.win
|
||||
? team.side === "blue"
|
||||
? "bg-win-tint text-win"
|
||||
: "bg-loss-tint text-loss"
|
||||
: "bg-sunken text-content-subtle"
|
||||
}`}
|
||||
>
|
||||
{teamIndexLabel(team.teamIndex)} ({sideLabel(team.side)}){" "}
|
||||
@@ -197,7 +211,7 @@ function GamePanel({
|
||||
<td className="px-3 py-2 text-center text-sm font-black tabular-nums">
|
||||
{participant.kills}
|
||||
<span className="text-base-content/25"> / </span>
|
||||
<span className="text-red-400">{participant.deaths}</span>
|
||||
<span className="text-loss">{participant.deaths}</span>
|
||||
<span className="text-base-content/25"> / </span>
|
||||
{participant.assists}
|
||||
</td>
|
||||
@@ -240,27 +254,29 @@ export default function InternalMatchDetailPage() {
|
||||
|
||||
if (detailQuery.isLoading) {
|
||||
return (
|
||||
<main className="max-w-6xl mx-auto px-4 py-20 text-center text-sm text-base-content/40">
|
||||
내전 상세 기록을 불러오는 중...
|
||||
</main>
|
||||
<PlainPage>
|
||||
<LoadingNote label="내전 기록을 불러오는 중" />
|
||||
</PlainPage>
|
||||
);
|
||||
}
|
||||
|
||||
if (detailQuery.error || !detail) {
|
||||
return (
|
||||
<main className="max-w-6xl mx-auto px-4 py-20 text-center">
|
||||
<h1 className="text-lg font-bold">내전 기록을 찾을 수 없습니다</h1>
|
||||
<Link
|
||||
to={`/communities/${communityId}/internal-stats`}
|
||||
className="btn btn-ghost btn-sm mt-4"
|
||||
>
|
||||
내전 전적으로 돌아가기
|
||||
</Link>
|
||||
</main>
|
||||
<PlainPage>
|
||||
<EmptyNote
|
||||
title="내전 기록을 찾을 수 없습니다"
|
||||
action={
|
||||
<Btn to={`/communities/${communityId}/internal-stats`}>
|
||||
내전 전적으로
|
||||
</Btn>
|
||||
}
|
||||
/>
|
||||
</PlainPage>
|
||||
);
|
||||
}
|
||||
|
||||
const primarySeries = detail.match.seriesResults[0];
|
||||
const isHeadToHead = detail.match.teams.length === 2;
|
||||
const primarySeries = isHeadToHead ? detail.match.seriesResults[0] : undefined;
|
||||
const teamName = (teamIndex: number) =>
|
||||
teamIndexLabel(
|
||||
teamIndex,
|
||||
@@ -268,62 +284,74 @@ export default function InternalMatchDetailPage() {
|
||||
);
|
||||
|
||||
return (
|
||||
<main className="max-w-6xl mx-auto px-4 sm:px-6 py-6">
|
||||
<Link
|
||||
to={`/communities/${communityId}/internal-stats`}
|
||||
className="text-xs text-base-content/40 hover:text-base-content"
|
||||
>
|
||||
← 내전 전적
|
||||
</Link>
|
||||
|
||||
<section className="mt-5 mb-6 border border-base-content/10 bg-base-100 p-5">
|
||||
<div className="flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4">
|
||||
<div>
|
||||
<h1 className="text-2xl font-black text-base-content">
|
||||
{detail.match.title}
|
||||
</h1>
|
||||
<p className="mt-2 text-sm text-base-content/45">
|
||||
{formatDateTime(detail.match.scheduledAt)} ·{" "}
|
||||
{detail.match.gameCount}전제
|
||||
</p>
|
||||
</div>
|
||||
{primarySeries && (
|
||||
<div className="flex items-center gap-6">
|
||||
<div
|
||||
className={
|
||||
primarySeries.winnerTeamIndex === primarySeries.teamAIndex
|
||||
? teamIndexColorClasses(primarySeries.teamAIndex).text
|
||||
: "text-base-content/30"
|
||||
}
|
||||
<>
|
||||
<PageHero
|
||||
width="xl"
|
||||
crumbs={[
|
||||
{ label: "전적", to: `/communities/${communityId}/internal-stats` },
|
||||
{ label: detail.match.title },
|
||||
]}
|
||||
title={detail.match.title}
|
||||
meta={
|
||||
<>
|
||||
<span>{formatDateTime(detail.match.scheduledAt)}</span>
|
||||
<MetaDot />
|
||||
<span>{detail.match.teams.length}팀</span>
|
||||
<MetaDot />
|
||||
<span>{detail.match.gameCount}경기</span>
|
||||
</>
|
||||
}
|
||||
actions={
|
||||
primarySeries ? (
|
||||
<div
|
||||
className="flex items-center gap-4"
|
||||
aria-label={`시리즈 결과 ${teamName(primarySeries.teamAIndex)} ${primarySeries.teamAWins} 대 ${primarySeries.teamBWins} ${teamName(primarySeries.teamBIndex)}`}
|
||||
>
|
||||
<span
|
||||
className={`max-w-32 truncate text-sm font-bold ${primarySeries.winnerTeamIndex === primarySeries.teamAIndex ? "text-on-ink" : "text-on-ink-muted"}`}
|
||||
>
|
||||
<div className="text-4xl font-black tabular-nums">
|
||||
{teamName(primarySeries.teamAIndex)}
|
||||
</span>
|
||||
<span className="tabular flex items-baseline gap-2 text-4xl font-extrabold">
|
||||
<span
|
||||
className={
|
||||
primarySeries.winnerTeamIndex === primarySeries.teamAIndex
|
||||
? "text-brand-coral"
|
||||
: "text-on-ink-muted"
|
||||
}
|
||||
>
|
||||
{primarySeries.teamAWins}
|
||||
</div>
|
||||
<div className="text-xs font-bold uppercase tracking-wider">
|
||||
{teamName(primarySeries.teamAIndex)}
|
||||
</div>
|
||||
</div>
|
||||
<div className="text-base-content/15 text-xs font-black">VS</div>
|
||||
<div
|
||||
className={
|
||||
primarySeries.winnerTeamIndex === primarySeries.teamBIndex
|
||||
? teamIndexColorClasses(primarySeries.teamBIndex).text
|
||||
: "text-base-content/30"
|
||||
}
|
||||
>
|
||||
<div className="text-4xl font-black tabular-nums">
|
||||
</span>
|
||||
<span className="text-xl text-on-ink-muted">:</span>
|
||||
<span
|
||||
className={
|
||||
primarySeries.winnerTeamIndex === primarySeries.teamBIndex
|
||||
? "text-brand-coral"
|
||||
: "text-on-ink-muted"
|
||||
}
|
||||
>
|
||||
{primarySeries.teamBWins}
|
||||
</div>
|
||||
<div className="text-xs font-bold uppercase tracking-wider">
|
||||
{teamName(primarySeries.teamBIndex)}
|
||||
</div>
|
||||
</div>
|
||||
</span>
|
||||
</span>
|
||||
<span
|
||||
className={`max-w-32 truncate text-sm font-bold ${primarySeries.winnerTeamIndex === primarySeries.teamBIndex ? "text-on-ink" : "text-on-ink-muted"}`}
|
||||
>
|
||||
{teamName(primarySeries.teamBIndex)}
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div className="space-y-4">
|
||||
) : (
|
||||
<Btn to={`/match/${detail.match.matchId}`} variant="primary">
|
||||
대진표 보기
|
||||
</Btn>
|
||||
)
|
||||
}
|
||||
/>
|
||||
<PageBody width="xl" className="space-y-4">
|
||||
{detail.games.length === 0 && (
|
||||
<Panel>
|
||||
<EmptyNote title="수집된 경기 기록이 없습니다" />
|
||||
</Panel>
|
||||
)}
|
||||
{detail.games.map((game) => (
|
||||
<GamePanel
|
||||
key={game.riotMatchId}
|
||||
@@ -333,7 +361,7 @@ export default function InternalMatchDetailPage() {
|
||||
manifest={ddragon}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
</main>
|
||||
</PageBody>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,47 +1,54 @@
|
||||
import { useMsal } from "@azure/msal-react";
|
||||
import { KeyRound } from "lucide-react";
|
||||
import {
|
||||
isMsalConfigured,
|
||||
MSAL_API_SCOPE,
|
||||
msalInstance,
|
||||
} from "../lib/auth/msal.config";
|
||||
import { Button, ErrorNote, PlainPage } from "../ui";
|
||||
|
||||
function LoginButton() {
|
||||
const { instance } = useMsal();
|
||||
|
||||
return (
|
||||
<button
|
||||
type="button"
|
||||
className="btn btn-primary btn-sm px-5"
|
||||
<Button
|
||||
label="Entra ID로 로그인"
|
||||
variant="primary"
|
||||
size="lg"
|
||||
width="100%"
|
||||
onClick={() =>
|
||||
void instance.loginRedirect({
|
||||
scopes: [MSAL_API_SCOPE],
|
||||
prompt: "select_account",
|
||||
})
|
||||
}
|
||||
>
|
||||
Entra ID 로 로그인
|
||||
</button>
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
export default function LoginPage() {
|
||||
return (
|
||||
<main className="max-w-5xl mx-auto px-4 sm:px-6 py-20">
|
||||
<div className="max-w-md border border-base-content/10 bg-base-100 p-6 shadow-sm">
|
||||
<h1 className="text-xl font-bold tracking-tight">로그인</h1>
|
||||
<p className="mt-2 text-sm text-base-content/50">
|
||||
Entra ID 계정으로 LOLYMPUS 정보를 불러옵니다.
|
||||
<PlainPage width="md" className="py-16 sm:py-24">
|
||||
<div className="lts-panel mx-auto max-w-sm p-6 sm:p-8">
|
||||
<span className="grid size-11 place-items-center rounded-full bg-primary-tint text-primary">
|
||||
<KeyRound className="size-5" aria-hidden="true" />
|
||||
</span>
|
||||
<h1 className="mt-4 text-xl font-extrabold text-content">로그인</h1>
|
||||
<p className="mt-1.5 text-sm leading-relaxed text-content-muted">
|
||||
내전 참가 신청, 팀장 경매, 운영 기능은 로그인 후 사용할 수 있습니다.
|
||||
전적과 대진은 로그인 없이 볼 수 있습니다.
|
||||
</p>
|
||||
<div className="mt-5">
|
||||
<div className="mt-6">
|
||||
{isMsalConfigured && msalInstance ? (
|
||||
<LoginButton />
|
||||
) : (
|
||||
<div className="text-sm text-amber-600">
|
||||
MSAL 환경변수 설정이 필요합니다.
|
||||
</div>
|
||||
<ErrorNote
|
||||
title="로그인을 사용할 수 없습니다"
|
||||
description="MSAL 환경변수 설정이 필요합니다."
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
</PlainPage>
|
||||
);
|
||||
}
|
||||
@@ -4,7 +4,24 @@ import type {
|
||||
MatchDetailResponse,
|
||||
MatchParticipantView,
|
||||
} from "@lolympus/contracts";
|
||||
import { ChevronLeft, Search, X } from "lucide-react";
|
||||
import {
|
||||
CalendarDays,
|
||||
Map as MapIcon,
|
||||
Search,
|
||||
Users,
|
||||
X,
|
||||
} from "lucide-react";
|
||||
import {
|
||||
EmptyNote,
|
||||
ErrorNote,
|
||||
LoadingNote,
|
||||
MetaDot,
|
||||
PageBody,
|
||||
PageHero,
|
||||
Pill,
|
||||
PlainPage,
|
||||
type PillTone,
|
||||
} from "../ui";
|
||||
import {
|
||||
Link,
|
||||
useLocation,
|
||||
@@ -35,7 +52,6 @@ import { RankBadge } from "../components/RankBadge";
|
||||
import { CompetitionAdminControls } from "../components/competition/CompetitionAdminControls";
|
||||
import { CompetitionResults } from "../components/competition/CompetitionResults";
|
||||
import { MatchDetailTabBar } from "../components/competition/MatchDetailTabBar";
|
||||
import { MATCH_PAGE_MAX_WIDTH_CLASS } from "../components/competition/competition-display-layout";
|
||||
import {
|
||||
createMatchDetailTabSearchParams,
|
||||
createMatchDetailTabs,
|
||||
@@ -61,6 +77,7 @@ import type {
|
||||
Position,
|
||||
} from "../api/types";
|
||||
|
||||
import { Btn } from "../ui/Btn";
|
||||
type CaptainSelectionSlot = {
|
||||
teamIndex: number;
|
||||
};
|
||||
@@ -295,28 +312,20 @@ function TierCell({ participant }: { participant: ParticipantView }) {
|
||||
);
|
||||
}
|
||||
|
||||
function statusBadge(status: MatchDetailView["status"]) {
|
||||
function statusBadge(status: MatchDetailView["status"]): {
|
||||
label: string;
|
||||
tone: PillTone;
|
||||
live?: boolean;
|
||||
} {
|
||||
switch (status) {
|
||||
case "recruiting":
|
||||
return {
|
||||
label: "모집 중",
|
||||
cls: "bg-success/15 text-success border-success/20",
|
||||
};
|
||||
return { label: "모집 중", tone: "live", live: true };
|
||||
case "team-built":
|
||||
return {
|
||||
label: "팀빌딩 완료",
|
||||
cls: "bg-warning/15 text-warning border-warning/20",
|
||||
};
|
||||
return { label: "팀빌딩 완료", tone: "gold" };
|
||||
case "in-progress":
|
||||
return {
|
||||
label: "진행 중",
|
||||
cls: "bg-info/15 text-info border-info/20",
|
||||
};
|
||||
return { label: "진행 중", tone: "accent", live: true };
|
||||
case "finished":
|
||||
return {
|
||||
label: "종료",
|
||||
cls: "bg-base-content/8 text-base-content/40 border-base-content/10",
|
||||
};
|
||||
return { label: "종료", tone: "ink" };
|
||||
}
|
||||
}
|
||||
|
||||
@@ -765,14 +774,13 @@ function AdminAddParticipantModal({
|
||||
카카오 닉네임 또는 Riot ID로 커뮤니티 유저를 찾습니다.
|
||||
</p>
|
||||
</div>
|
||||
<button
|
||||
type="button"
|
||||
className="btn btn-ghost btn-xs h-8 min-h-8 w-8 p-0"
|
||||
<Btn
|
||||
variant="ghost" size="sm"
|
||||
aria-label="참여자 추가 닫기"
|
||||
onClick={onClose}
|
||||
>
|
||||
<X size={15} aria-hidden="true" />
|
||||
</button>
|
||||
</Btn>
|
||||
</div>
|
||||
|
||||
<div className="space-y-3 px-4 py-4">
|
||||
@@ -795,7 +803,7 @@ function AdminAddParticipantModal({
|
||||
}}
|
||||
aria-label="참여자 검색"
|
||||
placeholder="카카오 닉네임 또는 Riot ID (GameName#TagLine)"
|
||||
className="min-w-0 flex-1 bg-transparent text-sm text-base-content outline-none placeholder:text-base-content/25"
|
||||
className="lts-input min-w-0 flex-1 outline-none"
|
||||
/>
|
||||
</span>
|
||||
</label>
|
||||
@@ -883,7 +891,7 @@ function AdminAddParticipantModal({
|
||||
[candidate.userId]: event.target.value,
|
||||
}))
|
||||
}
|
||||
className="h-8 min-w-0 flex-1 border border-base-content/10 bg-base-100 px-2 text-xs text-base-content focus:border-primary/30 focus:outline-none"
|
||||
className="lts-select min-w-0 flex-1"
|
||||
>
|
||||
{candidate.riotAccounts.map((riotAccount) => (
|
||||
<option
|
||||
@@ -919,7 +927,7 @@ function AdminAddParticipantModal({
|
||||
event.target.value as Position,
|
||||
)
|
||||
}
|
||||
className="mt-1 h-8 w-full border border-base-content/10 bg-base-100 px-2 text-xs text-base-content focus:border-primary/30 focus:outline-none"
|
||||
className="lts-select mt-1 w-full"
|
||||
>
|
||||
{POSITION_ORDER.map((position) => (
|
||||
<option key={position} value={position}>
|
||||
@@ -939,7 +947,7 @@ function AdminAddParticipantModal({
|
||||
event.target.value as Position,
|
||||
)
|
||||
}
|
||||
className="mt-1 h-8 w-full border border-base-content/10 bg-base-100 px-2 text-xs text-base-content focus:border-primary/30 focus:outline-none"
|
||||
className="lts-select mt-1 w-full"
|
||||
>
|
||||
{POSITION_ORDER.map((position) => (
|
||||
<option key={position} value={position}>
|
||||
@@ -950,8 +958,7 @@ function AdminAddParticipantModal({
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<button
|
||||
type="button"
|
||||
<Btn
|
||||
disabled={Boolean(disabledReason) || isAdding}
|
||||
onClick={() =>
|
||||
onAddParticipant({
|
||||
@@ -964,10 +971,10 @@ function AdminAddParticipantModal({
|
||||
),
|
||||
})
|
||||
}
|
||||
className="btn btn-primary btn-sm h-9 min-h-9 w-full text-xs disabled:opacity-40"
|
||||
variant="primary" className="w-full"
|
||||
>
|
||||
{isAdding ? "추가 중..." : "추가"}
|
||||
</button>
|
||||
</Btn>
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
@@ -1071,23 +1078,21 @@ function ParticipantTable({
|
||||
참가자 ({participants.length}/{maxParticipants})
|
||||
</h3>
|
||||
<div className="flex flex-wrap items-center justify-end gap-2">
|
||||
<button
|
||||
type="button"
|
||||
<Btn
|
||||
onClick={onJoin}
|
||||
disabled={!canJoin || joined || isJoining}
|
||||
className="btn btn-primary btn-xs px-4 text-xs font-semibold disabled:opacity-40"
|
||||
variant="primary" size="sm"
|
||||
>
|
||||
{joined ? "참가 완료" : isJoining ? "신청 중..." : "참가 신청"}
|
||||
</button>
|
||||
</Btn>
|
||||
{canManage && (
|
||||
<button
|
||||
type="button"
|
||||
<Btn
|
||||
onClick={onOpenAddParticipant}
|
||||
disabled={participants.length >= maxParticipants}
|
||||
className="btn btn-outline btn-xs px-3 text-xs font-semibold disabled:opacity-40"
|
||||
variant="secondary" size="sm"
|
||||
>
|
||||
참여자 추가
|
||||
</button>
|
||||
</Btn>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
@@ -1133,7 +1138,7 @@ function ParticipantTable({
|
||||
})}
|
||||
</div>
|
||||
<select
|
||||
className="h-8 w-32 shrink-0 border border-base-content/10 bg-base-100 px-2 text-xs text-base-content focus:border-primary/30 focus:outline-none"
|
||||
className="lts-select w-32 shrink-0"
|
||||
value={tierFilter}
|
||||
onChange={(event) => setTierFilter(event.target.value)}
|
||||
>
|
||||
@@ -1147,16 +1152,15 @@ function ParticipantTable({
|
||||
</select>
|
||||
<div className="ml-auto flex min-w-[6.5rem] shrink-0 items-center justify-end gap-1 whitespace-nowrap text-xs text-base-content/35">
|
||||
{isFiltered && (
|
||||
<button
|
||||
type="button"
|
||||
className="btn btn-ghost btn-xs h-8 min-h-8 shrink-0 px-1 text-xs text-base-content/40"
|
||||
<Btn
|
||||
variant="ghost" size="sm" className="shrink-0"
|
||||
onClick={() => {
|
||||
setPositionFilter(ALL_PARTICIPANT_FILTER);
|
||||
setTierFilter(ALL_PARTICIPANT_FILTER);
|
||||
}}
|
||||
>
|
||||
초기화
|
||||
</button>
|
||||
</Btn>
|
||||
)}
|
||||
<span className="w-10 shrink-0 text-right tabular-nums">
|
||||
{filteredParticipants.length}/{participants.length}명
|
||||
@@ -1759,22 +1763,25 @@ export default function MatchDetailPage() {
|
||||
|
||||
if (matchQuery.isLoading) {
|
||||
return (
|
||||
<main className="max-w-5xl mx-auto px-4 py-20 text-center">
|
||||
<span className="text-sm text-base-content/40">
|
||||
매치 정보를 불러오는 중...
|
||||
</span>
|
||||
</main>
|
||||
<PlainPage>
|
||||
<LoadingNote label="내전 정보를 불러오는 중" />
|
||||
</PlainPage>
|
||||
);
|
||||
}
|
||||
|
||||
if (matchQuery.error || !matchQuery.data) {
|
||||
return (
|
||||
<main className="max-w-5xl mx-auto px-4 py-20 text-center">
|
||||
<h2 className="text-lg font-bold mb-2">내전을 찾을 수 없습니다</h2>
|
||||
<Link to="/" className="btn btn-ghost btn-sm mt-4">
|
||||
홈으로 돌아가기
|
||||
</Link>
|
||||
</main>
|
||||
<PlainPage>
|
||||
<EmptyNote
|
||||
title="내전을 찾을 수 없습니다"
|
||||
description="주소가 바뀌었거나 삭제된 내전일 수 있습니다."
|
||||
action={
|
||||
<Btn to="/" variant="secondary">
|
||||
내전 목록으로
|
||||
</Btn>
|
||||
}
|
||||
/>
|
||||
</PlainPage>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1888,88 +1895,74 @@ export default function MatchDetailPage() {
|
||||
}
|
||||
|
||||
return (
|
||||
<main
|
||||
className={`mx-auto px-4 py-6 sm:px-6 ${
|
||||
MATCH_PAGE_MAX_WIDTH_CLASS
|
||||
}`}
|
||||
>
|
||||
<Link
|
||||
to="/"
|
||||
className="inline-flex items-center gap-1 text-xs text-base-content/40 hover:text-base-content transition-colors mb-5"
|
||||
>
|
||||
<ChevronLeft className="h-3.5 w-3.5" aria-hidden="true" />
|
||||
목록으로
|
||||
</Link>
|
||||
|
||||
<div className="mb-6 pb-5 border-b border-base-content/8">
|
||||
<div className="flex items-center gap-2.5 flex-wrap mb-2">
|
||||
<h1 className="text-xl sm:text-2xl font-bold text-base-content leading-tight">
|
||||
{match.title}
|
||||
</h1>
|
||||
<span
|
||||
className={`inline-flex items-center text-xs font-semibold px-1.5 py-0.5 border ${si.cls}`}
|
||||
>
|
||||
<>
|
||||
<PageHero
|
||||
crumbs={[{ label: "내전", to: "/" }, { label: match.title }]}
|
||||
title={match.title}
|
||||
badges={
|
||||
<Pill tone={si.tone} dot={si.live} pulse={si.live}>
|
||||
{si.label}
|
||||
</span>
|
||||
</div>
|
||||
<p className="text-sm text-base-content/50 mb-2.5">
|
||||
{match.description}
|
||||
</p>
|
||||
<div className="flex items-center gap-3 text-xs text-base-content/40 flex-wrap">
|
||||
<span>
|
||||
{match.date} {match.time}
|
||||
</span>
|
||||
<span className="text-base-content/15">|</span>
|
||||
<span>
|
||||
{match.participants.length}/{match.maxParticipants}명
|
||||
</span>
|
||||
<span className="text-base-content/15">|</span>
|
||||
<span className="inline-flex items-center text-xs px-1.5 py-0.5 border border-base-content/10 text-base-content/40">
|
||||
{match.map}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</Pill>
|
||||
}
|
||||
meta={
|
||||
<>
|
||||
<span className="inline-flex items-center gap-1.5">
|
||||
<CalendarDays className="size-4" aria-hidden="true" />
|
||||
{match.date} {match.time}
|
||||
</span>
|
||||
<MetaDot />
|
||||
<span className="inline-flex items-center gap-1.5">
|
||||
<MapIcon className="size-4" aria-hidden="true" />
|
||||
{match.map}
|
||||
</span>
|
||||
<MetaDot />
|
||||
<span className="tabular inline-flex items-center gap-1.5">
|
||||
<Users className="size-4" aria-hidden="true" />
|
||||
<span>
|
||||
<strong className="text-on-ink">
|
||||
{match.participants.length}
|
||||
</strong>
|
||||
/{match.maxParticipants}명
|
||||
</span>
|
||||
</span>
|
||||
</>
|
||||
}
|
||||
description={match.description || undefined}
|
||||
actions={
|
||||
showAuctionLink ? (
|
||||
<Btn to={`/match/${match.id}/auction`} variant="primary" size="lg">
|
||||
경매 보기
|
||||
</Btn>
|
||||
) : undefined
|
||||
}
|
||||
/>
|
||||
<PageBody>
|
||||
{joinMatchMutation.error instanceof Error && (
|
||||
<div className="mb-4 border border-error/20 bg-error/10 px-4 py-3 text-sm text-error">
|
||||
{joinMatchMutation.error.message}
|
||||
</div>
|
||||
<ErrorNote className="mb-4" title="요청을 처리하지 못했습니다" description={joinMatchMutation.error.message} />
|
||||
)}
|
||||
|
||||
{startAuctionMutation.error instanceof Error && (
|
||||
<div className="mb-4 border border-error/20 bg-error/10 px-4 py-3 text-sm text-error">
|
||||
{startAuctionMutation.error.message}
|
||||
</div>
|
||||
<ErrorNote className="mb-4" title="요청을 처리하지 못했습니다" description={startAuctionMutation.error.message} />
|
||||
)}
|
||||
|
||||
{removeParticipantMutation.error instanceof Error && (
|
||||
<div className="mb-4 border border-error/20 bg-error/10 px-4 py-3 text-sm text-error">
|
||||
{removeParticipantMutation.error.message}
|
||||
</div>
|
||||
<ErrorNote className="mb-4" title="요청을 처리하지 못했습니다" description={removeParticipantMutation.error.message} />
|
||||
)}
|
||||
|
||||
{updateParticipantMutation.error instanceof Error && (
|
||||
<div className="mb-4 border border-error/20 bg-error/10 px-4 py-3 text-sm text-error">
|
||||
{updateParticipantMutation.error.message}
|
||||
</div>
|
||||
<ErrorNote className="mb-4" title="요청을 처리하지 못했습니다" description={updateParticipantMutation.error.message} />
|
||||
)}
|
||||
|
||||
{pollTournamentResultMutation.error instanceof Error && (
|
||||
<div className="mb-4 border border-error/20 bg-error/10 px-4 py-3 text-sm text-error">
|
||||
{pollTournamentResultMutation.error.message}
|
||||
</div>
|
||||
<ErrorNote className="mb-4" title="요청을 처리하지 못했습니다" description={pollTournamentResultMutation.error.message} />
|
||||
)}
|
||||
|
||||
{collectResultByWindowMutation.error instanceof Error && (
|
||||
<div className="mb-4 border border-error/20 bg-error/10 px-4 py-3 text-sm text-error">
|
||||
{collectResultByWindowMutation.error.message}
|
||||
</div>
|
||||
<ErrorNote className="mb-4" title="요청을 처리하지 못했습니다" description={collectResultByWindowMutation.error.message} />
|
||||
)}
|
||||
|
||||
{collectResultByRiotMatchMutation.error instanceof Error && (
|
||||
<div className="mb-4 border border-error/20 bg-error/10 px-4 py-3 text-sm text-error">
|
||||
{collectResultByRiotMatchMutation.error.message}
|
||||
</div>
|
||||
<ErrorNote className="mb-4" title="요청을 처리하지 못했습니다" description={collectResultByRiotMatchMutation.error.message} />
|
||||
)}
|
||||
|
||||
{usesTabbedLayout && activeMatchTab && (
|
||||
@@ -2181,12 +2174,12 @@ export default function MatchDetailPage() {
|
||||
</div>
|
||||
|
||||
{showAuctionLink ? (
|
||||
<Link
|
||||
<Btn
|
||||
to={`/match/${match.id}/auction`}
|
||||
className="btn btn-primary btn-sm px-5 text-xs"
|
||||
variant="primary"
|
||||
>
|
||||
경매 페이지 열기
|
||||
</Link>
|
||||
</Btn>
|
||||
) : (
|
||||
<div className="space-y-3">
|
||||
{captainSlots.length > 0 ? (
|
||||
@@ -2203,7 +2196,7 @@ export default function MatchDetailPage() {
|
||||
{teamIndexLabel(slot.teamIndex)} 팀장
|
||||
<div className="mt-1 grid grid-cols-[minmax(0,1fr)_96px] gap-2">
|
||||
<select
|
||||
className="w-full border border-base-content/10 bg-transparent px-2 py-2 text-sm"
|
||||
className="lts-select w-full"
|
||||
value={currentValue}
|
||||
onChange={(event) =>
|
||||
setCaptainSelections((current) => ({
|
||||
@@ -2247,7 +2240,7 @@ export default function MatchDetailPage() {
|
||||
min={100}
|
||||
max={100000}
|
||||
step={50}
|
||||
className="w-full border border-base-content/10 bg-transparent px-2 py-2 text-sm tabular-nums"
|
||||
className="lts-input w-full tabular-nums"
|
||||
value={
|
||||
currentSelection?.initialTeamBidPointAmountInput ??
|
||||
"1000"
|
||||
@@ -2300,7 +2293,7 @@ export default function MatchDetailPage() {
|
||||
min={5}
|
||||
max={MAX_AUCTION_TIMER_SECONDS}
|
||||
step={5}
|
||||
className="min-w-0 flex-1 bg-transparent px-2 py-2 text-sm tabular-nums focus:outline-none"
|
||||
className="lts-input min-w-0 flex-1 tabular-nums"
|
||||
value={maximumBidRoundDurationSecondsInput}
|
||||
onChange={(event) =>
|
||||
setMaximumBidRoundDurationSecondsInput(
|
||||
@@ -2334,7 +2327,7 @@ export default function MatchDetailPage() {
|
||||
min={0}
|
||||
max={MAX_AUCTION_TIMER_SECONDS}
|
||||
step={1}
|
||||
className="min-w-0 flex-1 bg-transparent px-2 py-2 text-sm tabular-nums focus:outline-none"
|
||||
className="lts-input min-w-0 flex-1 tabular-nums"
|
||||
value={bidRoundExtensionSecondsInput}
|
||||
onChange={(event) =>
|
||||
setBidRoundExtensionSecondsInput(
|
||||
@@ -2367,7 +2360,7 @@ export default function MatchDetailPage() {
|
||||
<label className="block text-xs text-base-content/45">
|
||||
상위 티어 우선 등장
|
||||
<select
|
||||
className="mt-1 h-[38px] w-full border border-base-content/10 bg-transparent px-2 py-2 text-sm focus:border-primary/30 focus:outline-none"
|
||||
className="lts-select mt-1 w-full"
|
||||
value={topTierAuctionPriorityThreshold}
|
||||
onChange={(event) =>
|
||||
setTopTierAuctionPriorityThreshold(
|
||||
@@ -2416,7 +2409,7 @@ export default function MatchDetailPage() {
|
||||
</span>
|
||||
<input
|
||||
type="checkbox"
|
||||
className="checkbox checkbox-primary checkbox-xs"
|
||||
className="lts-checkbox"
|
||||
checked={checked}
|
||||
onChange={(event) =>
|
||||
setManualTopTierAuctionPriorityUserIds(
|
||||
@@ -2447,9 +2440,8 @@ export default function MatchDetailPage() {
|
||||
</div>
|
||||
)}
|
||||
<div className="sm:col-span-2 flex items-center gap-3">
|
||||
<button
|
||||
type="button"
|
||||
className="btn btn-primary btn-sm px-5 text-xs"
|
||||
<Btn
|
||||
variant="primary"
|
||||
disabled={
|
||||
!canStartAuction || startAuctionMutation.isPending
|
||||
}
|
||||
@@ -2460,7 +2452,7 @@ export default function MatchDetailPage() {
|
||||
{startAuctionMutation.isPending
|
||||
? "시작 중..."
|
||||
: "경매 시작"}
|
||||
</button>
|
||||
</Btn>
|
||||
{!canUseMemberActions && (
|
||||
<span className="text-xs text-warning">
|
||||
로그인 또는 Dev Auth에 owner/admin User ID를 먼저
|
||||
@@ -2490,12 +2482,12 @@ export default function MatchDetailPage() {
|
||||
))}
|
||||
{showAuctionLink && (
|
||||
<div className="flex justify-end">
|
||||
<Link
|
||||
<Btn
|
||||
to={`/match/${match.id}/auction`}
|
||||
className="btn btn-primary btn-sm px-5 text-xs"
|
||||
variant="primary"
|
||||
>
|
||||
경매 페이지 열기
|
||||
</Link>
|
||||
</Btn>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
@@ -2538,16 +2530,15 @@ export default function MatchDetailPage() {
|
||||
<div className="mb-2 text-xs font-bold text-base-content/45">
|
||||
토너먼트 코드
|
||||
</div>
|
||||
<button
|
||||
type="button"
|
||||
className="btn btn-primary btn-sm w-full text-xs"
|
||||
<Btn
|
||||
variant="primary" className="w-full"
|
||||
disabled={pollTournamentResultMutation.isPending}
|
||||
onClick={handlePollTournamentResult}
|
||||
>
|
||||
{pollTournamentResultMutation.isPending
|
||||
? "등록 중..."
|
||||
: "결과 다시 수집"}
|
||||
</button>
|
||||
</Btn>
|
||||
</div>
|
||||
|
||||
<div className="border-t border-base-content/8 pt-4">
|
||||
@@ -2564,7 +2555,7 @@ export default function MatchDetailPage() {
|
||||
onChange={(event) =>
|
||||
setManualResultStartTime(event.target.value)
|
||||
}
|
||||
className="mt-1 w-full border border-base-content/10 bg-transparent px-2 py-2 text-xs text-base-content focus:outline-none focus:border-primary/30"
|
||||
className="lts-input mt-1 w-full"
|
||||
/>
|
||||
</label>
|
||||
<label className="block text-xs text-base-content/35">
|
||||
@@ -2576,12 +2567,11 @@ export default function MatchDetailPage() {
|
||||
onChange={(event) =>
|
||||
setManualResultEndTime(event.target.value)
|
||||
}
|
||||
className="mt-1 w-full border border-base-content/10 bg-transparent px-2 py-2 text-xs text-base-content focus:outline-none focus:border-primary/30"
|
||||
className="lts-input mt-1 w-full"
|
||||
/>
|
||||
</label>
|
||||
<button
|
||||
type="button"
|
||||
className="btn btn-outline btn-sm w-full text-xs"
|
||||
<Btn
|
||||
variant="secondary" className="w-full"
|
||||
disabled={
|
||||
collectResultByWindowMutation.isPending ||
|
||||
!toIsoFromLocalDateTime(manualResultStartTime) ||
|
||||
@@ -2592,7 +2582,7 @@ export default function MatchDetailPage() {
|
||||
{collectResultByWindowMutation.isPending
|
||||
? "수집 중..."
|
||||
: "시간 범위로 수집"}
|
||||
</button>
|
||||
</Btn>
|
||||
{formatManualCollectSummary(
|
||||
collectResultByWindowMutation.data,
|
||||
) && (
|
||||
@@ -2617,11 +2607,10 @@ export default function MatchDetailPage() {
|
||||
setManualRiotMatchId(event.target.value)
|
||||
}
|
||||
placeholder="KR_1234567890"
|
||||
className="w-full border border-base-content/10 bg-transparent px-2 py-2 text-xs text-base-content focus:outline-none focus:border-primary/30"
|
||||
className="lts-input w-full"
|
||||
/>
|
||||
<button
|
||||
type="button"
|
||||
className="btn btn-outline btn-sm w-full text-xs"
|
||||
<Btn
|
||||
variant="secondary" className="w-full"
|
||||
disabled={
|
||||
collectResultByRiotMatchMutation.isPending ||
|
||||
!manualRiotMatchId.trim()
|
||||
@@ -2631,7 +2620,7 @@ export default function MatchDetailPage() {
|
||||
{collectResultByRiotMatchMutation.isPending
|
||||
? "수집 중..."
|
||||
: "Match ID로 수집"}
|
||||
</button>
|
||||
</Btn>
|
||||
{formatManualCollectSummary(
|
||||
collectResultByRiotMatchMutation.data,
|
||||
) && (
|
||||
@@ -2682,6 +2671,7 @@ export default function MatchDetailPage() {
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</main>
|
||||
</PageBody>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
import { useState } from "react";
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import { ChevronLeft, ChevronRight } from "lucide-react";
|
||||
import { Link, useLocation, useParams } from "react-router";
|
||||
import {
|
||||
Area,
|
||||
@@ -52,6 +53,15 @@ import {
|
||||
SummonerSpellIcon,
|
||||
} from "../components/ItemTooltip";
|
||||
|
||||
import {
|
||||
Btn,
|
||||
EmptyNote,
|
||||
LoadingNote,
|
||||
MetaDot,
|
||||
PageBody,
|
||||
PageHero,
|
||||
PlainPage,
|
||||
} from "../ui";
|
||||
type MatchGameDetail = ApiInternalMatchDetailResponse["games"][number];
|
||||
type MatchGameTeam = MatchGameDetail["teams"][number];
|
||||
type MatchGameParticipant = MatchGameTeam["participants"][number];
|
||||
@@ -185,16 +195,16 @@ function sideLabel(side: TeamSide) {
|
||||
function sideTone(side: TeamSide) {
|
||||
return side === "blue"
|
||||
? {
|
||||
border: "border-blue-500/20",
|
||||
bg: "bg-blue-500/5",
|
||||
text: "text-blue-400",
|
||||
bar: "bg-blue-500",
|
||||
border: "border-win-line",
|
||||
bg: "bg-win-tint",
|
||||
text: "text-win",
|
||||
bar: "bg-win",
|
||||
}
|
||||
: {
|
||||
border: "border-red-500/20",
|
||||
bg: "bg-red-500/5",
|
||||
text: "text-red-400",
|
||||
bar: "bg-red-500",
|
||||
border: "border-loss-line",
|
||||
bg: "bg-loss-tint",
|
||||
text: "text-loss",
|
||||
bar: "bg-loss",
|
||||
};
|
||||
}
|
||||
|
||||
@@ -405,7 +415,7 @@ function PlayerIdentityCell({
|
||||
<div className="mt-0.5 flex items-center gap-1.5">
|
||||
<span className="text-xs text-base-content/35">{lane}</span>
|
||||
{(participant.firstBloodKill || participant.firstBloodAssist) && (
|
||||
<span className="inline-flex border border-amber-400/30 bg-amber-400/10 px-1 text-[10px] font-black text-amber-400">
|
||||
<span className="inline-flex border border-amber-400/30 bg-amber-400/10 px-1 text-[10px] font-black text-gold">
|
||||
{participant.firstBloodKill ? "FB" : "FBA"}
|
||||
</span>
|
||||
)}
|
||||
@@ -438,7 +448,7 @@ function PlayerRow({
|
||||
<div className="text-sm font-black tabular-nums text-base-content">
|
||||
{participant.kills}
|
||||
<span className="text-base-content/25"> / </span>
|
||||
<span className="text-red-400">{participant.deaths}</span>
|
||||
<span className="text-loss">{participant.deaths}</span>
|
||||
<span className="text-base-content/25"> / </span>
|
||||
{participant.assists}
|
||||
</div>
|
||||
@@ -519,7 +529,7 @@ function PlayerCard({
|
||||
<div className="text-sm font-black tabular-nums text-base-content">
|
||||
{participant.kills}
|
||||
<span className="text-base-content/25"> / </span>
|
||||
<span className="text-red-400">{participant.deaths}</span>
|
||||
<span className="text-loss">{participant.deaths}</span>
|
||||
<span className="text-base-content/25"> / </span>
|
||||
{participant.assists}
|
||||
</div>
|
||||
@@ -830,7 +840,7 @@ function ObjectiveComparisonStrip({
|
||||
<span
|
||||
className={`text-right font-black ${
|
||||
objective.blue > objective.red
|
||||
? "text-blue-400"
|
||||
? "text-win"
|
||||
: "text-base-content/50"
|
||||
}`}
|
||||
>
|
||||
@@ -842,7 +852,7 @@ function ObjectiveComparisonStrip({
|
||||
<span
|
||||
className={`font-black ${
|
||||
objective.red > objective.blue
|
||||
? "text-red-400"
|
||||
? "text-loss"
|
||||
: "text-base-content/50"
|
||||
}`}
|
||||
>
|
||||
@@ -851,10 +861,10 @@ function ObjectiveComparisonStrip({
|
||||
</div>
|
||||
{objective.key === "dragon" ? (
|
||||
<div className="mt-1 grid grid-cols-2 gap-2 text-[9px] font-bold leading-tight">
|
||||
<span className="text-right text-blue-400/70">
|
||||
<span className="text-right text-win">
|
||||
{objective.blueDetail}
|
||||
</span>
|
||||
<span className="text-red-400/70">{objective.redDetail}</span>
|
||||
<span className="text-loss">{objective.redDetail}</span>
|
||||
</div>
|
||||
) : null}
|
||||
</div>
|
||||
@@ -892,7 +902,7 @@ function GoldComparisonStrip({
|
||||
return (
|
||||
<div className="border-t border-base-content/8 bg-base-content/[0.01] px-4 py-3">
|
||||
<div className="grid gap-3 md:grid-cols-[minmax(0,1fr)_11rem_minmax(0,1fr)] md:items-center">
|
||||
<div className="min-w-0 text-blue-400">
|
||||
<div className="min-w-0 text-win">
|
||||
<div className="flex items-center justify-between gap-3 text-xs font-black">
|
||||
<span className="truncate">
|
||||
{getTeamName(detail, blueTeam.teamIndex)}
|
||||
@@ -903,7 +913,7 @@ function GoldComparisonStrip({
|
||||
</div>
|
||||
<div className="mt-1 h-1.5 bg-base-content/8">
|
||||
<div
|
||||
className="h-full bg-blue-500"
|
||||
className="h-full bg-win"
|
||||
style={{ width: barWidth(blueTotals.gold, maxGold) }}
|
||||
/>
|
||||
</div>
|
||||
@@ -915,9 +925,9 @@ function GoldComparisonStrip({
|
||||
<div
|
||||
className={`mt-1 text-lg font-black tabular-nums ${
|
||||
goldDiff > 0
|
||||
? "text-blue-400"
|
||||
? "text-win"
|
||||
: goldDiff < 0
|
||||
? "text-red-400"
|
||||
? "text-loss"
|
||||
: "text-base-content/55"
|
||||
}`}
|
||||
>
|
||||
@@ -927,7 +937,7 @@ function GoldComparisonStrip({
|
||||
{leaderName}
|
||||
</div>
|
||||
</div>
|
||||
<div className="min-w-0 text-red-400">
|
||||
<div className="min-w-0 text-loss">
|
||||
<div className="flex items-center justify-between gap-3 text-xs font-black">
|
||||
<span className="tabular-nums">{formatNumber(redTotals.gold)}</span>
|
||||
<span className="truncate text-right">
|
||||
@@ -936,7 +946,7 @@ function GoldComparisonStrip({
|
||||
</div>
|
||||
<div className="mt-1 h-1.5 bg-base-content/8">
|
||||
<div
|
||||
className="ml-auto h-full bg-red-500"
|
||||
className="ml-auto h-full bg-loss"
|
||||
style={{ width: barWidth(redTotals.gold, maxGold) }}
|
||||
/>
|
||||
</div>
|
||||
@@ -986,13 +996,13 @@ function TimelineTooltip({
|
||||
{leaderName} {formatSignedCompactNumber(point.value)}
|
||||
</div>
|
||||
<div className="mt-2 grid grid-cols-2 gap-3 tabular-nums">
|
||||
<div className="text-blue-400">
|
||||
<div className="text-win">
|
||||
{blueTeamName}
|
||||
<span className="block font-black">
|
||||
{formatNumber(point.blueTotal)}
|
||||
</span>
|
||||
</div>
|
||||
<div className="text-red-400">
|
||||
<div className="text-loss">
|
||||
{redTeamName}
|
||||
<span className="block font-black">
|
||||
{formatNumber(point.redTotal)}
|
||||
@@ -1308,9 +1318,9 @@ function TimelineGraph({
|
||||
</ResponsiveContainer>
|
||||
</div>
|
||||
<div className="mt-2 flex items-center justify-between gap-3 text-[11px] font-black uppercase tracking-wider">
|
||||
<span className="text-blue-400">{blueTeamName}</span>
|
||||
<span className="text-win">{blueTeamName}</span>
|
||||
<span className="text-base-content/25">0</span>
|
||||
<span className="text-red-400">{redTeamName}</span>
|
||||
<span className="text-loss">{redTeamName}</span>
|
||||
</div>
|
||||
</div>
|
||||
) : (
|
||||
@@ -1382,9 +1392,9 @@ function TimelineGraph({
|
||||
<span
|
||||
className={`text-[10px] font-black uppercase tracking-wider ${
|
||||
event.side === "blue"
|
||||
? "text-blue-400"
|
||||
? "text-win"
|
||||
: event.side === "red"
|
||||
? "text-red-400"
|
||||
? "text-loss"
|
||||
: "text-base-content/35"
|
||||
}`}
|
||||
>
|
||||
@@ -1513,54 +1523,88 @@ function GameTabs({
|
||||
currentGameNumber: number;
|
||||
navigationState: MatchGameNavigationState | undefined;
|
||||
}) {
|
||||
const currentRef = useRef<HTMLAnchorElement | null>(null);
|
||||
const currentIndex = detail.games.findIndex(
|
||||
(game) => game.gameNumber === currentGameNumber,
|
||||
);
|
||||
const previousGame = detail.games[currentIndex - 1];
|
||||
const nextGame = detail.games[currentIndex + 1];
|
||||
const pathFor = (gameNumber: number) =>
|
||||
internalMatchGamePath(communityId, detail.match.matchId, gameNumber);
|
||||
|
||||
useEffect(() => {
|
||||
currentRef.current?.scrollIntoView({ block: "nearest", inline: "center" });
|
||||
}, [currentGameNumber]);
|
||||
|
||||
const stepClass =
|
||||
"grid size-10 shrink-0 place-items-center rounded-[10px] text-content-muted transition-colors hover:bg-sunken hover:text-content aria-disabled:pointer-events-none aria-disabled:opacity-30";
|
||||
|
||||
return (
|
||||
<nav
|
||||
className="mt-4 flex overflow-x-auto border border-base-content/10 bg-base-100"
|
||||
className="lts-panel sticky top-[60px] z-30 flex items-center gap-1 p-1"
|
||||
aria-label="세트 선택"
|
||||
>
|
||||
{detail.games.map((game) => {
|
||||
const winnerTeam = game.teams.find((team) => team.win);
|
||||
const active = game.gameNumber === currentGameNumber;
|
||||
return (
|
||||
<Link
|
||||
key={game.gameNumber}
|
||||
to={internalMatchGamePath(
|
||||
communityId,
|
||||
detail.match.matchId,
|
||||
game.gameNumber,
|
||||
)}
|
||||
state={navigationState}
|
||||
className={`min-w-[8rem] border-r border-base-content/8 px-4 py-3 text-xs transition-colors last:border-r-0 ${
|
||||
active
|
||||
? "bg-primary/8 text-primary"
|
||||
: "text-base-content/45 hover:bg-base-content/[0.03] hover:text-base-content"
|
||||
}`}
|
||||
>
|
||||
<span className="block font-black">{game.gameNumber}세트</span>
|
||||
<span className="mt-1 block truncate">
|
||||
{winnerTeam
|
||||
? `${getTeamName(detail, winnerTeam.teamIndex)} 승`
|
||||
: "결과 대기"}
|
||||
</span>
|
||||
</Link>
|
||||
);
|
||||
})}
|
||||
<Link
|
||||
to={previousGame ? pathFor(previousGame.gameNumber) : "#"}
|
||||
state={navigationState}
|
||||
aria-disabled={!previousGame}
|
||||
tabIndex={previousGame ? undefined : -1}
|
||||
aria-label="이전 세트"
|
||||
className={stepClass}
|
||||
>
|
||||
<ChevronLeft className="size-4" aria-hidden="true" />
|
||||
</Link>
|
||||
<div className="no-scrollbar flex min-w-0 flex-1 gap-1 overflow-x-auto">
|
||||
{detail.games.map((game) => {
|
||||
const winnerTeam = game.teams.find((team) => team.win);
|
||||
const active = game.gameNumber === currentGameNumber;
|
||||
return (
|
||||
<Link
|
||||
key={game.gameNumber}
|
||||
ref={active ? currentRef : undefined}
|
||||
to={pathFor(game.gameNumber)}
|
||||
state={navigationState}
|
||||
aria-current={active ? "page" : undefined}
|
||||
className={`flex h-10 shrink-0 items-center gap-2 rounded-[10px] px-3.5 text-sm transition-colors ${
|
||||
active
|
||||
? "bg-secondary text-secondary-content dark:bg-white dark:text-[#14161b]"
|
||||
: "text-content-muted hover:bg-sunken hover:text-content"
|
||||
}`}
|
||||
>
|
||||
<span className="font-bold">{game.gameNumber}세트</span>
|
||||
<span
|
||||
className={`max-w-28 truncate text-xs ${active ? "opacity-80" : "text-content-subtle"}`}
|
||||
>
|
||||
{winnerTeam
|
||||
? `${getTeamName(detail, winnerTeam.teamIndex)} 승`
|
||||
: "결과 대기"}
|
||||
</span>
|
||||
</Link>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
<Link
|
||||
to={nextGame ? pathFor(nextGame.gameNumber) : "#"}
|
||||
state={navigationState}
|
||||
aria-disabled={!nextGame}
|
||||
tabIndex={nextGame ? undefined : -1}
|
||||
aria-label="다음 세트"
|
||||
className={stepClass}
|
||||
>
|
||||
<ChevronRight className="size-4" aria-hidden="true" />
|
||||
</Link>
|
||||
</nav>
|
||||
);
|
||||
}
|
||||
|
||||
function MatchScoreHero({
|
||||
detail,
|
||||
communityId,
|
||||
selectedGame,
|
||||
backTarget,
|
||||
navigationState,
|
||||
}: {
|
||||
detail: ApiInternalMatchDetailResponse;
|
||||
communityId: string;
|
||||
selectedGame: MatchGameDetail;
|
||||
backTarget: MatchGameBackTarget;
|
||||
navigationState: MatchGameNavigationState | undefined;
|
||||
}) {
|
||||
const selectedSeries = resolveSelectedSeries(detail, selectedGame);
|
||||
const [leftTeam, rightTeam] = selectedGame.teams;
|
||||
@@ -1572,77 +1616,78 @@ function MatchScoreHero({
|
||||
selectedSeries?.teamBIndex === rightTeam?.teamIndex
|
||||
? selectedSeries?.teamBWins
|
||||
: selectedSeries?.teamAWins;
|
||||
const sideTone = (side: TeamSide) =>
|
||||
side === "blue" ? "text-[#8fb6ff]" : "text-[#ff99a5]";
|
||||
|
||||
return (
|
||||
<section className="mt-5 border border-base-content/10 bg-base-content/[0.02] p-5">
|
||||
<div className="flex flex-col gap-5 lg:flex-row lg:items-center lg:justify-between">
|
||||
<div className="min-w-0">
|
||||
<Link
|
||||
to={backTarget.to}
|
||||
className="text-xs text-base-content/40 hover:text-base-content"
|
||||
>
|
||||
← {backTarget.label}
|
||||
</Link>
|
||||
<h1 className="mt-4 text-2xl font-black text-base-content">
|
||||
{detail.match.title} · {selectedGame.gameNumber}세트
|
||||
</h1>
|
||||
<p className="mt-2 text-sm text-base-content/45">
|
||||
{formatDateTime(selectedGame.gameCreation)} ·{" "}
|
||||
{formatDuration(selectedGame.gameDuration)} ·{" "}
|
||||
<span className="font-mono">{selectedGame.riotMatchId}</span>
|
||||
</p>
|
||||
</div>
|
||||
{leftTeam && rightTeam && (
|
||||
<div className="grid min-w-full grid-cols-[1fr_auto_1fr] items-center gap-4 lg:min-w-[440px]">
|
||||
<div
|
||||
className={`min-w-0 text-right ${
|
||||
leftTeam.win
|
||||
? teamIndexColorClasses(leftTeam.teamIndex).text
|
||||
: "text-base-content/30"
|
||||
}`}
|
||||
>
|
||||
<div className="truncate text-sm font-black">
|
||||
<PageHero
|
||||
width="xl"
|
||||
crumbs={[
|
||||
{ label: backTarget.label, to: backTarget.to },
|
||||
{ label: `${selectedGame.gameNumber}세트` },
|
||||
]}
|
||||
title={
|
||||
<>
|
||||
{detail.match.title}
|
||||
<span className="ml-2 text-on-ink-muted">
|
||||
{selectedGame.gameNumber}세트
|
||||
</span>
|
||||
</>
|
||||
}
|
||||
meta={
|
||||
<>
|
||||
<span>{formatDateTime(selectedGame.gameCreation)}</span>
|
||||
<MetaDot />
|
||||
<span className="tabular">
|
||||
{formatDuration(selectedGame.gameDuration)}
|
||||
</span>
|
||||
<MetaDot />
|
||||
<span className="font-mono text-xs">{selectedGame.riotMatchId}</span>
|
||||
</>
|
||||
}
|
||||
actions={
|
||||
leftTeam && rightTeam ? (
|
||||
<div className="grid w-full grid-cols-[1fr_auto_1fr] items-center gap-4 sm:w-auto sm:min-w-[400px]">
|
||||
<div className="min-w-0 text-right">
|
||||
<div
|
||||
className={`truncate text-[15px] font-bold ${leftTeam.win ? "text-on-ink" : "text-on-ink-muted"}`}
|
||||
>
|
||||
{getTeamName(detail, leftTeam.teamIndex)}
|
||||
</div>
|
||||
<div className="mt-1 text-xs font-bold text-base-content/35">
|
||||
<div
|
||||
className={`mt-0.5 text-xs font-semibold ${sideTone(leftTeam.side)}`}
|
||||
>
|
||||
{sideLabel(leftTeam.side)}
|
||||
{leftTeam.win && " · 세트 승"}
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex items-center gap-3 text-center">
|
||||
<span className="text-4xl font-black tabular-nums text-base-content">
|
||||
{leftScore ?? (leftTeam.win ? 1 : 0)}
|
||||
</span>
|
||||
<span className="text-xs font-black text-base-content/15">
|
||||
VS
|
||||
</span>
|
||||
<span className="text-4xl font-black tabular-nums text-base-content">
|
||||
{rightScore ?? (rightTeam.win ? 1 : 0)}
|
||||
</span>
|
||||
<div className="text-center">
|
||||
<div className="tabular flex items-baseline gap-2.5 text-4xl font-extrabold">
|
||||
<span>{leftScore ?? (leftTeam.win ? 1 : 0)}</span>
|
||||
<span className="text-xl text-on-ink-muted">:</span>
|
||||
<span>{rightScore ?? (rightTeam.win ? 1 : 0)}</span>
|
||||
</div>
|
||||
<div className="mt-0.5 text-[11px] font-semibold text-on-ink-muted">
|
||||
시리즈 스코어
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
className={`min-w-0 ${
|
||||
rightTeam.win
|
||||
? teamIndexColorClasses(rightTeam.teamIndex).text
|
||||
: "text-base-content/30"
|
||||
}`}
|
||||
>
|
||||
<div className="truncate text-sm font-black">
|
||||
<div className="min-w-0">
|
||||
<div
|
||||
className={`truncate text-[15px] font-bold ${rightTeam.win ? "text-on-ink" : "text-on-ink-muted"}`}
|
||||
>
|
||||
{getTeamName(detail, rightTeam.teamIndex)}
|
||||
</div>
|
||||
<div className="mt-1 text-xs font-bold text-base-content/35">
|
||||
<div
|
||||
className={`mt-0.5 text-xs font-semibold ${sideTone(rightTeam.side)}`}
|
||||
>
|
||||
{sideLabel(rightTeam.side)}
|
||||
{rightTeam.win && " · 세트 승"}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
<GameTabs
|
||||
detail={detail}
|
||||
communityId={communityId}
|
||||
currentGameNumber={selectedGame.gameNumber}
|
||||
navigationState={navigationState}
|
||||
/>
|
||||
</section>
|
||||
) : undefined
|
||||
}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1665,20 +1710,20 @@ export default function MatchGameDetailPage() {
|
||||
|
||||
if (detailQuery.isLoading) {
|
||||
return (
|
||||
<main className="mx-auto max-w-6xl px-4 py-20 text-center text-sm text-base-content/40">
|
||||
세트 상세 기록을 불러오는 중...
|
||||
</main>
|
||||
<PlainPage>
|
||||
<LoadingNote label="세트 기록을 불러오는 중" />
|
||||
</PlainPage>
|
||||
);
|
||||
}
|
||||
|
||||
if (detailQuery.error || !detail) {
|
||||
return (
|
||||
<main className="mx-auto max-w-6xl px-4 py-20 text-center">
|
||||
<h1 className="text-lg font-bold">세트 기록을 찾을 수 없습니다</h1>
|
||||
<Link to={backTarget.to} className="btn btn-ghost btn-sm mt-4">
|
||||
{backTarget.label}
|
||||
</Link>
|
||||
</main>
|
||||
<PlainPage>
|
||||
<EmptyNote
|
||||
title="세트 기록을 찾을 수 없습니다"
|
||||
action={<Btn to={backTarget.to}>{backTarget.label}</Btn>}
|
||||
/>
|
||||
</PlainPage>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1694,36 +1739,38 @@ export default function MatchGameDetailPage() {
|
||||
? `${requestedGameNumber}경기`
|
||||
: "요청한 경기";
|
||||
return (
|
||||
<main className="mx-auto max-w-6xl px-4 py-20 text-center">
|
||||
<h1 className="text-lg font-bold">
|
||||
{hasRecordedGames
|
||||
? "해당 경기 기록을 찾을 수 없습니다"
|
||||
: "수집된 세트 기록이 없습니다"}
|
||||
</h1>
|
||||
{hasRecordedGames && (
|
||||
<p className="mt-2 text-sm text-content-muted">
|
||||
{requestedGameLabel}가 현재 상세 기록에 없습니다.
|
||||
</p>
|
||||
)}
|
||||
<Link
|
||||
to={backTarget.to}
|
||||
className="btn btn-ghost btn-sm mt-4"
|
||||
>
|
||||
{backTarget.label}
|
||||
</Link>
|
||||
</main>
|
||||
<PlainPage>
|
||||
<EmptyNote
|
||||
title={
|
||||
hasRecordedGames
|
||||
? "해당 경기 기록을 찾을 수 없습니다"
|
||||
: "수집된 세트 기록이 없습니다"
|
||||
}
|
||||
description={
|
||||
hasRecordedGames
|
||||
? `${requestedGameLabel}가 현재 상세 기록에 없습니다.`
|
||||
: undefined
|
||||
}
|
||||
action={<Btn to={backTarget.to}>{backTarget.label}</Btn>}
|
||||
/>
|
||||
</PlainPage>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<main className="mx-auto max-w-6xl px-4 py-6 sm:px-6">
|
||||
<>
|
||||
<MatchScoreHero
|
||||
detail={detail}
|
||||
communityId={communityId}
|
||||
selectedGame={selectedGame}
|
||||
backTarget={backTarget}
|
||||
navigationState={navigationState}
|
||||
/>
|
||||
<PageBody width="xl">
|
||||
<GameTabs
|
||||
detail={detail}
|
||||
communityId={communityId}
|
||||
currentGameNumber={selectedGame.gameNumber}
|
||||
navigationState={navigationState}
|
||||
/>
|
||||
|
||||
<PostgameBreakdown
|
||||
selectedGame={selectedGame}
|
||||
@@ -1757,6 +1804,7 @@ export default function MatchGameDetailPage() {
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
</main>
|
||||
</PageBody>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -2,7 +2,7 @@ import type {
|
||||
CompetitionDetailResponse,
|
||||
SeriesProjection,
|
||||
} from "@lolympus/contracts";
|
||||
import { ArrowLeft, ChevronDown, UsersRound } from "lucide-react";
|
||||
import { ChevronDown, UsersRound } from "lucide-react";
|
||||
import { useEffect, useRef } from "react";
|
||||
import { Link, useParams, useSearchParams } from "react-router";
|
||||
import { useCompetition, useTeamCompetition } from "../api/hooks";
|
||||
@@ -23,6 +23,7 @@ import {
|
||||
sortTeamMembersForRoster,
|
||||
} from "./match-team-progress-view";
|
||||
|
||||
import { PageBody, PageHero } from "../ui";
|
||||
export default function MatchTeamProgressPage() {
|
||||
const { id } = useParams();
|
||||
const [searchParams] = useSearchParams();
|
||||
@@ -172,37 +173,31 @@ export default function MatchTeamProgressPage() {
|
||||
const rounds = competition.projection.rounds;
|
||||
|
||||
return (
|
||||
<main className="mx-auto max-w-5xl px-4 py-6 sm:px-6">
|
||||
<Link
|
||||
to={`/match/${id}`}
|
||||
className="mb-5 inline-flex min-h-11 items-center gap-1.5 text-sm font-bold text-content-muted hover:text-base-content focus-visible:ring-2 focus-visible:ring-primary"
|
||||
>
|
||||
<ArrowLeft className="h-4 w-4" aria-hidden="true" />
|
||||
내전 상세로
|
||||
</Link>
|
||||
|
||||
<header className="mb-8 flex flex-col gap-4 border-b border-base-content/10 pb-6 sm:flex-row sm:items-end sm:justify-between">
|
||||
<div className="min-w-0">
|
||||
<p className="text-xs font-bold text-content-muted">팀 경기 현황</p>
|
||||
<h1
|
||||
ref={contentHeadingRef}
|
||||
className="mt-1 min-w-0 break-words text-2xl font-black sm:text-3xl"
|
||||
tabIndex={-1}
|
||||
>
|
||||
<>
|
||||
<PageHero
|
||||
crumbs={[
|
||||
{ label: "내전", to: "/" },
|
||||
{ label: "내전 상세", to: `/match/${id}` },
|
||||
{ label: "팀 경기 현황" },
|
||||
]}
|
||||
eyebrow="팀 경기 현황"
|
||||
title={
|
||||
<span ref={contentHeadingRef} tabIndex={-1} className="outline-none">
|
||||
{team?.name ?? (selectedTeamId ? "팀" : "내 팀")}
|
||||
</h1>
|
||||
<p className="mt-2 max-w-2xl text-sm text-content-muted">
|
||||
다음 상대와 세트별 토너먼트 코드를 한곳에서 확인할 수 있습니다.
|
||||
</p>
|
||||
</div>
|
||||
<Link
|
||||
to={`/match/${id}/team?select=1`}
|
||||
className="inline-flex min-h-11 shrink-0 items-center justify-center gap-2 border border-base-content/20 bg-base-100 px-3 text-sm font-bold text-base-content hover:border-primary/40 hover:bg-primary/5 focus-visible:ring-2 focus-visible:ring-primary"
|
||||
>
|
||||
<UsersRound className="h-4 w-4" aria-hidden="true" />
|
||||
</span>
|
||||
}
|
||||
meta="다음 상대와 세트별 토너먼트 코드를 한곳에서 확인할 수 있습니다."
|
||||
actions={
|
||||
<Link
|
||||
to={`/match/${id}/team?select=1`}
|
||||
className="inline-flex h-10 shrink-0 items-center justify-center gap-2 rounded-field bg-white/10 px-4 text-sm font-bold text-on-ink transition-colors hover:bg-white/20"
|
||||
>
|
||||
<UsersRound className="h-4 w-4" aria-hidden="true" />
|
||||
팀 변경
|
||||
</Link>
|
||||
</header>
|
||||
</Link>
|
||||
}
|
||||
/>
|
||||
<PageBody>
|
||||
|
||||
<section className="mb-8" aria-labelledby="active-series-heading">
|
||||
<SectionHeading
|
||||
@@ -316,7 +311,8 @@ export default function MatchTeamProgressPage() {
|
||||
<EmptyState message="아직 종료된 대진이 없습니다." />
|
||||
)}
|
||||
</section>
|
||||
</main>
|
||||
</PageBody>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -353,24 +349,22 @@ function TeamSelectionState({
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<main className="mx-auto max-w-5xl px-4 py-6 sm:px-6">
|
||||
<Link
|
||||
to={`/match/${matchId}`}
|
||||
className="mb-5 inline-flex min-h-11 items-center gap-1.5 text-sm font-bold text-content-muted hover:text-base-content focus-visible:ring-2 focus-visible:ring-primary"
|
||||
>
|
||||
<ArrowLeft className="h-4 w-4" aria-hidden="true" />
|
||||
내전 상세로
|
||||
</Link>
|
||||
|
||||
<header className="mb-6 border-b border-base-content/10 pb-5">
|
||||
<p className="text-xs font-bold text-content-muted">팀 경기 현황</p>
|
||||
<h1 ref={headingRef} className="mt-1 text-2xl font-black" tabIndex={-1}>
|
||||
팀 선택
|
||||
</h1>
|
||||
<p className="mt-1 text-sm text-content-muted">
|
||||
진행 상황과 토너먼트 코드를 확인할 팀을 선택해 주세요.
|
||||
</p>
|
||||
</header>
|
||||
<>
|
||||
<PageHero
|
||||
crumbs={[
|
||||
{ label: "내전", to: "/" },
|
||||
{ label: "내전 상세", to: `/match/${matchId}` },
|
||||
{ label: "팀 선택" },
|
||||
]}
|
||||
eyebrow="팀 경기 현황"
|
||||
title={
|
||||
<span ref={headingRef} tabIndex={-1} className="outline-none">
|
||||
팀 선택
|
||||
</span>
|
||||
}
|
||||
meta="진행 상황과 토너먼트 코드를 확인할 팀을 선택해 주세요."
|
||||
/>
|
||||
<PageBody>
|
||||
|
||||
{competition.teams.length > 0 ? (
|
||||
<ul className="grid gap-3 sm:grid-cols-2">
|
||||
@@ -393,7 +387,8 @@ function TeamSelectionState({
|
||||
) : (
|
||||
<EmptyState message="구성된 팀이 없습니다." />
|
||||
)}
|
||||
</main>
|
||||
</PageBody>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,18 @@
|
||||
import { lazy, Suspense, useState } from "react";
|
||||
import { useQueryClient } from "@tanstack/react-query";
|
||||
import { ChevronDown, ChevronUp } from "lucide-react";
|
||||
import { Link, useLocation, useParams, useSearchParams } from "react-router";
|
||||
import { ChevronDown, ChevronUp, RefreshCw, X } from "lucide-react";
|
||||
import { useLocation, useParams, useSearchParams } from "react-router";
|
||||
import {
|
||||
Chip,
|
||||
EmptyNote,
|
||||
ErrorNote,
|
||||
MetaDot,
|
||||
PageBody,
|
||||
PageHero,
|
||||
Panel,
|
||||
PanelHeader,
|
||||
PlainPage,
|
||||
} from "../ui";
|
||||
import {
|
||||
useChampionStats,
|
||||
useDdragonManifest,
|
||||
@@ -52,6 +63,7 @@ import {
|
||||
RuneStyleIcon,
|
||||
SummonerSpellIcon,
|
||||
} from "../components/ItemTooltip";
|
||||
import { Btn } from "../ui/Btn";
|
||||
// recharts가 무거워 메인 번들에서 분리한다 (전적 페이지에서만 로드).
|
||||
const TierHistoryChart = lazy(() => import("../components/TierHistoryChart"));
|
||||
|
||||
@@ -128,18 +140,18 @@ function formatRefreshError(error: unknown) {
|
||||
}
|
||||
|
||||
function ratioClass(value: number) {
|
||||
if (value >= 55) return "text-blue-400";
|
||||
if (value >= 50) return "text-amber-400";
|
||||
return "text-base-content/50";
|
||||
if (value >= 60) return "text-loss";
|
||||
if (value >= 50) return "text-win";
|
||||
return "text-content-muted";
|
||||
}
|
||||
|
||||
function kdaClass(value: number) {
|
||||
if (value >= 4) return "text-amber-400";
|
||||
if (value >= 3) return "text-emerald-400";
|
||||
return "text-base-content/60";
|
||||
if (value >= 5) return "text-gold";
|
||||
if (value >= 3) return "text-leaf";
|
||||
return "text-content-muted";
|
||||
}
|
||||
|
||||
function FilterButton({
|
||||
function QueueTab({
|
||||
active,
|
||||
children,
|
||||
onClick,
|
||||
@@ -151,11 +163,13 @@ function FilterButton({
|
||||
return (
|
||||
<button
|
||||
type="button"
|
||||
role="tab"
|
||||
aria-selected={active}
|
||||
onClick={onClick}
|
||||
className={`px-3 py-2 text-xs font-semibold border-b-2 transition-colors ${
|
||||
className={`h-10 flex-none whitespace-nowrap rounded-[10px] px-4 text-sm font-bold transition-colors ${
|
||||
active
|
||||
? "border-primary text-primary bg-primary/5"
|
||||
: "border-transparent text-base-content/45 hover:text-base-content"
|
||||
? "bg-secondary text-secondary-content dark:bg-white dark:text-[#14161b]"
|
||||
: "text-content-muted hover:bg-sunken hover:text-content"
|
||||
}`}
|
||||
>
|
||||
{children}
|
||||
@@ -206,20 +220,22 @@ function SummaryCard({
|
||||
label,
|
||||
value,
|
||||
sub,
|
||||
valueClassName = "text-content",
|
||||
}: {
|
||||
label: string;
|
||||
value: React.ReactNode;
|
||||
sub?: React.ReactNode;
|
||||
valueClassName?: string;
|
||||
}) {
|
||||
return (
|
||||
<div className="border border-base-content/8 bg-base-100 p-4">
|
||||
<div className="text-xs font-bold uppercase tracking-wider text-base-content/30">
|
||||
{label}
|
||||
</div>
|
||||
<div className="mt-2 text-2xl font-bold text-base-content tabular-nums">
|
||||
<div className="px-4 py-3.5 sm:px-5">
|
||||
<div className="text-xs font-semibold text-content-subtle">{label}</div>
|
||||
<div
|
||||
className={`tabular mt-1 text-[22px] font-extrabold leading-tight ${valueClassName}`}
|
||||
>
|
||||
{value}
|
||||
</div>
|
||||
{sub && <div className="mt-1 text-xs text-base-content/40">{sub}</div>}
|
||||
{sub && <div className="tabular mt-0.5 text-xs text-content-muted">{sub}</div>}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -293,8 +309,8 @@ function ChampionStatsTable({
|
||||
{row.games}
|
||||
</td>
|
||||
<td className="px-3 py-3 text-center text-xs tabular-nums text-base-content/55">
|
||||
<span className="text-blue-400">{row.wins}</span> /{" "}
|
||||
<span className="text-red-400">{row.losses}</span>
|
||||
<span className="text-win">{row.wins}</span> /{" "}
|
||||
<span className="text-loss">{row.losses}</span>
|
||||
</td>
|
||||
<td
|
||||
className={`px-3 py-3 text-center text-sm font-bold tabular-nums ${kdaClass(row.kda)}`}
|
||||
@@ -522,8 +538,8 @@ function DetailStatBar({
|
||||
|
||||
function TeamHeader({ team }: { team: ApiRecentMatchTeam }) {
|
||||
const sideLabel = team.side === 100 ? "블루팀" : "레드팀";
|
||||
const sideClass = team.side === 100 ? "text-blue-400" : "text-red-400";
|
||||
const resultClass = team.win ? "text-blue-400" : "text-red-400";
|
||||
const sideClass = team.side === 100 ? "text-win" : "text-loss";
|
||||
const resultClass = team.win ? "text-win" : "text-loss";
|
||||
|
||||
return (
|
||||
<div className="px-3 py-1.5 flex flex-wrap items-center justify-between gap-2 border-b border-base-content/10">
|
||||
@@ -639,7 +655,7 @@ function ParticipantRow({
|
||||
<div className="font-bold text-base-content">
|
||||
{participant.kills}
|
||||
<span className="text-base-content/25"> / </span>
|
||||
<span className="text-red-400">{participant.deaths}</span>
|
||||
<span className="text-loss">{participant.deaths}</span>
|
||||
<span className="text-base-content/25"> / </span>
|
||||
{participant.assists}
|
||||
</div>
|
||||
@@ -862,16 +878,34 @@ function RecentMatchCard({
|
||||
const [expanded, setExpanded] = useState(false);
|
||||
const championName =
|
||||
championDisplayName(manifest, match.championId) ?? String(match.championId);
|
||||
const accent = match.win ? "border-l-blue-500" : "border-l-red-500";
|
||||
const resultClass = match.win ? "text-blue-400" : "text-red-400";
|
||||
const outcome = match.remake ? "remake" : match.win ? "win" : "loss";
|
||||
const surface = {
|
||||
win: "border-win-line bg-win-tint",
|
||||
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 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={`border border-l-4 ${accent} border-base-content/10 bg-base-100`}
|
||||
className={`relative overflow-hidden rounded-box border ${surface}`}
|
||||
>
|
||||
<div className="p-3 grid lg:grid-cols-[120px_1fr_120px_1.5fr_40px] gap-3 items-center">
|
||||
<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-bold ${resultClass}`}>
|
||||
<div className={`text-sm font-extrabold ${resultClass}`}>
|
||||
{match.remake ? "다시하기" : match.win ? "승리" : "패배"}
|
||||
</div>
|
||||
<div className="text-xs font-bold text-base-content/45 mt-1">
|
||||
@@ -912,7 +946,7 @@ function RecentMatchCard({
|
||||
<div className="text-lg font-bold tabular-nums">
|
||||
<span>{match.kills}</span>
|
||||
<span className="text-base-content/25"> / </span>
|
||||
<span className="text-red-400">{match.deaths}</span>
|
||||
<span className="text-loss">{match.deaths}</span>
|
||||
<span className="text-base-content/25"> / </span>
|
||||
<span>{match.assists}</span>
|
||||
</div>
|
||||
@@ -964,11 +998,11 @@ function RecentMatchCard({
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="flex justify-end">
|
||||
<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 border border-base-content/10 text-base-content/35 transition-colors hover:text-base-content/70 sm:w-auto sm:px-3 lg:h-14 lg:w-8 lg:border-0 lg:px-0"
|
||||
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 ? "상세 전적 접기" : "상세 전적 펼치기"}
|
||||
>
|
||||
@@ -984,7 +1018,7 @@ function RecentMatchCard({
|
||||
</div>
|
||||
</div>
|
||||
{expanded && (
|
||||
<div className="border-t border-base-content/10 bg-base-200/30">
|
||||
<div className="border-t border-line bg-card">
|
||||
<MatchDetailTabs
|
||||
match={match}
|
||||
manifest={manifest}
|
||||
@@ -1098,6 +1132,7 @@ export default function UserHistoryPage() {
|
||||
const [refreshResult, setRefreshResult] =
|
||||
useState<ApiEnqueueRefreshResult | null>(null);
|
||||
const [refreshNotice, setRefreshNotice] = useState<string | null>(null);
|
||||
const view = searchParams.get("view") === "champions" ? "champions" : "matches";
|
||||
const queueGroupParam = searchParams.get("queueGroup");
|
||||
const rankParam = searchParams.get("rank");
|
||||
const queueGroup: RiotQueueGroup = isRiotQueueGroup(queueGroupParam)
|
||||
@@ -1292,7 +1327,7 @@ export default function UserHistoryPage() {
|
||||
if (!DEFAULT_COMMUNITY_ID) {
|
||||
return (
|
||||
<main className="max-w-6xl mx-auto px-4 py-20 text-center">
|
||||
<span className="text-sm text-amber-600">
|
||||
<span className="text-sm text-gold">
|
||||
`VITE_DEFAULT_COMMUNITY_ID` 설정이 필요합니다.
|
||||
</span>
|
||||
</main>
|
||||
@@ -1305,12 +1340,17 @@ export default function UserHistoryPage() {
|
||||
|
||||
if (profileQuery.error || !profile) {
|
||||
return (
|
||||
<main className="max-w-6xl mx-auto px-4 py-20 text-center">
|
||||
<h2 className="text-lg font-bold mb-2">소환사를 찾을 수 없습니다</h2>
|
||||
<Link to="/" className="btn btn-ghost btn-sm mt-4">
|
||||
홈으로 돌아가기
|
||||
</Link>
|
||||
</main>
|
||||
<PlainPage>
|
||||
<EmptyNote
|
||||
title="소환사를 찾을 수 없습니다"
|
||||
description="계정 연결이 해제됐거나 잘못된 주소일 수 있습니다."
|
||||
action={
|
||||
<Btn to="/" variant="secondary">
|
||||
내전 목록으로
|
||||
</Btn>
|
||||
}
|
||||
/>
|
||||
</PlainPage>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1319,212 +1359,266 @@ export default function UserHistoryPage() {
|
||||
Boolean(refreshNotice?.startsWith("갱신 실패"));
|
||||
|
||||
return (
|
||||
<main className="max-w-6xl mx-auto px-4 sm:px-6 py-6">
|
||||
<Link
|
||||
to={backTo}
|
||||
className="inline-flex items-center gap-1 text-xs text-base-content/40 hover:text-base-content transition-colors mb-6"
|
||||
>
|
||||
← 이전으로
|
||||
</Link>
|
||||
|
||||
<section className="border border-base-content/10 bg-base-100 p-6 mb-6">
|
||||
<div className="flex flex-col sm:flex-row sm:items-center gap-4">
|
||||
<div className="w-16 h-16 bg-base-content/10 overflow-hidden shrink-0">
|
||||
<>
|
||||
<PageHero
|
||||
width="xl"
|
||||
crumbs={[{ label: "이전 화면", to: backTo }, { label: "소환사 전적" }]}
|
||||
media={
|
||||
<div className="relative shrink-0">
|
||||
<img
|
||||
src={profileIconUrl(ddragon, profile.profileIconId)}
|
||||
alt=""
|
||||
className="w-full h-full object-cover"
|
||||
className="size-[72px] rounded-2xl bg-ink-raised object-cover ring-2 ring-white/15 sm:size-[88px]"
|
||||
/>
|
||||
<span className="tabular absolute -bottom-2 left-1/2 -translate-x-1/2 rounded-full bg-ink-raised px-2 py-0.5 text-[11px] font-bold text-on-ink ring-1 ring-white/20">
|
||||
{profile.summonerLevel}
|
||||
</span>
|
||||
</div>
|
||||
<div className="flex-1 min-w-0">
|
||||
<div className="flex flex-wrap items-center gap-2">
|
||||
<h1 className="text-2xl font-bold text-base-content">
|
||||
{profile.gameName}
|
||||
</h1>
|
||||
<span className="text-sm text-base-content/35">
|
||||
#{profile.tagLine}
|
||||
</span>
|
||||
</div>
|
||||
<div className="mt-2 flex flex-wrap items-center gap-3 text-xs text-base-content/40">
|
||||
<span>Lv.{profile.summonerLevel}</span>
|
||||
<ResponsiveTierLabel tier={primaryTier} />
|
||||
<span>시즌: {profile.season.label}</span>
|
||||
<span>최근 저장: {formatLastFetched(profile.lastFetchedAt)}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex flex-col gap-2 text-xs sm:items-end">
|
||||
<p className="text-base-content/35 sm:text-right">
|
||||
{isInternalQueue
|
||||
? "내전 기록이 안 보이면 다시 불러오세요."
|
||||
: "버튼을 누르면 최신 전적으로 갱신됩니다."}
|
||||
</p>
|
||||
<button
|
||||
type="button"
|
||||
className="bg-primary px-3 py-2 text-xs font-bold text-primary-content transition-colors hover:bg-primary/90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-primary disabled:opacity-40"
|
||||
disabled={refreshMutation.isPending || !userId}
|
||||
onClick={handleRefresh}
|
||||
>
|
||||
{isInternalQueue
|
||||
? "내전 기록 다시 불러오기"
|
||||
: refreshMutation.isPending
|
||||
? "요청 중..."
|
||||
: "정보 갱신"}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
{(refreshNotice || refreshSocket.error) && (
|
||||
<div
|
||||
className={`mt-4 border px-3 py-2 text-xs ${
|
||||
refreshNoticeIsError
|
||||
? "border-red-400/30 bg-red-400/5 text-red-300"
|
||||
: "border-primary/15 bg-primary/5 text-base-content/55"
|
||||
}`}
|
||||
}
|
||||
title={
|
||||
<>
|
||||
{profile.gameName}
|
||||
<span className="ml-1.5 text-lg font-semibold text-on-ink-muted">
|
||||
#{profile.tagLine}
|
||||
</span>
|
||||
</>
|
||||
}
|
||||
meta={
|
||||
<>
|
||||
<ResponsiveTierLabel tier={primaryTier} />
|
||||
<MetaDot />
|
||||
<span>{profile.season.label}</span>
|
||||
<MetaDot />
|
||||
<span>최근 갱신 {formatLastFetched(profile.lastFetchedAt)}</span>
|
||||
</>
|
||||
}
|
||||
actions={
|
||||
<Btn
|
||||
variant="primary"
|
||||
size="lg"
|
||||
disabled={refreshMutation.isPending || !userId}
|
||||
loading={refreshMutation.isPending}
|
||||
icon={<RefreshCw className="size-4" aria-hidden="true" />}
|
||||
onClick={handleRefresh}
|
||||
>
|
||||
{refreshNotice ?? refreshSocket.error}
|
||||
</div>
|
||||
)}
|
||||
</section>
|
||||
|
||||
{profile.tierHistory.length > 0 && (
|
||||
<Suspense
|
||||
fallback={
|
||||
<div className="mb-6 h-[180px] border border-base-content/10 bg-base-100" />
|
||||
}
|
||||
>
|
||||
<TierHistoryChart entries={profile.tierHistory} />
|
||||
</Suspense>
|
||||
)}
|
||||
|
||||
<section className="border border-base-content/10 bg-base-100 mb-6">
|
||||
<div className="flex flex-wrap border-b border-base-content/8">
|
||||
{QUEUE_GROUP_TABS.map((tab) => (
|
||||
<FilterButton
|
||||
key={tab.value}
|
||||
active={queueGroup === tab.value}
|
||||
onClick={() =>
|
||||
updateSearch({ queueGroup: tab.value, championId: null })
|
||||
}
|
||||
{isInternalQueue ? "내전 기록 다시 불러오기" : "전적 갱신"}
|
||||
</Btn>
|
||||
}
|
||||
/>
|
||||
<PageBody width="xl" className="space-y-5">
|
||||
{(refreshNotice || refreshSocket.error) &&
|
||||
(refreshNoticeIsError ? (
|
||||
<ErrorNote
|
||||
title="전적을 갱신하지 못했습니다"
|
||||
description={refreshNotice ?? refreshSocket.error}
|
||||
/>
|
||||
) : (
|
||||
<div
|
||||
role="status"
|
||||
className="lts-panel flex items-center gap-2 px-4 py-3 text-sm text-content-muted"
|
||||
>
|
||||
{tab.label}
|
||||
</FilterButton>
|
||||
<RefreshCw className="size-4 text-primary" aria-hidden="true" />
|
||||
{refreshNotice}
|
||||
</div>
|
||||
))}
|
||||
|
||||
<div className="lts-panel sticky top-[60px] z-30 p-1">
|
||||
<div
|
||||
className="no-scrollbar flex gap-1 overflow-x-auto"
|
||||
role="tablist"
|
||||
aria-label="게임 모드"
|
||||
>
|
||||
{QUEUE_GROUP_TABS.map((tab) => (
|
||||
<QueueTab
|
||||
key={tab.value}
|
||||
active={queueGroup === tab.value}
|
||||
onClick={() =>
|
||||
updateSearch({ queueGroup: tab.value, championId: null })
|
||||
}
|
||||
>
|
||||
{tab.label}
|
||||
</QueueTab>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex flex-wrap items-center justify-between gap-3 px-3 py-2">
|
||||
|
||||
<div className="flex flex-wrap items-center justify-between gap-3">
|
||||
{!isInternalQueue ? (
|
||||
<div className="flex flex-wrap">
|
||||
<div
|
||||
className="flex flex-wrap gap-1.5"
|
||||
role="group"
|
||||
aria-label="큐 종류"
|
||||
>
|
||||
{RANK_FILTER_TABS.map((tab) => (
|
||||
<FilterButton
|
||||
<Chip
|
||||
key={tab.value}
|
||||
active={rank === tab.value}
|
||||
selected={rank === tab.value}
|
||||
onClick={() =>
|
||||
updateSearch({ rank: tab.value, championId: null })
|
||||
}
|
||||
>
|
||||
{tab.label}
|
||||
</FilterButton>
|
||||
</Chip>
|
||||
))}
|
||||
</div>
|
||||
) : (
|
||||
<div className="px-3 py-2 text-xs text-base-content/40">
|
||||
내전 탭은 토너먼트 코드 결과 수집 데이터를 기준으로 집계합니다.
|
||||
</div>
|
||||
<p className="text-[13px] text-content-muted">
|
||||
토너먼트 코드로 수집한 내전 결과만 집계합니다.
|
||||
</p>
|
||||
)}
|
||||
{selectedChampionName && (
|
||||
<button
|
||||
type="button"
|
||||
className="text-xs px-2.5 py-1 border border-primary/30 text-primary bg-primary/5"
|
||||
onClick={() => updateSearch({ championId: null })}
|
||||
>
|
||||
{selectedChampionName} 필터 해제
|
||||
</button>
|
||||
)}
|
||||
{profile.seasons.length > 0 && (
|
||||
<select
|
||||
value={filters.seasonId ?? profile.season.id}
|
||||
onChange={(event) =>
|
||||
updateSearch({ seasonId: event.target.value, championId: null })
|
||||
}
|
||||
className="border border-base-content/10 bg-transparent px-3 py-2 text-xs"
|
||||
>
|
||||
{profile.seasons.map((season) => (
|
||||
<option key={season.id} value={season.id}>
|
||||
{season.label}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
)}
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section className="mb-6">
|
||||
<h2 className="text-sm font-bold text-base-content mb-3">
|
||||
최근 {summary?.windowSize ?? 20}게임 전적 요약
|
||||
</h2>
|
||||
<div className="grid sm:grid-cols-2 lg:grid-cols-5 gap-3">
|
||||
<SummaryCard
|
||||
label="승률"
|
||||
value={`${summary?.winRate ?? 0}%`}
|
||||
sub={`${summary?.wins ?? 0}승 ${summary?.losses ?? 0}패`}
|
||||
/>
|
||||
<SummaryCard
|
||||
label="KDA"
|
||||
value={summary?.kda ?? 0}
|
||||
sub={`${summary?.avgKills ?? 0} / ${summary?.avgDeaths ?? 0} / ${summary?.avgAssists ?? 0}`}
|
||||
/>
|
||||
<SummaryCard
|
||||
label="최고 평점"
|
||||
value={summary?.bestRating?.rating ?? "-"}
|
||||
sub={
|
||||
summary?.bestRating
|
||||
? `${summary.bestRating.kills}/${summary.bestRating.deaths}/${summary.bestRating.assists}`
|
||||
: "기록 없음"
|
||||
}
|
||||
/>
|
||||
<SummaryCard
|
||||
label="연승/연패"
|
||||
value={
|
||||
summary?.streak
|
||||
? `${summary.streak.count}${summary.streak.type === "win" ? "연승" : "연패"}`
|
||||
: "-"
|
||||
}
|
||||
sub="가장 최근 경기 기준"
|
||||
/>
|
||||
<div className="border border-base-content/8 bg-base-100 p-4">
|
||||
<div className="text-xs font-bold uppercase tracking-wider text-base-content/30">
|
||||
자주 플레이한 챔피언
|
||||
</div>
|
||||
<div className="mt-3 flex items-center gap-3">
|
||||
{(summary?.topChampions ?? []).map((champion) => (
|
||||
<button
|
||||
type="button"
|
||||
key={champion.championId}
|
||||
className="text-center group"
|
||||
onClick={() =>
|
||||
updateSearch({ championId: champion.championId })
|
||||
}
|
||||
>
|
||||
<ChampionIcon
|
||||
championId={champion.championId}
|
||||
manifest={ddragon}
|
||||
/>
|
||||
<div className="mt-1 text-xs text-base-content/40 group-hover:text-primary">
|
||||
{champion.winRate}%
|
||||
</div>
|
||||
</button>
|
||||
))}
|
||||
{(summary?.topChampions ?? []).length === 0 && (
|
||||
<span className="text-xs text-base-content/25">기록 없음</span>
|
||||
)}
|
||||
</div>
|
||||
<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>
|
||||
</section>
|
||||
|
||||
<section className="mb-6">
|
||||
{profile.tierHistory.length > 0 && !isInternalQueue && (
|
||||
<Suspense fallback={<div className="lts-panel h-[180px]" />}>
|
||||
<TierHistoryChart entries={profile.tierHistory} />
|
||||
</Suspense>
|
||||
)}
|
||||
|
||||
<Panel>
|
||||
<PanelHeader
|
||||
title={`최근 ${summary?.windowSize ?? 20}게임 요약`}
|
||||
description={
|
||||
selectedChampionName
|
||||
? `${selectedChampionName} 경기만 집계`
|
||||
: undefined
|
||||
}
|
||||
/>
|
||||
<div className="grid grid-cols-2 divide-line max-lg:[&>*:nth-child(n+3)]:border-t max-lg:[&>*:nth-child(even)]:border-l lg:grid-cols-[repeat(4,minmax(0,1fr))_minmax(0,1.5fr)] lg:divide-x">
|
||||
<SummaryCard
|
||||
label="승률"
|
||||
value={summary ? `${summary.winRate}%` : "—"}
|
||||
valueClassName={summary ? ratioClass(summary.winRate) : undefined}
|
||||
sub={`${summary?.wins ?? 0}승 ${summary?.losses ?? 0}패`}
|
||||
/>
|
||||
<SummaryCard
|
||||
label="KDA"
|
||||
value={summary?.kda ?? "—"}
|
||||
valueClassName={summary ? kdaClass(summary.kda) : undefined}
|
||||
sub={`${summary?.avgKills ?? 0} / ${summary?.avgDeaths ?? 0} / ${summary?.avgAssists ?? 0}`}
|
||||
/>
|
||||
<SummaryCard
|
||||
label="최고 평점"
|
||||
value={summary?.bestRating?.rating ?? "—"}
|
||||
sub={
|
||||
summary?.bestRating
|
||||
? `${summary.bestRating.kills}/${summary.bestRating.deaths}/${summary.bestRating.assists}`
|
||||
: "기록 없음"
|
||||
}
|
||||
/>
|
||||
<SummaryCard
|
||||
label="흐름"
|
||||
value={
|
||||
summary?.streak
|
||||
? `${summary.streak.count}${summary.streak.type === "win" ? "연승" : "연패"}`
|
||||
: "—"
|
||||
}
|
||||
valueClassName={
|
||||
summary?.streak
|
||||
? summary.streak.type === "win"
|
||||
? "text-win"
|
||||
: "text-loss"
|
||||
: undefined
|
||||
}
|
||||
sub="가장 최근 경기 기준"
|
||||
/>
|
||||
<div className="col-span-2 px-4 py-3.5 sm:px-5 lg:col-span-1">
|
||||
<div className="text-xs font-semibold text-content-subtle">
|
||||
자주 플레이한 챔피언
|
||||
</div>
|
||||
<div className="mt-2 flex items-center gap-4">
|
||||
{(summary?.topChampions ?? []).map((champion) => (
|
||||
<button
|
||||
type="button"
|
||||
key={champion.championId}
|
||||
className="group flex items-center gap-2 text-left"
|
||||
aria-label={`${championDisplayName(ddragon, champion.championId) ?? champion.championId} 경기만 보기`}
|
||||
onClick={() =>
|
||||
updateSearch({ championId: champion.championId })
|
||||
}
|
||||
>
|
||||
<ChampionIcon
|
||||
championId={champion.championId}
|
||||
manifest={ddragon}
|
||||
className="rounded-full ring-2 ring-transparent transition-shadow group-hover:ring-primary"
|
||||
/>
|
||||
<span
|
||||
className={`tabular text-sm font-bold ${ratioClass(champion.winRate)}`}
|
||||
>
|
||||
{champion.winRate}%
|
||||
</span>
|
||||
</button>
|
||||
))}
|
||||
{(summary?.topChampions ?? []).length === 0 && (
|
||||
<span className="text-xs text-content-subtle">기록 없음</span>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Panel>
|
||||
|
||||
<div
|
||||
className="flex items-center gap-1.5"
|
||||
role="tablist"
|
||||
aria-label="전적 보기"
|
||||
>
|
||||
<Chip
|
||||
role="tab"
|
||||
aria-selected={view === "matches"}
|
||||
selected={view === "matches"}
|
||||
onClick={() => updateSearch({ view: null })}
|
||||
>
|
||||
매치 히스토리
|
||||
</Chip>
|
||||
<Chip
|
||||
role="tab"
|
||||
aria-selected={view === "champions"}
|
||||
selected={view === "champions"}
|
||||
onClick={() => updateSearch({ view: "champions" })}
|
||||
>
|
||||
챔피언 통계
|
||||
</Chip>
|
||||
<span className="ml-auto text-xs text-content-subtle">
|
||||
최근 저장 {formatLastFetched(historyLastFetchedAt)}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
{view === "champions" && (
|
||||
<section>
|
||||
<div className="flex flex-col sm:flex-row sm:items-end sm:justify-between gap-3 mb-3">
|
||||
<div>
|
||||
<h2 className="text-sm font-bold text-base-content">챔피언 통계</h2>
|
||||
<p className="mt-1 text-xs text-base-content/35">
|
||||
<h2 className="sr-only">챔피언 통계</h2>
|
||||
<p className="text-xs text-content-subtle">
|
||||
저장된 데이터를 기준으로 집계합니다. 최신 데이터가 반영되지 않을
|
||||
수 있습니다.
|
||||
</p>
|
||||
@@ -1534,14 +1628,14 @@ export default function UserHistoryPage() {
|
||||
value={championSearch}
|
||||
onChange={(event) => setChampionSearch(event.target.value)}
|
||||
placeholder="챔피언 검색"
|
||||
className="border border-base-content/10 bg-transparent px-3 py-2 text-xs focus:outline-none focus:border-primary/30"
|
||||
className="lts-input"
|
||||
/>
|
||||
<select
|
||||
value={sortKey}
|
||||
onChange={(event) =>
|
||||
setSortKey(event.target.value as ChampionSortKey)
|
||||
}
|
||||
className="border border-base-content/10 bg-transparent px-3 py-2 text-xs"
|
||||
className="lts-select"
|
||||
>
|
||||
{(Object.keys(SORT_LABELS) as ChampionSortKey[]).map((key) => (
|
||||
<option key={key} value={key}>
|
||||
@@ -1561,20 +1655,21 @@ export default function UserHistoryPage() {
|
||||
/>
|
||||
</section>
|
||||
|
||||
)}
|
||||
|
||||
{view === "matches" && (
|
||||
<section>
|
||||
<div className="flex items-center justify-between gap-3 mb-3">
|
||||
<h2 className="text-sm font-bold text-base-content">매치 히스토리</h2>
|
||||
<span className="text-xs text-base-content/35">
|
||||
최근 저장: {formatLastFetched(historyLastFetchedAt)}
|
||||
</span>
|
||||
</div>
|
||||
<h2 className="sr-only">매치 히스토리</h2>
|
||||
|
||||
{matchesLoading ? (
|
||||
<MatchListSkeleton />
|
||||
) : matches.length === 0 ? (
|
||||
<div className="border border-base-content/10 bg-base-100 px-4 py-10 text-center text-sm text-base-content/35">
|
||||
조건에 맞는 최근 경기 기록이 없습니다.
|
||||
</div>
|
||||
<Panel>
|
||||
<EmptyNote
|
||||
title="조건에 맞는 경기 기록이 없습니다"
|
||||
description="큐 종류나 시즌을 바꾸거나 전적을 갱신해 보세요."
|
||||
/>
|
||||
</Panel>
|
||||
) : (
|
||||
<div className="space-y-2">
|
||||
{matches.map((match) => (
|
||||
@@ -1591,20 +1686,24 @@ export default function UserHistoryPage() {
|
||||
)}
|
||||
|
||||
{hasNextPage && (
|
||||
<button
|
||||
type="button"
|
||||
className="mt-3 w-full border border-base-content/15 bg-base-100 py-3 text-sm font-bold text-base-content/60 hover:border-primary/30 hover:text-primary disabled:opacity-40"
|
||||
<Btn
|
||||
variant="secondary"
|
||||
size="lg"
|
||||
className="mt-3 w-full"
|
||||
disabled={isFetchingNextPage}
|
||||
loading={isFetchingNextPage}
|
||||
onClick={() =>
|
||||
isInternalQueue
|
||||
? internalHistoryQuery.fetchNextPage()
|
||||
: recentMatchesQuery.fetchNextPage()
|
||||
}
|
||||
>
|
||||
{isFetchingNextPage ? "불러오는 중..." : "+ 더 보기"}
|
||||
</button>
|
||||
더 보기
|
||||
</Btn>
|
||||
)}
|
||||
</section>
|
||||
</main>
|
||||
)}
|
||||
</PageBody>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useMemo, useState } from 'react';
|
||||
import { useQueryClient } from '@tanstack/react-query';
|
||||
import { Link, useParams } from 'react-router';
|
||||
import { useParams } from 'react-router';
|
||||
import {
|
||||
useCancelLegacyImport,
|
||||
useLegacyImportJobs,
|
||||
@@ -15,6 +15,8 @@ import type {
|
||||
} from '../../api/types';
|
||||
import { DEFAULT_COMMUNITY_ID } from '../../config';
|
||||
|
||||
import { Btn } from "../../ui/Btn";
|
||||
import { AdminNotice, AdminPage } from '../../components/AdminPage';
|
||||
const DEFAULT_START = '2024-05-01T00:00:00.000Z';
|
||||
|
||||
type MemberWindowOverride = { startTime: string; endTime: string };
|
||||
@@ -91,14 +93,13 @@ function JobCard({
|
||||
</div>
|
||||
</div>
|
||||
{running && (
|
||||
<button
|
||||
type="button"
|
||||
className="btn btn-ghost btn-xs px-3 text-red-400"
|
||||
<Btn
|
||||
variant="ghost" size="sm"
|
||||
disabled={cancelling}
|
||||
onClick={() => onCancel(job.jobId)}
|
||||
>
|
||||
취소
|
||||
</button>
|
||||
</Btn>
|
||||
)}
|
||||
</div>
|
||||
<div className="mt-3 h-2 bg-base-content/8">
|
||||
@@ -206,64 +207,52 @@ export default function LegacyImportPage() {
|
||||
|
||||
if (!communityId) {
|
||||
return (
|
||||
<main className="max-w-5xl mx-auto px-4 py-20 text-center">
|
||||
<h1 className="text-lg font-bold">커뮤니티 설정이 필요합니다</h1>
|
||||
</main>
|
||||
<AdminNotice title="커뮤니티 설정이 필요합니다" />
|
||||
);
|
||||
}
|
||||
|
||||
if (meQuery.isPending) {
|
||||
return (
|
||||
<main className="max-w-5xl mx-auto px-4 py-20 text-center">
|
||||
<h1 className="text-lg font-bold">권한 확인 중...</h1>
|
||||
</main>
|
||||
<AdminNotice title="권한 확인 중..." />
|
||||
);
|
||||
}
|
||||
|
||||
if (!canManage) {
|
||||
return (
|
||||
<main className="max-w-5xl mx-auto px-4 py-20 text-center">
|
||||
<h1 className="text-lg font-bold">권한이 필요합니다</h1>
|
||||
<AdminNotice title="권한이 필요합니다">
|
||||
<p className="mt-2 text-sm text-base-content/40">
|
||||
Legacy 백필은 owner/admin만 실행할 수 있습니다.
|
||||
</p>
|
||||
{manageableMemberships.length > 0 && (
|
||||
<div className="mt-5 flex flex-wrap justify-center gap-2">
|
||||
{manageableMemberships.map((membership) => (
|
||||
<Link
|
||||
<Btn
|
||||
key={membership.community?._id ?? membership.user._id}
|
||||
to={`/admin/communities/${membership.community?._id}/legacy-import`}
|
||||
className="btn btn-primary btn-sm px-4 text-xs"
|
||||
variant="primary"
|
||||
>
|
||||
{membership.community?.name ?? '관리 가능한 커뮤니티'}로 이동
|
||||
</Link>
|
||||
</Btn>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
</main>
|
||||
</AdminNotice>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<main className="max-w-6xl mx-auto px-4 sm:px-6 py-6">
|
||||
<Link to="/" className="inline-flex text-xs text-base-content/40 hover:text-base-content mb-5">
|
||||
← 목록으로
|
||||
</Link>
|
||||
<div className="mb-6 flex flex-col sm:flex-row sm:items-end sm:justify-between gap-3">
|
||||
<div>
|
||||
<h1 className="text-2xl font-black text-base-content">
|
||||
Legacy 내전 백필
|
||||
</h1>
|
||||
<p className="mt-1 text-sm text-base-content/45">
|
||||
커뮤니티 멤버 PUUID로 과거 `type=tourney` 매치를 찾아 내전 기록으로 import합니다.
|
||||
</p>
|
||||
</div>
|
||||
<Link
|
||||
<AdminPage
|
||||
communityId={communityId}
|
||||
title="Legacy 내전 백필"
|
||||
description="커뮤니티 멤버 PUUID로 과거 type=tourney 매치를 찾아 내전 기록으로 import합니다."
|
||||
>
|
||||
<div className="mb-4 flex flex-wrap items-center justify-end gap-2">
|
||||
<Btn
|
||||
to={`/admin/communities/${communityId}/legacy-matches`}
|
||||
className="btn btn-ghost btn-sm px-4 text-xs"
|
||||
variant="ghost"
|
||||
>
|
||||
Legacy 매치 정리
|
||||
</Link>
|
||||
</Btn>
|
||||
</div>
|
||||
|
||||
<section className="border border-base-content/10 bg-base-100 p-4 mb-6">
|
||||
@@ -275,7 +264,7 @@ export default function LegacyImportPage() {
|
||||
type="datetime-local"
|
||||
value={windowStart}
|
||||
onChange={(event) => setWindowStart(event.target.value)}
|
||||
className="mt-1 w-full border border-base-content/10 bg-transparent px-3 py-2 text-xs"
|
||||
className="lts-input mt-1 w-full"
|
||||
/>
|
||||
</label>
|
||||
<label className="text-xs text-base-content/45">
|
||||
@@ -285,12 +274,11 @@ export default function LegacyImportPage() {
|
||||
value={windowEnd}
|
||||
onChange={(event) => setWindowEnd(event.target.value)}
|
||||
placeholder="비우면 지금"
|
||||
className="mt-1 w-full border border-base-content/10 bg-transparent px-3 py-2 text-xs"
|
||||
className="lts-input mt-1 w-full"
|
||||
/>
|
||||
</label>
|
||||
<button
|
||||
type="button"
|
||||
className="btn btn-primary btn-sm px-5 text-xs"
|
||||
<Btn
|
||||
variant="primary"
|
||||
disabled={startMutation.isPending || Boolean(runningJob)}
|
||||
onClick={handleStart}
|
||||
>
|
||||
@@ -299,7 +287,7 @@ export default function LegacyImportPage() {
|
||||
: startMutation.isPending
|
||||
? '시작 중...'
|
||||
: '백필 시작'}
|
||||
</button>
|
||||
</Btn>
|
||||
</div>
|
||||
{message && (
|
||||
<div className="mt-3 border border-primary/15 bg-primary/5 px-3 py-2 text-xs text-base-content/55">
|
||||
@@ -317,7 +305,7 @@ export default function LegacyImportPage() {
|
||||
</p>
|
||||
</div>
|
||||
<div className="overflow-x-auto">
|
||||
<table className="w-full min-w-[900px] text-left">
|
||||
<table className="lts-table min-w-[900px]">
|
||||
<thead>
|
||||
<tr className="bg-base-200/40 border-b border-base-content/10 text-xs uppercase tracking-wider text-base-content/35">
|
||||
<th className="px-3 py-2">멤버</th>
|
||||
@@ -363,7 +351,7 @@ export default function LegacyImportPage() {
|
||||
};
|
||||
})
|
||||
}
|
||||
className="border border-base-content/10 bg-transparent px-2 py-1 text-xs"
|
||||
className="lts-input"
|
||||
/>
|
||||
</td>
|
||||
<td className="px-3 py-2">
|
||||
@@ -384,7 +372,7 @@ export default function LegacyImportPage() {
|
||||
};
|
||||
})
|
||||
}
|
||||
className="border border-base-content/10 bg-transparent px-2 py-1 text-xs"
|
||||
className="lts-input"
|
||||
/>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -422,6 +410,6 @@ export default function LegacyImportPage() {
|
||||
</div>
|
||||
)}
|
||||
</section>
|
||||
</main>
|
||||
</AdminPage>
|
||||
);
|
||||
}
|
||||
@@ -12,6 +12,8 @@ import type { LegacyMatchListItem } from '../../api/types';
|
||||
import { DEFAULT_COMMUNITY_ID } from '../../config';
|
||||
import { teamIndexLabel } from '../../lib/league';
|
||||
|
||||
import { Btn } from "../../ui/Btn";
|
||||
import { AdminNotice, AdminPage } from '../../components/AdminPage';
|
||||
function formatDate(value: string) {
|
||||
return new Intl.DateTimeFormat('ko-KR', {
|
||||
year: 'numeric',
|
||||
@@ -74,52 +76,36 @@ export default function LegacyMatchesPage() {
|
||||
|
||||
if (!communityId) {
|
||||
return (
|
||||
<main className="max-w-5xl mx-auto px-4 py-20 text-center">
|
||||
<h1 className="text-lg font-bold">커뮤니티 설정이 필요합니다</h1>
|
||||
</main>
|
||||
<AdminNotice title="커뮤니티 설정이 필요합니다" />
|
||||
);
|
||||
}
|
||||
|
||||
if (meQuery.isPending) {
|
||||
return (
|
||||
<main className="max-w-5xl mx-auto px-4 py-20 text-center">
|
||||
<h1 className="text-lg font-bold">권한 확인 중...</h1>
|
||||
</main>
|
||||
<AdminNotice title="권한 확인 중..." />
|
||||
);
|
||||
}
|
||||
|
||||
if (!canManage) {
|
||||
return (
|
||||
<main className="max-w-5xl mx-auto px-4 py-20 text-center">
|
||||
<h1 className="text-lg font-bold">권한이 필요합니다</h1>
|
||||
<AdminNotice title="권한이 필요합니다">
|
||||
<p className="mt-2 text-sm text-base-content/40">
|
||||
Legacy 매치 정리는 owner/admin만 사용할 수 있습니다.
|
||||
</p>
|
||||
</main>
|
||||
</AdminNotice>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<main className="max-w-6xl mx-auto px-4 sm:px-6 py-6">
|
||||
<Link
|
||||
to={`/admin/communities/${communityId}/legacy-import`}
|
||||
className="inline-flex text-xs text-base-content/40 hover:text-base-content mb-5"
|
||||
>
|
||||
← Legacy 백필
|
||||
</Link>
|
||||
<div className="mb-6 flex flex-col sm:flex-row sm:items-end sm:justify-between gap-3">
|
||||
<div>
|
||||
<h1 className="text-2xl font-black text-base-content">
|
||||
Legacy 매치 정리
|
||||
</h1>
|
||||
<p className="mt-1 text-sm text-base-content/45">
|
||||
백필로 들어온 매치를 확인하고 외부 토너먼트 기록을 삭제할 수 있습니다.
|
||||
</p>
|
||||
</div>
|
||||
<div className="flex flex-wrap gap-2">
|
||||
<button
|
||||
type="button"
|
||||
className="btn btn-primary btn-sm px-4 text-xs"
|
||||
<AdminPage
|
||||
communityId={communityId}
|
||||
title="Legacy 매치 정리"
|
||||
description="백필로 들어온 매치를 확인하고 외부 토너먼트 기록을 삭제할 수 있습니다."
|
||||
>
|
||||
<div className="mb-4 flex flex-wrap items-center justify-end gap-2">
|
||||
<div className="flex flex-wrap gap-2">
|
||||
<Btn
|
||||
variant="primary"
|
||||
disabled={rebuildMutation.isPending}
|
||||
onClick={() => {
|
||||
if (!window.confirm('현재 가입자 기준으로 과거 매치를 재구성할까요?')) {
|
||||
@@ -129,10 +115,9 @@ export default function LegacyMatchesPage() {
|
||||
}}
|
||||
>
|
||||
{rebuildMutation.isPending ? '재구성 중...' : '과거 데이터 재구성'}
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className="btn btn-ghost btn-sm px-4 text-xs text-red-400"
|
||||
</Btn>
|
||||
<Btn
|
||||
variant="ghost"
|
||||
disabled={selectedIds.length === 0 || bulkDeleteMutation.isPending}
|
||||
onClick={() => {
|
||||
if (!window.confirm(`${selectedIds.length}개 매치를 삭제할까요?`)) return;
|
||||
@@ -145,7 +130,7 @@ export default function LegacyMatchesPage() {
|
||||
}}
|
||||
>
|
||||
선택 삭제 ({selectedIds.length})
|
||||
</button>
|
||||
</Btn>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -157,9 +142,9 @@ export default function LegacyMatchesPage() {
|
||||
</div>
|
||||
)}
|
||||
|
||||
<section className="border border-base-content/10 bg-base-100 overflow-hidden">
|
||||
<section className="lts-panel overflow-hidden">
|
||||
<div className="overflow-x-auto">
|
||||
<table className="w-full min-w-[900px] text-left">
|
||||
<table className="lts-table min-w-[900px]">
|
||||
<thead>
|
||||
<tr className="bg-base-200/40 border-b border-base-content/10 text-xs uppercase tracking-wider text-base-content/35">
|
||||
<th className="px-3 py-2 w-8">
|
||||
@@ -218,7 +203,7 @@ export default function LegacyMatchesPage() {
|
||||
<td className="px-3 py-2 text-right">
|
||||
<button
|
||||
type="button"
|
||||
className="text-xs px-2 py-1 border border-red-500/20 text-red-400 hover:bg-red-500/10"
|
||||
className="text-xs px-2 py-1 border border-loss-line text-loss hover:bg-loss-tint"
|
||||
disabled={deleteMutation.isPending}
|
||||
onClick={() => {
|
||||
if (!window.confirm('이 매치를 삭제할까요?')) return;
|
||||
@@ -254,6 +239,6 @@ export default function LegacyMatchesPage() {
|
||||
{matchesQuery.isFetchingNextPage ? '불러오는 중...' : '+ 더 보기'}
|
||||
</button>
|
||||
)}
|
||||
</main>
|
||||
</AdminPage>
|
||||
);
|
||||
}
|
||||
@@ -16,6 +16,8 @@ import {
|
||||
import type { MatchMutationRequest } from '../../api/types';
|
||||
import { DEFAULT_COMMUNITY_ID } from '../../config';
|
||||
|
||||
import { Btn } from "../../ui/Btn";
|
||||
import { AdminNotice, AdminPage } from '../../components/AdminPage';
|
||||
const DEFAULT_FORM: MatchMutationRequest = {
|
||||
title: '',
|
||||
description: '',
|
||||
@@ -246,30 +248,24 @@ export default function MatchAdminPage() {
|
||||
|
||||
if (!canManage && !meQuery.isPending) {
|
||||
return (
|
||||
<main className="max-w-5xl mx-auto px-4 py-20 text-center">
|
||||
<h1 className="text-lg font-bold">권한이 필요합니다</h1>
|
||||
<AdminNotice title="권한이 필요합니다">
|
||||
<p className="mt-2 text-sm text-base-content/40">
|
||||
내전 관리는 owner/admin만 사용할 수 있습니다.
|
||||
</p>
|
||||
</main>
|
||||
</AdminNotice>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<main className="max-w-6xl mx-auto px-4 sm:px-6 py-6">
|
||||
<Link to="/" className="inline-flex text-xs text-base-content/40 hover:text-base-content mb-5">
|
||||
← 목록으로
|
||||
</Link>
|
||||
<div className="mb-6 flex flex-col sm:flex-row sm:items-end sm:justify-between gap-3">
|
||||
<div>
|
||||
<h1 className="text-2xl font-black text-base-content">내전 관리</h1>
|
||||
<p className="mt-1 text-sm text-base-content/45">
|
||||
내전 생성, 모집 정원, 게임 모드와 공지 내용을 관리합니다.
|
||||
</p>
|
||||
</div>
|
||||
<button type="button" className="btn btn-primary btn-sm px-5 text-xs" onClick={openCreate}>
|
||||
<AdminPage
|
||||
communityId={communityId}
|
||||
title="내전 관리"
|
||||
description="내전 생성, 모집 정원, 게임 모드와 공지 내용을 관리합니다."
|
||||
>
|
||||
<div className="mb-4 flex flex-wrap items-center justify-end gap-2">
|
||||
<Btn variant="primary" onClick={openCreate}>
|
||||
새 내전 만들기
|
||||
</button>
|
||||
</Btn>
|
||||
</div>
|
||||
|
||||
{message && (
|
||||
@@ -301,7 +297,7 @@ export default function MatchAdminPage() {
|
||||
required
|
||||
value={form.title}
|
||||
onChange={(event) => setForm((current) => ({ ...current, title: event.target.value }))}
|
||||
className="mt-1 w-full border border-base-content/10 bg-transparent px-3 py-2 text-sm"
|
||||
className="lts-input mt-1 w-full"
|
||||
/>
|
||||
</label>
|
||||
<label className="text-xs text-base-content/45 md:col-span-2">
|
||||
@@ -311,7 +307,7 @@ export default function MatchAdminPage() {
|
||||
value={form.description}
|
||||
onChange={(event) => setForm((current) => ({ ...current, description: event.target.value }))}
|
||||
rows={3}
|
||||
className="mt-1 w-full border border-base-content/10 bg-transparent px-3 py-2 text-sm"
|
||||
className="lts-textarea mt-1 w-full"
|
||||
/>
|
||||
</label>
|
||||
<label className="text-xs text-base-content/45">
|
||||
@@ -322,7 +318,7 @@ export default function MatchAdminPage() {
|
||||
type="datetime-local"
|
||||
value={form.scheduledAt}
|
||||
onChange={(event) => setForm((current) => ({ ...current, scheduledAt: event.target.value }))}
|
||||
className="mt-1 w-full border border-base-content/10 bg-transparent px-3 py-2 text-sm"
|
||||
className="lts-input mt-1 w-full"
|
||||
/>
|
||||
</label>
|
||||
<label className="text-xs text-base-content/45">
|
||||
@@ -340,7 +336,7 @@ export default function MatchAdminPage() {
|
||||
),
|
||||
}));
|
||||
}}
|
||||
className="mt-1 w-full border border-base-content/10 bg-transparent px-3 py-2 text-sm"
|
||||
className="lts-select mt-1 w-full"
|
||||
>
|
||||
{(form.gameMode === 'double-elimination'
|
||||
? [20, 40]
|
||||
@@ -358,7 +354,7 @@ export default function MatchAdminPage() {
|
||||
step={form.gameMode === 'double-elimination' ? 2 : 1}
|
||||
value={form.gameCount}
|
||||
onChange={(event) => setForm((current) => ({ ...current, gameCount: Number(event.target.value) }))}
|
||||
className="mt-1 w-full border border-base-content/10 bg-transparent px-3 py-2 text-sm"
|
||||
className="lts-input mt-1 w-full"
|
||||
/>
|
||||
{form.gameMode === 'double-elimination' && (
|
||||
<span className="mt-1 block text-xs text-base-content/30">
|
||||
@@ -388,13 +384,13 @@ export default function MatchAdminPage() {
|
||||
: current.gameCount,
|
||||
}));
|
||||
}}
|
||||
className="mt-1 w-full border border-base-content/10 bg-transparent px-3 py-2 text-sm"
|
||||
className="lts-select mt-1 w-full"
|
||||
>
|
||||
{Object.entries(GAME_MODE_LABEL).map(([value, label]) => (
|
||||
<option key={value} value={value}>{label}</option>
|
||||
))}
|
||||
</select>
|
||||
<span className="mt-1 block text-xs text-amber-500/80">
|
||||
<span className="mt-1 block text-xs text-gold">
|
||||
현재 경매/코드 연결은 페어 방식 기준으로 동작합니다.
|
||||
</span>
|
||||
</label>
|
||||
@@ -417,7 +413,7 @@ export default function MatchAdminPage() {
|
||||
: Number(event.target.value),
|
||||
}))
|
||||
}
|
||||
className="mt-1 w-full border border-base-content/10 bg-transparent px-3 py-2 text-sm"
|
||||
className="lts-input mt-1 w-full"
|
||||
/>
|
||||
<span className="mt-1 block text-xs text-base-content/30">
|
||||
비워두면 전체 {roundRobinFullRoundCount}라운드로 생성됩니다.
|
||||
@@ -446,7 +442,7 @@ export default function MatchAdminPage() {
|
||||
value={form.prizesText}
|
||||
onChange={(event) => setForm((current) => ({ ...current, prizesText: event.target.value }))}
|
||||
rows={4}
|
||||
className="mt-1 w-full border border-base-content/10 bg-transparent px-3 py-2 text-sm"
|
||||
className="lts-textarea mt-1 w-full"
|
||||
/>
|
||||
</label>
|
||||
<label className="text-xs text-base-content/45">
|
||||
@@ -455,7 +451,7 @@ export default function MatchAdminPage() {
|
||||
value={form.noticesText}
|
||||
onChange={(event) => setForm((current) => ({ ...current, noticesText: event.target.value }))}
|
||||
rows={4}
|
||||
className="mt-1 w-full border border-base-content/10 bg-transparent px-3 py-2 text-sm"
|
||||
className="lts-textarea mt-1 w-full"
|
||||
/>
|
||||
</label>
|
||||
<label className="text-xs text-base-content/45 md:col-span-2">
|
||||
@@ -465,34 +461,32 @@ export default function MatchAdminPage() {
|
||||
onChange={(event) => setForm((current) => ({ ...current, scheduleText: event.target.value }))}
|
||||
rows={3}
|
||||
placeholder="20:50|로비 오픈"
|
||||
className="mt-1 w-full border border-base-content/10 bg-transparent px-3 py-2 text-sm font-mono"
|
||||
className="lts-textarea mt-1 w-full font-mono"
|
||||
/>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div className="mt-4 flex gap-2">
|
||||
<button
|
||||
type="button"
|
||||
className="btn btn-primary btn-sm px-5 text-xs"
|
||||
<Btn
|
||||
variant="primary"
|
||||
disabled={createMutation.isPending || updateMutation.isPending}
|
||||
onClick={submit}
|
||||
>
|
||||
{editing ? '수정 저장' : '생성'}
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className="btn btn-ghost btn-sm px-5 text-xs"
|
||||
</Btn>
|
||||
<Btn
|
||||
variant="ghost"
|
||||
onClick={() => setShowForm(false)}
|
||||
>
|
||||
취소
|
||||
</button>
|
||||
</Btn>
|
||||
</div>
|
||||
</section>
|
||||
)}
|
||||
|
||||
<section className="border border-base-content/10 bg-base-100 overflow-hidden">
|
||||
<section className="lts-panel overflow-hidden">
|
||||
<div className="overflow-x-auto">
|
||||
<table className="w-full min-w-[900px] text-left">
|
||||
<table className="lts-table min-w-[900px]">
|
||||
<thead>
|
||||
<tr className="bg-base-200/40 border-b border-base-content/10 text-xs uppercase tracking-wider text-base-content/35">
|
||||
<th className="px-3 py-2">시간</th>
|
||||
@@ -549,7 +543,7 @@ export default function MatchAdminPage() {
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className="text-xs px-2 py-1 border border-red-500/20 text-red-400 hover:bg-red-500/10"
|
||||
className="text-xs px-2 py-1 border border-loss-line text-loss hover:bg-loss-tint"
|
||||
disabled={
|
||||
deleteMutation.isPending ||
|
||||
match.status !== 'recruiting'
|
||||
@@ -585,6 +579,6 @@ export default function MatchAdminPage() {
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
</AdminPage>
|
||||
);
|
||||
}
|
||||
@@ -15,6 +15,8 @@ import type {
|
||||
} from '../../api/types';
|
||||
import { DEFAULT_COMMUNITY_ID } from '../../config';
|
||||
|
||||
import { Btn } from "../../ui/Btn";
|
||||
import { AdminNotice, AdminPage } from '../../components/AdminPage';
|
||||
const STATES: TournamentCodeState[] = [
|
||||
'available',
|
||||
'reserved',
|
||||
@@ -135,68 +137,55 @@ export default function TournamentCodesPage() {
|
||||
|
||||
if (!communityId) {
|
||||
return (
|
||||
<main className="max-w-5xl mx-auto px-4 py-20 text-center">
|
||||
<h1 className="text-lg font-bold">커뮤니티 설정이 필요합니다</h1>
|
||||
<AdminNotice title="커뮤니티 설정이 필요합니다">
|
||||
<p className="mt-2 text-sm text-base-content/40">
|
||||
`VITE_DEFAULT_COMMUNITY_ID`를 설정하거나 올바른 커뮤니티 경로로
|
||||
접속해주세요.
|
||||
</p>
|
||||
</main>
|
||||
</AdminNotice>
|
||||
);
|
||||
}
|
||||
|
||||
if (meQuery.isPending) {
|
||||
return (
|
||||
<main className="max-w-5xl mx-auto px-4 py-20 text-center">
|
||||
<h1 className="text-lg font-bold">권한 확인 중...</h1>
|
||||
<AdminNotice title="권한 확인 중...">
|
||||
<p className="mt-2 text-sm text-base-content/40">
|
||||
로그인한 계정의 커뮤니티 권한을 확인하고 있습니다.
|
||||
</p>
|
||||
</main>
|
||||
</AdminNotice>
|
||||
);
|
||||
}
|
||||
|
||||
if (!canManage) {
|
||||
return (
|
||||
<main className="max-w-5xl mx-auto px-4 py-20 text-center">
|
||||
<h1 className="text-lg font-bold">권한이 필요합니다</h1>
|
||||
<AdminNotice title="권한이 필요합니다">
|
||||
<p className="mt-2 text-sm text-base-content/40">
|
||||
토너먼트 코드 풀은 owner/admin만 관리할 수 있습니다.
|
||||
</p>
|
||||
{manageableMemberships.length > 0 && (
|
||||
<div className="mt-5 flex flex-wrap justify-center gap-2">
|
||||
{manageableMemberships.map((membership) => (
|
||||
<Link
|
||||
<Btn
|
||||
key={membership.community?._id ?? membership.user._id}
|
||||
to={`/admin/communities/${membership.community?._id}/tournament-codes`}
|
||||
className="btn btn-primary btn-sm px-4 text-xs"
|
||||
variant="primary"
|
||||
>
|
||||
{membership.community?.name ?? '관리 가능한 커뮤니티'}로 이동
|
||||
</Link>
|
||||
</Btn>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
</main>
|
||||
</AdminNotice>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<main className="max-w-6xl mx-auto px-4 sm:px-6 py-6">
|
||||
<Link
|
||||
to="/"
|
||||
className="inline-flex text-xs text-base-content/40 hover:text-base-content mb-5"
|
||||
>
|
||||
← 목록으로
|
||||
</Link>
|
||||
<div className="mb-6">
|
||||
<h1 className="text-2xl font-black text-base-content">
|
||||
토너먼트 코드 풀
|
||||
</h1>
|
||||
<p className="mt-1 text-sm text-base-content/45">
|
||||
외부에서 생성한 코드를 업로드하고, 매치에 자동 할당되는 풀을 관리합니다.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<AdminPage
|
||||
communityId={communityId}
|
||||
title="토너먼트 코드 풀"
|
||||
description="외부에서 생성한 코드를 업로드하고, 매치에 자동 할당되는 풀을 관리합니다."
|
||||
>
|
||||
|
||||
<section className="grid sm:grid-cols-5 gap-3 mb-6">
|
||||
{STATES.map((state) => (
|
||||
<div key={state} className="border border-base-content/10 bg-base-100 p-4">
|
||||
@@ -239,28 +228,27 @@ export default function TournamentCodesPage() {
|
||||
? 'KR-ABCD-1234,2026-05-30T18:00:00Z,메모'
|
||||
: '[{"code":"KR-ABCD-1234","expiresAt":"2026-05-30T18:00:00Z","source":"external"}]'
|
||||
}
|
||||
className="w-full border border-base-content/10 bg-transparent p-3 text-xs font-mono focus:outline-none focus:border-primary/30"
|
||||
className="lts-textarea w-full font-mono"
|
||||
/>
|
||||
<div className="mt-3 flex items-center gap-3">
|
||||
<button
|
||||
type="button"
|
||||
className="btn btn-primary btn-sm px-5 text-xs"
|
||||
<Btn
|
||||
variant="primary"
|
||||
disabled={uploadMutation.isPending || !text.trim()}
|
||||
onClick={handleUpload}
|
||||
>
|
||||
{uploadMutation.isPending ? '업로드 중...' : '업로드'}
|
||||
</button>
|
||||
</Btn>
|
||||
{message && <span className="text-xs text-base-content/45">{message}</span>}
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section className="border border-base-content/10 bg-base-100 overflow-hidden">
|
||||
<section className="lts-panel overflow-hidden">
|
||||
<div className="px-4 py-3 border-b border-base-content/10 flex items-center justify-between gap-3">
|
||||
<h2 className="text-sm font-bold">코드 목록</h2>
|
||||
<select
|
||||
value={stateFilter}
|
||||
onChange={(event) => setStateFilter(event.target.value as TournamentCodeState | '')}
|
||||
className="border border-base-content/10 bg-transparent px-2 py-1 text-xs"
|
||||
className="lts-select"
|
||||
>
|
||||
<option value="">전체</option>
|
||||
{STATES.map((state) => (
|
||||
@@ -271,7 +259,7 @@ export default function TournamentCodesPage() {
|
||||
</select>
|
||||
</div>
|
||||
<div className="overflow-x-auto">
|
||||
<table className="w-full min-w-[900px] text-left">
|
||||
<table className="lts-table min-w-[900px]">
|
||||
<thead>
|
||||
<tr className="bg-base-200/40 border-b border-base-content/10 text-xs uppercase tracking-wider text-base-content/35">
|
||||
<th className="px-3 py-2">코드</th>
|
||||
@@ -322,7 +310,7 @@ export default function TournamentCodesPage() {
|
||||
{code.state === 'available' && (
|
||||
<button
|
||||
type="button"
|
||||
className="text-xs px-2 py-1 border border-red-500/20 text-red-400"
|
||||
className="text-xs px-2 py-1 border border-loss-line text-loss"
|
||||
onClick={() =>
|
||||
deleteMutation.mutate(code._id, {
|
||||
onSuccess: invalidate,
|
||||
@@ -350,6 +338,6 @@ export default function TournamentCodesPage() {
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
</AdminPage>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,377 @@
|
||||
/* 경매 화면 전용 레이아웃. 색·모서리·글꼴은 index.css의 전역 토큰을 따른다. */
|
||||
#root:has(.auction-visual-preview) > div > nav .btn {
|
||||
border-radius: 10px !important;
|
||||
box-shadow: none !important;
|
||||
}
|
||||
|
||||
#root:has(.auction-visual-preview) .dev-auth-switcher {
|
||||
position: static;
|
||||
margin: 16px auto;
|
||||
}
|
||||
|
||||
.auction-visual-preview {
|
||||
--color-base-100: var(--color-background-card);
|
||||
--color-base-200: var(--color-background-surface);
|
||||
--color-base-300: var(--color-background-gray);
|
||||
--color-base-content: var(--color-text-primary);
|
||||
--color-primary: var(--color-accent);
|
||||
--color-primary-content: var(--color-on-accent);
|
||||
--lts-content-muted: var(--color-text-secondary);
|
||||
--lts-content-subtle: var(--color-text-secondary);
|
||||
--lts-content-disabled: var(--color-text-disabled);
|
||||
|
||||
color: var(--color-text-primary);
|
||||
font-family: Figtree, "Asta Sans", system-ui, sans-serif;
|
||||
font-size: var(--text-body-size);
|
||||
line-height: var(--text-body-leading);
|
||||
}
|
||||
|
||||
.auction-visual-preview .auction-back-link {
|
||||
min-height: 32px;
|
||||
margin-bottom: var(--spacing-3);
|
||||
padding-inline: var(--spacing-2);
|
||||
margin-inline-start: calc(-1 * var(--spacing-2));
|
||||
border-radius: var(--radius-element);
|
||||
}
|
||||
|
||||
.auction-visual-preview .auction-back-link:hover {
|
||||
background: var(--color-overlay-hover);
|
||||
}
|
||||
|
||||
.auction-visual-preview .auction-masthead {
|
||||
align-items: end;
|
||||
gap: var(--spacing-3) var(--spacing-6);
|
||||
margin: 0;
|
||||
padding-block-end: var(--spacing-4);
|
||||
border-bottom: 1px solid var(--color-border);
|
||||
}
|
||||
|
||||
.auction-visual-preview .auction-masthead-kicker {
|
||||
margin-bottom: var(--spacing-1);
|
||||
color: var(--color-text-secondary);
|
||||
font-size: var(--text-supporting-size);
|
||||
line-height: var(--text-supporting-leading);
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
|
||||
.auction-visual-preview .auction-masthead-title {
|
||||
color: var(--color-text-primary);
|
||||
font-size: clamp(1.5rem, 2.4vw, 1.875rem);
|
||||
font-weight: 800;
|
||||
letter-spacing: -0.025em;
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
.auction-visual-preview .auction-masthead-meta {
|
||||
margin-top: var(--spacing-2);
|
||||
color: var(--color-text-secondary);
|
||||
font-size: var(--text-body-size);
|
||||
}
|
||||
|
||||
.auction-visual-preview .auction-masthead-tools {
|
||||
align-items: center;
|
||||
flex-flow: row wrap;
|
||||
gap: var(--spacing-2) var(--spacing-3);
|
||||
}
|
||||
|
||||
.auction-visual-preview .auction-masthead-controls {
|
||||
flex-wrap: wrap;
|
||||
gap: var(--spacing-2);
|
||||
}
|
||||
|
||||
.auction-visual-preview .auction-connection,
|
||||
.auction-visual-preview .auction-original-link {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: var(--spacing-2);
|
||||
min-height: 32px;
|
||||
color: var(--color-text-secondary);
|
||||
font-size: var(--text-supporting-size);
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.auction-visual-preview .auction-original-link {
|
||||
padding-inline: var(--spacing-3);
|
||||
border-radius: var(--radius-element);
|
||||
}
|
||||
|
||||
.auction-visual-preview .auction-original-link:hover {
|
||||
background: var(--color-overlay-hover);
|
||||
color: var(--color-text-primary);
|
||||
}
|
||||
|
||||
.auction-visual-preview .auction-preview-grid {
|
||||
display: grid;
|
||||
align-items: start;
|
||||
gap: var(--spacing-4);
|
||||
grid-template-columns: minmax(0, 1fr);
|
||||
margin-top: var(--spacing-3);
|
||||
}
|
||||
|
||||
.auction-visual-preview .auction-preview-grid > * {
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.auction-visual-preview .auction-preview-sidebar {
|
||||
display: grid;
|
||||
gap: var(--spacing-5);
|
||||
grid-template-columns: minmax(0, 1fr);
|
||||
}
|
||||
|
||||
.auction-visual-preview .auction-region-title {
|
||||
margin-block-end: var(--spacing-3);
|
||||
color: var(--color-text-primary);
|
||||
font-size: var(--text-heading-3-size);
|
||||
font-weight: var(--text-heading-3-weight);
|
||||
line-height: var(--text-heading-3-leading);
|
||||
}
|
||||
|
||||
.auction-visual-preview .auction-preview-stage > .auction-stage-title {
|
||||
margin-block-end: var(--spacing-3);
|
||||
}
|
||||
|
||||
.auction-visual-preview .auction-teams-title {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
justify-content: space-between;
|
||||
gap: var(--spacing-2);
|
||||
}
|
||||
|
||||
.auction-visual-preview .auction-teams-title > span {
|
||||
color: var(--color-text-secondary);
|
||||
font-size: var(--text-supporting-size);
|
||||
}
|
||||
|
||||
.auction-visual-preview .auction-team-grid {
|
||||
gap: var(--spacing-3);
|
||||
grid-template-columns: minmax(0, 1fr);
|
||||
}
|
||||
|
||||
.auction-visual-preview :is(.auction-team-card, .auction-spotlight, .auction-pool-card),
|
||||
.auction-visual-preview .auction-preview-chat > div {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.auction-visual-preview .auction-preview-stage > div:not(.fixed, .astryx-card),
|
||||
.auction-visual-preview .auction-preview-chat > div {
|
||||
border-color: var(--color-border);
|
||||
border-radius: var(--radius-container);
|
||||
}
|
||||
|
||||
.auction-visual-preview .auction-team-card[data-current-bidder] {
|
||||
border-color: var(--color-text-accent);
|
||||
box-shadow: 0 0 0 3px var(--color-accent-muted);
|
||||
}
|
||||
|
||||
.auction-visual-preview .auction-team-stripe {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.auction-visual-preview .auction-team-heading {
|
||||
padding: var(--spacing-3) var(--spacing-4);
|
||||
background: var(--color-background-surface);
|
||||
border-color: var(--color-border);
|
||||
}
|
||||
|
||||
.auction-visual-preview .auction-team-summary {
|
||||
align-items: start;
|
||||
gap: var(--spacing-2);
|
||||
}
|
||||
|
||||
.auction-visual-preview .auction-team-identity {
|
||||
flex-direction: column;
|
||||
align-items: start;
|
||||
gap: 3px;
|
||||
min-width: 0;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
|
||||
.auction-visual-preview .auction-team-name {
|
||||
color: var(--color-text-primary);
|
||||
font-size: var(--text-heading-4-size);
|
||||
font-weight: var(--text-heading-4-weight);
|
||||
letter-spacing: 0;
|
||||
line-height: var(--text-heading-4-leading);
|
||||
text-transform: none;
|
||||
}
|
||||
|
||||
.auction-visual-preview .auction-team-budget {
|
||||
flex: none;
|
||||
color: var(--color-text-primary);
|
||||
font-size: var(--text-heading-2-size);
|
||||
font-weight: var(--text-heading-2-weight);
|
||||
line-height: var(--text-heading-2-leading);
|
||||
}
|
||||
|
||||
.auction-visual-preview :is(.auction-roster-head, .auction-roster-row) {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(0, 1fr) 3rem 3rem;
|
||||
gap: var(--spacing-2);
|
||||
align-items: center;
|
||||
padding-inline: var(--spacing-3);
|
||||
}
|
||||
|
||||
.auction-visual-preview .auction-roster-head {
|
||||
min-height: 30px;
|
||||
background: var(--color-background-muted);
|
||||
}
|
||||
|
||||
.auction-visual-preview .auction-roster-head > :last-child {
|
||||
text-align: end;
|
||||
}
|
||||
|
||||
.auction-visual-preview .auction-roster-row {
|
||||
min-height: 36px;
|
||||
}
|
||||
|
||||
.auction-visual-preview :is(.auction-roster-head, .auction-roster-position, .auction-roster-cost, .auction-team-open-slots) {
|
||||
color: var(--color-text-secondary);
|
||||
font-size: var(--text-supporting-size);
|
||||
font-weight: var(--font-weight-normal);
|
||||
}
|
||||
|
||||
.auction-visual-preview .auction-roster-cost {
|
||||
width: auto;
|
||||
}
|
||||
|
||||
.auction-visual-preview .auction-team-open-slots {
|
||||
padding: var(--spacing-2) var(--spacing-3);
|
||||
}
|
||||
|
||||
.auction-visual-preview .auction-profile-identity {
|
||||
padding: var(--spacing-4);
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.auction-visual-preview .auction-profile-avatar {
|
||||
width: 56px;
|
||||
height: 56px;
|
||||
border-radius: var(--radius-element);
|
||||
}
|
||||
|
||||
.auction-visual-preview :is(.auction-roster-row, .auction-preview-pool) img {
|
||||
border-radius: var(--radius-inner);
|
||||
}
|
||||
|
||||
.auction-visual-preview .auction-profile-meta {
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.auction-visual-preview .auction-profile-name-line {
|
||||
align-items: baseline;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.auction-visual-preview .auction-profile-name {
|
||||
font-size: var(--text-heading-2-size);
|
||||
font-weight: var(--text-heading-2-weight);
|
||||
line-height: var(--text-heading-2-leading);
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
|
||||
.auction-visual-preview .auction-current-bid {
|
||||
border-color: var(--color-border);
|
||||
}
|
||||
|
||||
.auction-visual-preview .auction-current-bid-amount {
|
||||
color: var(--color-text-primary);
|
||||
font-size: var(--text-heading-1-size);
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
|
||||
.auction-visual-preview .auction-passed-note {
|
||||
margin-inline: var(--spacing-4);
|
||||
padding: var(--spacing-2) var(--spacing-3);
|
||||
background: var(--color-warning-muted);
|
||||
border: 0;
|
||||
border-radius: var(--radius-element);
|
||||
text-align: start;
|
||||
}
|
||||
|
||||
.auction-visual-preview .auction-passed-note span {
|
||||
color: var(--color-on-warning-muted);
|
||||
font-size: var(--text-supporting-size);
|
||||
font-weight: var(--font-weight-semibold);
|
||||
}
|
||||
|
||||
.auction-visual-preview .auction-astryx-tabs {
|
||||
padding-inline: var(--spacing-2);
|
||||
}
|
||||
|
||||
.auction-visual-preview .auction-tab-count {
|
||||
padding: 0 6px;
|
||||
border-radius: var(--radius-full);
|
||||
background: var(--color-background-gray);
|
||||
color: var(--color-text-secondary);
|
||||
font-size: var(--text-supporting-size);
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
|
||||
.auction-visual-preview .auction-profile-history {
|
||||
height: auto;
|
||||
max-height: 16rem;
|
||||
min-height: 6rem;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.auction-visual-preview .auction-profile-metric {
|
||||
background: var(--color-background-muted);
|
||||
border-color: var(--color-border);
|
||||
border-radius: var(--radius-element);
|
||||
}
|
||||
|
||||
.auction-visual-preview .auction-profile-metric > div:nth-child(2) {
|
||||
font-size: var(--text-heading-2-size);
|
||||
font-weight: var(--text-heading-2-weight);
|
||||
line-height: var(--text-heading-2-leading);
|
||||
}
|
||||
|
||||
.auction-visual-preview :is(.auction-pool-card, .auction-preview-chat > div) {
|
||||
height: 320px;
|
||||
}
|
||||
|
||||
.auction-visual-preview .auction-preview-chat :is(form, .auction-chat-header) {
|
||||
border-color: var(--color-border);
|
||||
padding: var(--spacing-3);
|
||||
}
|
||||
|
||||
.auction-visual-preview .auction-chat-header > div:first-child,
|
||||
.auction-visual-preview .auction-operation-panel > div:first-child {
|
||||
color: var(--color-text-primary);
|
||||
font-size: var(--text-label-size);
|
||||
font-weight: var(--font-weight-semibold);
|
||||
letter-spacing: 0;
|
||||
}
|
||||
|
||||
.auction-visual-preview .auction-chat-header [data-connected="true"] {
|
||||
color: var(--color-text-success);
|
||||
}
|
||||
|
||||
.auction-visual-preview :is(select, textarea, input:not([type="checkbox"], [type="radio"])) {
|
||||
min-height: 32px;
|
||||
padding: var(--spacing-1) var(--spacing-2);
|
||||
background: var(--color-background-surface);
|
||||
border: 1px solid var(--color-border-emphasized);
|
||||
border-radius: var(--radius-element);
|
||||
color: var(--color-text-primary);
|
||||
font-size: var(--text-label-size);
|
||||
}
|
||||
|
||||
.auction-visual-preview .fixed.inset-0 > div {
|
||||
border-color: var(--color-border);
|
||||
border-radius: var(--radius-page);
|
||||
}
|
||||
|
||||
@media (min-width: 480px) {
|
||||
.auction-visual-preview .auction-team-grid {
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 920px) {
|
||||
.auction-visual-preview .auction-preview-grid {
|
||||
gap: var(--spacing-5);
|
||||
grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
import type { ReactNode } from "react";
|
||||
import { LinkProvider } from "@astryxdesign/core/Link";
|
||||
import { Theme } from "@astryxdesign/core/theme";
|
||||
import { neutralTheme } from "@astryxdesign/theme-neutral/built";
|
||||
import { useTheme } from "../config";
|
||||
import { RouterLink } from "./RouterLink";
|
||||
|
||||
/**
|
||||
* Astryx 테마 경계. Neutral을 기반으로 하고 색·글꼴·모서리는 index.css의
|
||||
* lolympus 레이어가 덮는다. 라이트/다크는 앱의 기존 테마 저장값을 따른다.
|
||||
*/
|
||||
export function AppTheme({ children }: { children: ReactNode }) {
|
||||
const mode = useTheme();
|
||||
|
||||
return (
|
||||
<Theme theme={neutralTheme} mode={mode}>
|
||||
<LinkProvider component={RouterLink}>{children}</LinkProvider>
|
||||
</Theme>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
import {
|
||||
Children,
|
||||
isValidElement,
|
||||
type MouseEventHandler,
|
||||
type ReactNode,
|
||||
} from "react";
|
||||
import { Button } from "@astryxdesign/core/Button";
|
||||
|
||||
function textOf(node: ReactNode): string {
|
||||
return Children.toArray(node)
|
||||
.map((child) => {
|
||||
if (typeof child === "string" || typeof child === "number") {
|
||||
return String(child);
|
||||
}
|
||||
if (isValidElement<{ children?: ReactNode }>(child)) {
|
||||
return textOf(child.props.children);
|
||||
}
|
||||
return "";
|
||||
})
|
||||
.join("")
|
||||
.trim();
|
||||
}
|
||||
|
||||
export interface BtnProps {
|
||||
variant?: "primary" | "secondary" | "ghost" | "destructive";
|
||||
size?: "sm" | "md" | "lg";
|
||||
type?: "button" | "submit" | "reset";
|
||||
/** 앱 내부 경로 또는 외부 주소. 지정하면 링크로 렌더링한다. */
|
||||
to?: string;
|
||||
disabled?: boolean;
|
||||
loading?: boolean;
|
||||
/** 비활성 사유나 보조 설명. 툴팁으로 표시한다. */
|
||||
title?: string;
|
||||
/** 자식이 글자가 아닐 때의 접근성 이름. */
|
||||
label?: string;
|
||||
icon?: ReactNode;
|
||||
className?: string;
|
||||
onClick?: MouseEventHandler<HTMLButtonElement>;
|
||||
children?: ReactNode;
|
||||
"aria-pressed"?: boolean;
|
||||
"aria-expanded"?: boolean;
|
||||
"aria-controls"?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Astryx Button을 JSX 자식과 함께 쓰기 위한 얇은 어댑터.
|
||||
* 접근성 이름은 `label`, 없으면 자식의 글자에서 가져온다.
|
||||
*/
|
||||
export function Btn({
|
||||
variant = "secondary",
|
||||
size = "md",
|
||||
type = "button",
|
||||
to,
|
||||
disabled,
|
||||
loading,
|
||||
title,
|
||||
label,
|
||||
icon,
|
||||
className,
|
||||
onClick,
|
||||
children,
|
||||
...aria
|
||||
}: BtnProps) {
|
||||
const name = label ?? textOf(children);
|
||||
|
||||
return (
|
||||
<Button
|
||||
label={name}
|
||||
variant={variant}
|
||||
size={size}
|
||||
type={type}
|
||||
href={to}
|
||||
isDisabled={disabled}
|
||||
isLoading={loading}
|
||||
tooltip={title}
|
||||
icon={icon}
|
||||
className={className}
|
||||
onClick={onClick}
|
||||
{...aria}
|
||||
>
|
||||
{children}
|
||||
</Button>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
import type { ReactNode } from "react";
|
||||
import { Spinner } from "@astryxdesign/core/Spinner";
|
||||
import { CircleAlert, Inbox } from "lucide-react";
|
||||
|
||||
/** 데이터가 없는 구획. `sm`은 카드 높이를 차지하지 않는 한 줄 안내다. */
|
||||
export function EmptyNote({
|
||||
title,
|
||||
description,
|
||||
action,
|
||||
icon,
|
||||
size = "md",
|
||||
className = "",
|
||||
}: {
|
||||
title: ReactNode;
|
||||
description?: ReactNode;
|
||||
action?: ReactNode;
|
||||
icon?: ReactNode;
|
||||
size?: "sm" | "md";
|
||||
className?: string;
|
||||
}) {
|
||||
return (
|
||||
<div
|
||||
className={`flex flex-col items-center justify-center text-center ${
|
||||
size === "sm" ? "gap-1 px-4 py-6" : "gap-2 px-6 py-12"
|
||||
} ${className}`}
|
||||
>
|
||||
{size === "md" && (
|
||||
<span className="mb-1 grid size-10 place-items-center rounded-full bg-sunken text-content-subtle">
|
||||
{icon ?? <Inbox className="size-5" aria-hidden />}
|
||||
</span>
|
||||
)}
|
||||
<p className="text-sm font-semibold text-content-muted">{title}</p>
|
||||
{description && (
|
||||
<p className="max-w-sm text-xs leading-relaxed text-content-subtle">
|
||||
{description}
|
||||
</p>
|
||||
)}
|
||||
{action && <div className="mt-2">{action}</div>}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export function ErrorNote({
|
||||
title = "불러오지 못했습니다",
|
||||
description,
|
||||
action,
|
||||
className = "",
|
||||
}: {
|
||||
title?: ReactNode;
|
||||
description?: ReactNode;
|
||||
action?: ReactNode;
|
||||
className?: string;
|
||||
}) {
|
||||
return (
|
||||
<div
|
||||
role="alert"
|
||||
className={`flex items-start gap-3 rounded-box border border-loss-line bg-loss-tint px-4 py-3 ${className}`}
|
||||
>
|
||||
<CircleAlert className="mt-0.5 size-4 shrink-0 text-loss" aria-hidden />
|
||||
<div className="min-w-0 flex-1 text-sm">
|
||||
<p className="font-semibold text-loss">{title}</p>
|
||||
{description && (
|
||||
<p className="mt-0.5 break-words text-content-muted">{description}</p>
|
||||
)}
|
||||
</div>
|
||||
{action}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export function LoadingNote({
|
||||
label = "불러오는 중",
|
||||
className = "",
|
||||
}: {
|
||||
label?: string;
|
||||
className?: string;
|
||||
}) {
|
||||
return (
|
||||
<div
|
||||
role="status"
|
||||
className={`flex items-center justify-center gap-2 py-16 text-sm text-content-subtle ${className}`}
|
||||
>
|
||||
<Spinner size="sm" shade="subtle" />
|
||||
<span>{label}</span>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,203 @@
|
||||
import type { HTMLAttributes, ReactNode } from "react";
|
||||
import { ChevronRight } from "lucide-react";
|
||||
import { Link } from "react-router";
|
||||
import { pageWidthClass, type PageWidth } from "./layout";
|
||||
|
||||
export interface Crumb {
|
||||
label: string;
|
||||
to?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 페이지 머리 띠. 상단 내비게이션과 같은 잉크색으로 이어지고, 본문 시트가
|
||||
* 아래에서 겹쳐 올라온다. "지금 어디에 있고 무엇을 할 수 있는지"를 이 한
|
||||
* 곳에서 읽게 한다.
|
||||
*/
|
||||
export function PageHero({
|
||||
crumbs,
|
||||
eyebrow,
|
||||
title,
|
||||
badges,
|
||||
meta,
|
||||
description,
|
||||
actions,
|
||||
media,
|
||||
width = "lg",
|
||||
flush = false,
|
||||
children,
|
||||
}: {
|
||||
crumbs?: readonly Crumb[];
|
||||
eyebrow?: ReactNode;
|
||||
title: ReactNode;
|
||||
badges?: ReactNode;
|
||||
meta?: ReactNode;
|
||||
description?: ReactNode;
|
||||
actions?: ReactNode;
|
||||
media?: ReactNode;
|
||||
width?: PageWidth;
|
||||
/** 본문이 겹쳐 올라오지 않는 화면에서 아래 여백을 줄인다. */
|
||||
flush?: boolean;
|
||||
children?: ReactNode;
|
||||
}) {
|
||||
return (
|
||||
<header className="bg-ink text-on-ink">
|
||||
<div className={`${pageWidthClass(width)} pt-5 ${flush ? "pb-6" : "pb-14"}`}>
|
||||
{crumbs && crumbs.length > 0 && (
|
||||
<nav
|
||||
aria-label="현재 위치"
|
||||
className="mb-3 flex flex-wrap items-center gap-1 text-xs text-on-ink-muted"
|
||||
>
|
||||
{crumbs.map((crumb, index) => (
|
||||
<span key={index} className="inline-flex items-center gap-1">
|
||||
{index > 0 && (
|
||||
<ChevronRight className="size-3 opacity-60" aria-hidden />
|
||||
)}
|
||||
{crumb.to ? (
|
||||
<Link className="hover:text-on-ink" to={crumb.to}>
|
||||
{crumb.label}
|
||||
</Link>
|
||||
) : (
|
||||
<span aria-current="page">{crumb.label}</span>
|
||||
)}
|
||||
</span>
|
||||
))}
|
||||
</nav>
|
||||
)}
|
||||
<div className="flex flex-col gap-4 sm:flex-row sm:items-end sm:justify-between">
|
||||
<div className="flex min-w-0 items-center gap-4">
|
||||
{media}
|
||||
<div className="min-w-0">
|
||||
{eyebrow && (
|
||||
<p className="mb-1 text-xs font-semibold text-brand-coral">
|
||||
{eyebrow}
|
||||
</p>
|
||||
)}
|
||||
<div className="flex flex-wrap items-center gap-x-3 gap-y-1.5">
|
||||
<h1 className="min-w-0 break-words text-2xl font-extrabold leading-tight tracking-[-0.01em] sm:text-[28px]">
|
||||
{title}
|
||||
</h1>
|
||||
{badges}
|
||||
</div>
|
||||
{meta && (
|
||||
<div className="mt-2 flex flex-wrap items-center gap-x-3 gap-y-1 text-sm text-on-ink-muted">
|
||||
{meta}
|
||||
</div>
|
||||
)}
|
||||
{description && (
|
||||
<p className="mt-2 max-w-2xl whitespace-pre-line text-sm leading-relaxed text-on-ink-muted">
|
||||
{description}
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
{actions && (
|
||||
<div className="flex shrink-0 flex-wrap items-center gap-2">
|
||||
{actions}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
{children}
|
||||
</div>
|
||||
</header>
|
||||
);
|
||||
}
|
||||
|
||||
/** 머리 띠 위로 겹쳐 올라오는 본문 영역. */
|
||||
export function PageBody({
|
||||
width = "lg",
|
||||
className = "",
|
||||
children,
|
||||
}: {
|
||||
width?: PageWidth;
|
||||
className?: string;
|
||||
children: ReactNode;
|
||||
}) {
|
||||
return (
|
||||
<main
|
||||
className={`${pageWidthClass(width)} relative -mt-9 pb-16 ${className}`}
|
||||
>
|
||||
{children}
|
||||
</main>
|
||||
);
|
||||
}
|
||||
|
||||
/** 머리 띠 없이 쓰는 단순 페이지 본문. */
|
||||
export function PlainPage({
|
||||
width = "lg",
|
||||
className = "",
|
||||
children,
|
||||
}: {
|
||||
width?: PageWidth;
|
||||
className?: string;
|
||||
children: ReactNode;
|
||||
}) {
|
||||
return (
|
||||
<main className={`${pageWidthClass(width)} py-8 ${className}`}>
|
||||
{children}
|
||||
</main>
|
||||
);
|
||||
}
|
||||
|
||||
export function Panel({
|
||||
as: Tag = "section",
|
||||
className = "",
|
||||
children,
|
||||
...rest
|
||||
}: {
|
||||
as?: "section" | "div" | "article" | "aside";
|
||||
className?: string;
|
||||
children: ReactNode;
|
||||
} & HTMLAttributes<HTMLElement>) {
|
||||
return (
|
||||
<Tag className={`lts-panel ${className}`} {...rest}>
|
||||
{children}
|
||||
</Tag>
|
||||
);
|
||||
}
|
||||
|
||||
export function PanelHeader({
|
||||
title,
|
||||
description,
|
||||
count,
|
||||
actions,
|
||||
className = "",
|
||||
}: {
|
||||
title: ReactNode;
|
||||
description?: ReactNode;
|
||||
count?: ReactNode;
|
||||
actions?: ReactNode;
|
||||
className?: string;
|
||||
}) {
|
||||
return (
|
||||
<div
|
||||
className={`flex flex-wrap items-center justify-between gap-x-4 gap-y-2 border-b border-line px-4 py-3 sm:px-5 ${className}`}
|
||||
>
|
||||
<div className="min-w-0">
|
||||
<h2 className="flex items-baseline gap-2 text-[15px] font-bold text-content">
|
||||
{title}
|
||||
{count !== undefined && (
|
||||
<span className="tabular text-sm font-semibold text-content-subtle">
|
||||
{count}
|
||||
</span>
|
||||
)}
|
||||
</h2>
|
||||
{description && (
|
||||
<p className="mt-0.5 text-xs text-content-subtle">{description}</p>
|
||||
)}
|
||||
</div>
|
||||
{actions && (
|
||||
<div className="flex shrink-0 items-center gap-2">{actions}</div>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
/** 메타 정보를 나열할 때 쓰는 구분점. */
|
||||
export function MetaDot() {
|
||||
return (
|
||||
<span
|
||||
aria-hidden
|
||||
className="size-[3px] shrink-0 rounded-full bg-current opacity-50"
|
||||
/>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
import type { ButtonHTMLAttributes, ReactNode } from "react";
|
||||
|
||||
const TONES = {
|
||||
neutral: "bg-sunken-strong text-content-muted",
|
||||
accent: "bg-primary-tint text-primary",
|
||||
live: "bg-leaf-tint text-leaf",
|
||||
win: "bg-win-tint text-win",
|
||||
loss: "bg-loss-tint text-loss",
|
||||
gold: "bg-gold-tint text-gold",
|
||||
ink: "bg-white/10 text-on-ink",
|
||||
solid: "bg-primary text-primary-content",
|
||||
} as const;
|
||||
|
||||
export type PillTone = keyof typeof TONES;
|
||||
|
||||
/** 읽기 전용 상태·분류 표식. 조작 가능한 칩은 Chip을 쓴다. */
|
||||
export function Pill({
|
||||
tone = "neutral",
|
||||
dot = false,
|
||||
pulse = false,
|
||||
className = "",
|
||||
children,
|
||||
}: {
|
||||
tone?: PillTone;
|
||||
dot?: boolean;
|
||||
pulse?: boolean;
|
||||
className?: string;
|
||||
children: ReactNode;
|
||||
}) {
|
||||
return (
|
||||
<span
|
||||
className={`inline-flex h-[22px] shrink-0 items-center gap-1.5 whitespace-nowrap rounded-full px-2 text-xs font-semibold ${TONES[tone]} ${className}`}
|
||||
>
|
||||
{dot && (
|
||||
<span
|
||||
aria-hidden
|
||||
className={`size-1.5 rounded-full bg-current ${pulse ? "animate-pulse" : ""}`}
|
||||
/>
|
||||
)}
|
||||
{children}
|
||||
</span>
|
||||
);
|
||||
}
|
||||
|
||||
/** 배타 선택·필터에 쓰는 알약 버튼. 선택된 항목은 잉크색으로 채운다. */
|
||||
export function Chip({
|
||||
selected,
|
||||
className = "",
|
||||
children,
|
||||
...rest
|
||||
}: {
|
||||
selected: boolean;
|
||||
className?: string;
|
||||
children: ReactNode;
|
||||
} & ButtonHTMLAttributes<HTMLButtonElement>) {
|
||||
return (
|
||||
<button
|
||||
type="button"
|
||||
aria-pressed={selected}
|
||||
className={`inline-flex h-8 shrink-0 items-center gap-1.5 whitespace-nowrap rounded-full border px-3 text-[13px] font-semibold transition-colors disabled:cursor-not-allowed disabled:opacity-50 ${
|
||||
selected
|
||||
? "border-transparent bg-secondary text-secondary-content dark:bg-white dark:text-[#14161b]"
|
||||
: "border-line-strong bg-card text-content-muted hover:border-content-subtle hover:text-content"
|
||||
} ${className}`}
|
||||
{...rest}
|
||||
>
|
||||
{children}
|
||||
</button>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
import type { AnchorHTMLAttributes, Ref } from "react";
|
||||
import { Link } from "react-router";
|
||||
|
||||
const EXTERNAL_HREF = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;
|
||||
|
||||
/**
|
||||
* Astryx의 Link·Button·Tab이 `href`를 받을 때 쓰는 앵커 구현.
|
||||
* 앱 내부 경로는 react-router로 이동하고 외부 주소는 일반 앵커로 둔다.
|
||||
*/
|
||||
export function RouterLink({
|
||||
href = "",
|
||||
ref,
|
||||
...props
|
||||
}: AnchorHTMLAttributes<HTMLAnchorElement> & {
|
||||
ref?: Ref<HTMLAnchorElement>;
|
||||
}) {
|
||||
if (EXTERNAL_HREF.test(href) || href.startsWith("#")) {
|
||||
return <a ref={ref} href={href} {...props} />;
|
||||
}
|
||||
return <Link ref={ref} to={href} {...props} />;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
export { Button } from "@astryxdesign/core/Button";
|
||||
export { IconButton } from "@astryxdesign/core/IconButton";
|
||||
export { Spinner } from "@astryxdesign/core/Spinner";
|
||||
export { Skeleton } from "@astryxdesign/core/Skeleton";
|
||||
export { Tooltip } from "@astryxdesign/core/Tooltip";
|
||||
export { Dialog, DialogHeader } from "@astryxdesign/core/Dialog";
|
||||
export { TabList, Tab } from "@astryxdesign/core/TabList";
|
||||
export * from "./Page";
|
||||
export * from "./Feedback";
|
||||
export * from "./Pill";
|
||||
export { RouterLink } from "./RouterLink";
|
||||
export { pageWidthClass, type PageWidth } from "./layout";
|
||||
export { Btn } from "./Btn";
|
||||
@@ -0,0 +1,12 @@
|
||||
const WIDTHS = {
|
||||
md: "max-w-3xl",
|
||||
lg: "max-w-[1080px]",
|
||||
xl: "max-w-[1320px]",
|
||||
full: "max-w-[1600px]",
|
||||
} as const;
|
||||
|
||||
export type PageWidth = keyof typeof WIDTHS;
|
||||
|
||||
export function pageWidthClass(width: PageWidth = "lg") {
|
||||
return `${WIDTHS[width]} mx-auto w-full px-4 sm:px-6`;
|
||||
}
|
||||
Reference in new issue
Block a user