Skip to content

Commit

Permalink
Include competition name in page title
Browse files Browse the repository at this point in the history
  • Loading branch information
jonatanklosko committed Dec 16, 2024
1 parent b476dde commit 5702cad
Show file tree
Hide file tree
Showing 4 changed files with 93 additions and 16 deletions.
64 changes: 64 additions & 0 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"prettier": "^3.0.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-helmet-async": "^2.0.5",
"react-router-dom": "^6.0.2",
"react-timeago": "^7.1.0",
"react-virtualized-auto-sizer": "^1.0.6",
Expand Down
38 changes: 22 additions & 16 deletions client/src/components/App/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,34 @@ import { ConfirmProvider } from "material-ui-confirm";
import { ApolloProvider } from "@apollo/client";
import { SnackbarProvider } from "notistack";
import { StyledEngineProvider } from "@mui/material/styles";
import { Helmet, HelmetProvider } from "react-helmet-async";
import { client } from "./apollo";
import ThemeProvider from "../ThemeProvider/ThemeProvider";
import Navigation from "../Navigation/Navigation";

function App() {
return (
<Router>
<ApolloProvider client={client}>
<StyledEngineProvider injectFirst>
<ThemeProvider>
<SnackbarProvider
anchorOrigin={{ vertical: "bottom", horizontal: "right" }}
>
<ConfirmProvider>
<CssBaseline />
<Navigation />
</ConfirmProvider>
</SnackbarProvider>
</ThemeProvider>
</StyledEngineProvider>
</ApolloProvider>
</Router>
<HelmetProvider>
<Helmet>
<title>WCA Live</title>
</Helmet>
<Router>
<ApolloProvider client={client}>
<StyledEngineProvider injectFirst>
<ThemeProvider>
<SnackbarProvider
anchorOrigin={{ vertical: "bottom", horizontal: "right" }}
>
<ConfirmProvider>
<CssBaseline />
<Navigation />
</ConfirmProvider>
</SnackbarProvider>
</ThemeProvider>
</StyledEngineProvider>
</ApolloProvider>
</Router>
</HelmetProvider>
);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Routes, Route, Navigate, useParams } from "react-router-dom";
import { gql, useQuery } from "@apollo/client";
import { Helmet } from "react-helmet-async";
import CompetitionHome from "../CompetitionHome/CompetitionHome";
import Round from "../Round/Round";
import Competitors from "../Competitors/Competitors";
Expand Down Expand Up @@ -54,6 +55,11 @@ function CompetitionNavigation() {
return (
<CompetitionLayout competition={competition}>
{loading && <Loading />}
{competition && (
<Helmet>
<title>{competition.shortName} - WCA Live</title>
</Helmet>
)}
<Routes>
<Route path="" element={<CompetitionHome />} />
<Route path="rounds/:roundId/*" element={<Round />} />
Expand Down

0 comments on commit 5702cad

Please sign in to comment.