diff --git a/apps/web/src/App.tsx b/apps/web/src/App.tsx index d63a55f8..172c4221 100644 --- a/apps/web/src/App.tsx +++ b/apps/web/src/App.tsx @@ -170,6 +170,10 @@ function App() { path="/communities/:cid/internal-stats/match/:matchId" element={} /> + } + /> } diff --git a/apps/web/src/lib/internal-match-routes.ts b/apps/web/src/lib/internal-match-routes.ts new file mode 100644 index 00000000..a3c12d0f --- /dev/null +++ b/apps/web/src/lib/internal-match-routes.ts @@ -0,0 +1,11 @@ +export function internalMatchDetailPath(communityId: string, matchId: string) { + return `/communities/${communityId}/internal-stats/match/${matchId}`; +} + +export function internalMatchGamePath( + communityId: string, + matchId: string, + gameNumber: string | number, +) { + return `${internalMatchDetailPath(communityId, matchId)}/game/${gameNumber}`; +} diff --git a/apps/web/src/pages/AuctionPage.tsx b/apps/web/src/pages/AuctionPage.tsx index 6b36f505..34ab0bb1 100644 --- a/apps/web/src/pages/AuctionPage.tsx +++ b/apps/web/src/pages/AuctionPage.tsx @@ -50,6 +50,7 @@ import { teamIndexColorClasses, teamIndexLabel, } from "../lib/league"; +import { internalMatchGamePath } from "../lib/internal-match-routes"; import { formatRankDetail, RankBadge } from "../components/RankBadge"; import type { ApiAuction, @@ -780,7 +781,11 @@ function InternalRecentMatchRow({ const resultTone = match.win ? "text-blue-400" : "text-red-400"; const detailPath = match.internalMatchId && match.gameNumber - ? `/match/${match.internalMatchId}/game/${match.gameNumber}` + ? internalMatchGamePath( + DEFAULT_COMMUNITY_ID, + match.internalMatchId, + match.gameNumber, + ) : null; const content = ( <> diff --git a/apps/web/src/pages/InternalMatchDetailPage.tsx b/apps/web/src/pages/InternalMatchDetailPage.tsx index c9ec6298..b23f2c63 100644 --- a/apps/web/src/pages/InternalMatchDetailPage.tsx +++ b/apps/web/src/pages/InternalMatchDetailPage.tsx @@ -12,6 +12,7 @@ import { teamIndexColorClasses, teamIndexLabel, } from "../lib/league"; +import { internalMatchGamePath } from "../lib/internal-match-routes"; import { LANE_LABELS } from "../lib/riot-history"; function formatDateTime(value: string | number) { @@ -89,9 +90,13 @@ function ItemStrip({ } function GamePanel({ + communityId, + matchId, game, manifest, }: { + communityId: string; + matchId: string; game: ApiInternalMatchDetailResponse["games"][number]; manifest: ReturnType["data"]; }) { @@ -112,6 +117,13 @@ function GamePanel({

+ + 상세 분석 + {game.teams.map((team) => ( {detail.games.map((game) => ( - + ))}
diff --git a/apps/web/src/pages/MatchDetailPage.tsx b/apps/web/src/pages/MatchDetailPage.tsx index fdd20fb7..2da5e909 100644 --- a/apps/web/src/pages/MatchDetailPage.tsx +++ b/apps/web/src/pages/MatchDetailPage.tsx @@ -45,6 +45,7 @@ import { teamIndexColorClasses, teamIndexLabel, } from "../lib/league"; +import { internalMatchGamePath } from "../lib/internal-match-routes"; import type { AuctionTopTierThreshold, ApiCommunityUserSearchCandidate, @@ -2237,7 +2238,11 @@ function MatchGameListSection({ match }: { match: MatchDetailView }) { return ( diff --git a/apps/web/src/pages/MatchGameDetailPage.tsx b/apps/web/src/pages/MatchGameDetailPage.tsx index ff72cb9d..56805d60 100644 --- a/apps/web/src/pages/MatchGameDetailPage.tsx +++ b/apps/web/src/pages/MatchGameDetailPage.tsx @@ -28,6 +28,10 @@ import { teamIndexColorClasses, teamIndexLabel, } from "../lib/league"; +import { + internalMatchDetailPath, + internalMatchGamePath, +} from "../lib/internal-match-routes"; import { LANE_LABELS } from "../lib/riot-history"; type MatchGameDetail = ApiInternalMatchDetailResponse["games"][number]; @@ -1971,10 +1975,12 @@ function GameAnalysisPanel({ function GameTabs({ detail, + communityId, currentGameNumber, navigationState, }: { detail: ApiInternalMatchDetailResponse; + communityId: string; currentGameNumber: number; navigationState: MatchGameNavigationState | undefined; }) { @@ -1989,7 +1995,11 @@ function GameTabs({ return ( @@ -2105,14 +2118,18 @@ function MatchScoreHero({ } export default function MatchGameDetailPage() { - const { id, gameNumber } = useParams(); + const { cid, matchId, id, gameNumber } = useParams(); const location = useLocation(); const [activeTab, setActiveTab] = useState("scoreboard"); + const communityId = cid ?? DEFAULT_COMMUNITY_ID; + const resolvedMatchId = matchId ?? id; const requestedGameNumber = Number(gameNumber); - const detailQuery = useInternalMatchDetail(id, DEFAULT_COMMUNITY_ID); + const detailQuery = useInternalMatchDetail(resolvedMatchId, communityId); const { data: ddragon } = useDdragonManifest(); const detail = detailQuery.data; - const fallbackBackTo = `/match/${id ?? ""}`; + const fallbackBackTo = resolvedMatchId + ? internalMatchDetailPath(communityId, resolvedMatchId) + : `/communities/${communityId}/internal-stats`; const backTarget = resolveBackTarget(location.state, fallbackBackTo); const navigationState = createNavigationState(backTarget, fallbackBackTo); @@ -2157,6 +2174,7 @@ export default function MatchGameDetailPage() {