1- import { BrowserRouter , Routes , Route , Navigate , useNavigate } from 'react-router-dom' ;
1+ import { BrowserRouter , Routes , Route , Navigate } from 'react-router-dom' ;
22import { AuthProvider , useAuth } from './contexts/AuthContext' ;
33import { LoginPage } from './pages/LoginPage' ;
44import { SignupPage } from './pages/SignupPage' ;
5- import { Playground } from './pages/Playground ' ;
5+ import { LandingPage } from './pages/LandingPage ' ;
66import { Dashboard } from './components/Dashboard' ;
77
88function ProtectedRoute ( { children } : { children : React . ReactNode } ) {
99 const { user, loading } = useAuth ( ) ;
1010
1111 if ( loading ) {
1212 return (
13- < div className = "min-h-screen flex items-center justify-center" >
14- < div className = "text-lg" > Loading...</ div >
13+ < div className = "min-h-screen flex items-center justify-center bg-[#0a0a0b] " >
14+ < div className = "text-lg text-white " > Loading...</ div >
1515 </ div >
1616 ) ;
1717 }
@@ -23,25 +23,24 @@ function ProtectedRoute({ children }: { children: React.ReactNode }) {
2323 return < > { children } </ > ;
2424}
2525
26- function PlaygroundWrapper ( ) {
27- const navigate = useNavigate ( ) ;
26+ function LandingWrapper ( ) {
2827 const { user } = useAuth ( ) ;
2928
3029 // If user is logged in, redirect to dashboard
3130 if ( user ) {
3231 return < Navigate to = "/dashboard" replace /> ;
3332 }
3433
35- return < Playground onSignupClick = { ( ) => navigate ( '/signup' ) } /> ;
34+ return < LandingPage /> ;
3635}
3736
3837function AppRoutes ( ) {
3938 const { user } = useAuth ( ) ;
4039
4140 return (
4241 < Routes >
43- { /* Playground is the new landing page */ }
44- < Route path = "/" element = { < PlaygroundWrapper /> } />
42+ { /* New Landing Page */ }
43+ < Route path = "/" element = { < LandingWrapper /> } />
4544
4645 < Route
4746 path = "/login"
@@ -60,7 +59,7 @@ function AppRoutes() {
6059 }
6160 />
6261
63- { /* Legacy route redirect */ }
62+ { /* Fallback */ }
6463 < Route path = "*" element = { < Navigate to = "/" replace /> } />
6564 </ Routes >
6665 ) ;
0 commit comments