feat(web): refresh the app with Astryx and coral branding

This commit is contained in:
dahyeon committed 2026-11-10 13:35:11 +09:00
1 parent f649490cd2
commit da7b502936
140 files changed
+4531 -2368

No files matched your search

+82
View File
@@ -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>
);
}
+49 -20
View File
@@ -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>
);
}
+10 -9
View File
@@ -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>
);
}
+8 -8
View File
@@ -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