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
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user