From 23c58e20aed5078e882a3323a1f7043fd13b7338 Mon Sep 17 00:00:00 2001 From: Dylan De Faoite Date: Tue, 3 Mar 2026 17:59:50 +0000 Subject: [PATCH] feat(frontend): add title to pages --- frontend/src/App.tsx | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 2f728d6..1207317 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -1,10 +1,23 @@ -import { Navigate, Route, Routes } from "react-router-dom"; +import { useEffect } from "react"; +import { Navigate, Route, Routes, useLocation } from "react-router-dom"; import AppLayout from "./components/AppLayout"; import LoginPage from "./pages/Login"; import UploadPage from "./pages/Upload"; import StatPage from "./pages/Stats"; function App() { + const location = useLocation(); + + useEffect(() => { + const routeTitles: Record = { + "/login": "Sign In", + "/upload": "Upload Dataset", + "/stats": "Stats", + }; + + document.title = routeTitles[location.pathname]; + }, [location.pathname]); + return ( }>