diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 4db6ed3..9d03587 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -1,6 +1,6 @@ import { lazy, Suspense, useEffect, useRef } from "react"; import { BrowserRouter, Navigate, Route, Routes } from "react-router-dom"; -import { ProtectedRoute, PublicRoute } from "./components/RouteGuards"; +import { ProtectedRoute, AutoRedirectRoute } from "./components/RouteGuards"; import SplashScreen from "./components/SplashScreen"; import { ROUTES } from "./config/routes"; import { useAuth } from "./hooks/useAuth"; @@ -16,81 +16,85 @@ const VerifyEmail = lazy(() => import("./pages/VerifyEmail")); const About = lazy(() => import("./pages/About")); export default function App() { - const { initialize, isInitializing } = useAuth(); - const authInitialized = useRef(false); + const { initialize, isInitializing } = useAuth(); + const authInitialized = useRef(false); - useEffect(() => { - if (authInitialized.current) return; - authInitialized.current = true; - initialize().then(); - }, [initialize]); + useEffect(() => { + if (authInitialized.current) return; + authInitialized.current = true; + initialize().then(); + }, [initialize]); - if (isInitializing) { - return ; - } + if (isInitializing) { + return ; + } - return ( - -
- }> - - } /> + return ( + +
+ }> + + + + + } /> - - - - } - /> - - - - } - /> - - - - } - /> - - - - } - /> + + + + } + /> + + + + } + /> + + + + } + /> + + + + } + /> - - - - } - /> - - - - } - /> - } /> - } /> - } /> - - -
-
- ); + + + + } + /> + + + + } + /> + } /> + } /> + } /> +
+
+
+
+ ); }