From ff37cca46430ed714015647469f88ce06781457a Mon Sep 17 00:00:00 2001 From: Pinapelz Date: Sun, 29 Jun 2025 01:28:39 -0700 Subject: scaffold register,login,and auth endpoints --- frontend/src/pages/Home.tsx | 119 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 frontend/src/pages/Home.tsx (limited to 'frontend/src/pages/Home.tsx') diff --git a/frontend/src/pages/Home.tsx b/frontend/src/pages/Home.tsx new file mode 100644 index 0000000..1d87c8a --- /dev/null +++ b/frontend/src/pages/Home.tsx @@ -0,0 +1,119 @@ +import { Link, useNavigate } from 'react-router'; +import { useAuth } from '../contexts/AuthContext'; + +const Home = () => { + const { user, isLoading, logout } = useAuth(); + const navigate = useNavigate(); + + const handleLogout = async () => { + try { + await logout(); + navigate('/'); + } catch (error) { + console.error('Logout failed:', error); + alert('Network error during logout. Please try again.'); + } + }; + + if (isLoading) { + return ( +
+
+
+

Loading dashboard...

+
+
+ ); + } + + if (!user) { + return ( +
+
+
+

Session Expired

+

Please sign in to access your dashboard.

+
+ + Sign In + + + Back to Home + +
+
+
+
+ ); + } + + return ( +
+ {/* Navigation */} + + + {/* Main Content */} +
+ {/* Header */} +
+

Dashboard

+

Track your rhythm game progress and performance

+
+ + {/* Coming Soon Card */} +
+
+ + + +
+

Dashboard Coming Soon

+

+ We're working hard to bring you an amazing dashboard experience. Track your scores, + analyze your performance, and compete with friends - all coming soon! +

+
+
+

+ User ID: {user.id} +

+
+
+

+ Email: {user.email} +

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