Initial React project
This commit is contained in:
@@ -6,6 +6,7 @@ import { CareerAgentPage } from './presentation/ai-agent/pages/CareerAgentPage';
|
||||
import { CvPage } from './presentation/cv/pages/CvPage';
|
||||
import type { DashboardNavKey } from './presentation/dashboard/components/DashboardSidebar';
|
||||
import { DashboardPage } from './presentation/dashboard/pages/DashboardPage';
|
||||
import { HomePage } from './presentation/home/pages/HomePage';
|
||||
import { JobDetailPage } from './presentation/jobs/pages/JobDetailPage';
|
||||
import { JobsPage } from './presentation/jobs/pages/JobsPage';
|
||||
import { MessagesPage } from './presentation/messages/pages/MessagesPage';
|
||||
@@ -25,6 +26,7 @@ interface JobDetailSelection {
|
||||
}
|
||||
|
||||
function App() {
|
||||
const isHomeRoute = useMemo(() => window.location.pathname === '/home', []);
|
||||
const initialAuthenticated = useMemo(() => Boolean(window.localStorage.getItem('token')), []);
|
||||
const initialTheme = useMemo<'light' | 'dark'>(() => {
|
||||
const stored = window.localStorage.getItem('theme');
|
||||
@@ -85,6 +87,10 @@ function App() {
|
||||
});
|
||||
}
|
||||
|
||||
if (isHomeRoute) {
|
||||
return <HomePage />;
|
||||
}
|
||||
|
||||
if (!isAuthenticated) {
|
||||
return <AuthPage onAuthenticated={() => setIsAuthenticated(true)} />;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user