@@ -4,7 +4,7 @@ import { HashRouter, Navigate, Route, Routes, useParams } from "react-router-dom
44import { styled } from "@linaria/react" ;
55import { AppContext } from "./components/AppContext" ;
66import { Declaration } from "./components/Docs/api" ;
7- import { isGameId , GameId , GAMES } from "./games" ;
7+ import { isGameId , GameId , GAMES , getGame } from "./games" ;
88import { loadGameSchemas , type SchemaMetadata } from "./components/data" ;
99import DeclarationsPage from "./components/DeclarationsPage" ;
1010import "./global.css" ;
@@ -23,7 +23,7 @@ const EMPTY_DECLARATIONS: Declaration[] = [];
2323const EMPTY_OTHER_GAMES = new Map < GameId , Declaration [ ] > ( ) ;
2424
2525function SchemasPage ( ) {
26- const { game } = useParams < { game : string } > ( ) ;
26+ const { game, module , scope } = useParams < { game : string ; module : string ; scope : string } > ( ) ;
2727 const [ declarations , setDeclarations ] = useState < Declaration [ ] | null > ( null ) ;
2828 const [ metadata , setMetadata ] = useState < SchemaMetadata > ( {
2929 revision : 0 ,
@@ -68,6 +68,12 @@ function SchemasPage() {
6868 } ;
6969 } , [ validGame ] ) ;
7070
71+ useEffect ( ( ) => {
72+ const gameName = validGame ? getGame ( validGame ) ?. name : null ;
73+ const parts = [ scope , module , gameName , "Source 2 Schema Explorer" ] . filter ( Boolean ) ;
74+ document . title = parts . join ( " - " ) ;
75+ } , [ validGame , module , scope ] ) ;
76+
7177 const resolvedDeclarations = declarations ?? EMPTY_DECLARATIONS ;
7278 const loading = ! declarations && ! error ;
7379
0 commit comments