feat: improve tournament workflows and prune outdated docs
This commit is contained in:
1 parent
da7b502936
commit
38a89b5374
53 files changed
+3308
-3276
No files matched your search
+74
-53
@@ -1,5 +1,5 @@
|
||||
import { BrowserRouter, Link, NavLink, Route, Routes } from "react-router";
|
||||
import type { ReactNode } from "react";
|
||||
import { lazy, Suspense, type ReactNode } from "react";
|
||||
import { useMsal } from "@azure/msal-react";
|
||||
import { LogOut, Moon, Sun } from "lucide-react";
|
||||
import DevAuthSwitcher from "./components/DevAuthSwitcher";
|
||||
@@ -22,22 +22,15 @@ 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";
|
||||
const InternalStatsPreview = import.meta.env.DEV
|
||||
? lazy(() => import("./preview/InternalStatsPreview"))
|
||||
: null;
|
||||
const MatchFlowsPreview = import.meta.env.DEV
|
||||
? lazy(() => import("./preview/MatchFlowsPreview"))
|
||||
: null;
|
||||
|
||||
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>
|
||||
);
|
||||
}
|
||||
const NAV_ICON_BUTTON_CLASS =
|
||||
"grid size-9 shrink-0 place-items-center rounded-field text-content-muted transition-colors hover:bg-sunken-strong hover:text-content";
|
||||
|
||||
function MsalHeaderActions() {
|
||||
const { accounts, instance } = useMsal();
|
||||
@@ -46,7 +39,7 @@ function MsalHeaderActions() {
|
||||
if (!account) {
|
||||
return (
|
||||
<Link
|
||||
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"
|
||||
className="inline-flex h-9 items-center whitespace-nowrap rounded-full border border-line-strong px-2.5 text-[13px] font-semibold text-content transition-colors hover:bg-sunken sm:px-3.5"
|
||||
to="/login"
|
||||
>
|
||||
로그인
|
||||
@@ -58,7 +51,7 @@ function MsalHeaderActions() {
|
||||
|
||||
return (
|
||||
<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">
|
||||
<span className="hidden max-w-40 truncate text-[13px] font-medium text-content-muted sm:block">
|
||||
{name}
|
||||
</span>
|
||||
<Tooltip content="로그아웃" placement="below">
|
||||
@@ -110,10 +103,10 @@ function PrimaryNavLink({
|
||||
to={to}
|
||||
end={end}
|
||||
className={({ isActive }) =>
|
||||
`relative inline-flex h-14 items-center px-3 text-sm font-semibold transition-colors ${
|
||||
`relative inline-flex h-full items-center whitespace-nowrap 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"
|
||||
? "text-content after:absolute after:inset-x-3 after:bottom-0 after:h-0.5 after:rounded-t-full after:bg-content"
|
||||
: "text-content-muted hover:text-content"
|
||||
}`
|
||||
}
|
||||
>
|
||||
@@ -132,45 +125,51 @@ function AppHeader() {
|
||||
const canManage = role === "owner" || role === "admin";
|
||||
|
||||
return (
|
||||
<header className="sticky top-0 z-50 border-b border-ink-line bg-ink">
|
||||
<header className="sticky top-0 z-50 border-b border-line bg-card dark:bg-ink">
|
||||
<div
|
||||
className={`${pageWidthClass("xl")} flex h-14 items-center justify-between gap-3`}
|
||||
className={`${pageWidthClass("xl")} grid grid-cols-[minmax(0,1fr)_auto_minmax(0,1fr)] grid-rows-[var(--app-header-row-height)_var(--app-header-nav-height)] items-center sm:gap-x-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} 홈`}
|
||||
<Link
|
||||
className="col-start-2 row-start-1 flex h-full items-center text-content"
|
||||
to="/"
|
||||
aria-label={`${communityLabel} 홈`}
|
||||
>
|
||||
<span className="max-w-24 truncate text-[17px] font-extrabold tracking-[-0.02em] sm:max-w-40">
|
||||
{communityLabel}
|
||||
</span>
|
||||
</Link>
|
||||
{DEFAULT_COMMUNITY_ID && (
|
||||
<nav
|
||||
aria-label="주 메뉴"
|
||||
className="col-span-3 row-start-2 flex h-full items-center justify-center sm:col-span-1 sm:col-start-1 sm:row-start-1 sm:justify-start"
|
||||
>
|
||||
<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="/" end>
|
||||
내전
|
||||
</PrimaryNavLink>
|
||||
<PrimaryNavLink
|
||||
to={`/communities/${DEFAULT_COMMUNITY_ID}/internal-stats`}
|
||||
>
|
||||
전적
|
||||
</PrimaryNavLink>
|
||||
{canManage && (
|
||||
<PrimaryNavLink
|
||||
to={`/communities/${DEFAULT_COMMUNITY_ID}/internal-stats`}
|
||||
to={`/admin/communities/${DEFAULT_COMMUNITY_ID}/matches`}
|
||||
>
|
||||
전적
|
||||
운영
|
||||
</PrimaryNavLink>
|
||||
{canManage && (
|
||||
<PrimaryNavLink
|
||||
to={`/admin/communities/${DEFAULT_COMMUNITY_ID}/matches`}
|
||||
>
|
||||
운영
|
||||
</PrimaryNavLink>
|
||||
)}
|
||||
</nav>
|
||||
)}
|
||||
</nav>
|
||||
)}
|
||||
<div className="contents sm:col-start-3 sm:row-start-1 sm:flex sm:min-w-0 sm:items-center sm:justify-self-end sm:gap-1">
|
||||
<div className="col-start-1 row-start-1 justify-self-start sm:shrink-0">
|
||||
<ThemeToggle />
|
||||
</div>
|
||||
{isMsalConfigured && (
|
||||
<div className="col-start-3 row-start-1 min-w-0 justify-self-end">
|
||||
<MsalHeaderActions />
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
<div className="flex shrink-0 items-center gap-1">
|
||||
<ThemeToggle />
|
||||
{isMsalConfigured && <MsalHeaderActions />}
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
);
|
||||
@@ -247,7 +246,9 @@ function NotFoundPage() {
|
||||
function App() {
|
||||
return (
|
||||
<BrowserRouter>
|
||||
<div className="flex min-h-screen flex-col bg-body">
|
||||
<div
|
||||
className={`lts-app-shell flex min-h-screen flex-col bg-body ${DEFAULT_COMMUNITY_ID ? "max-sm:[--app-header-nav-height:2.5rem]" : ""}`}
|
||||
>
|
||||
<AppHeader />
|
||||
|
||||
<div className="flex-1">
|
||||
@@ -270,6 +271,26 @@ function App() {
|
||||
path="/communities/:cid/internal-stats"
|
||||
element={<CommunityInternalStatsPage />}
|
||||
/>
|
||||
{InternalStatsPreview && (
|
||||
<Route
|
||||
path="/preview/internal-stats"
|
||||
element={
|
||||
<Suspense fallback={<PlainPage>전적 목업을 불러오는 중</PlainPage>}>
|
||||
<InternalStatsPreview />
|
||||
</Suspense>
|
||||
}
|
||||
/>
|
||||
)}
|
||||
{MatchFlowsPreview && (
|
||||
<Route
|
||||
path="/preview/match-flows"
|
||||
element={
|
||||
<Suspense fallback={<PlainPage>내전 목업을 불러오는 중</PlainPage>}>
|
||||
<MatchFlowsPreview />
|
||||
</Suspense>
|
||||
}
|
||||
/>
|
||||
)}
|
||||
<Route
|
||||
path="/communities/:cid/internal-stats/match/:matchId"
|
||||
element={<InternalMatchDetailPage />}
|
||||
|
||||
Reference in new issue
Block a user