From 82bc6b860598103af46030d875b82da239dc999d Mon Sep 17 00:00:00 2001 From: Pinapelz Date: Sun, 26 Oct 2025 21:17:06 -0700 Subject: stub profile page --- frontend/src/App.tsx | 2 ++ frontend/src/pages/Profile.tsx | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 frontend/src/pages/Profile.tsx diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 934eecd..fb97ed6 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -9,6 +9,7 @@ import Score from "./pages/Score"; import Chart from "./pages/Chart"; import Admin from "./pages/Admin"; import AllScores from "./pages/AllScores"; +import Profile from "./pages/Profile"; function App() { return ( @@ -23,6 +24,7 @@ function App() { } /> } /> } /> + } /> ); diff --git a/frontend/src/pages/Profile.tsx b/frontend/src/pages/Profile.tsx new file mode 100644 index 0000000..03fef48 --- /dev/null +++ b/frontend/src/pages/Profile.tsx @@ -0,0 +1,39 @@ +import { useNavigate } from 'react-router'; +import LoadingDisplay from "../components/displays/LoadingDisplay"; +import SessionExpiredPopup from "../components/SessionExpiredPopup"; +import { NavBar } from '../components/NavBar'; +import { useAuth } from "../contexts/AuthContext"; + + + +const Profile = () => { + const { user, isLoading, logout } = useAuth(); + const navigate = useNavigate(); + + if (isLoading) { + return ; + } + + const handleLogout = async () => { + try { + await logout(); + navigate("/"); + } catch (error) { + console.error("Logout failed:", error); + alert("Network error during logout. Please try again."); + } + }; + + if (!user) { + return ; + } + + return ( +
+ +

Profile

+
+ ); +}; + +export default Profile; -- cgit v1.2.3