ui changes
This commit is contained in:
76
src/App.jsx
76
src/App.jsx
@@ -1,7 +1,7 @@
|
||||
import { Toaster } from "@/components/ui/toaster"
|
||||
import { QueryClientProvider } from '@tanstack/react-query'
|
||||
import { queryClientInstance } from '@/lib/query-client'
|
||||
import { BrowserRouter as Router, Route, Routes } from 'react-router-dom';
|
||||
import { Navigate, BrowserRouter as Router, Route, Routes } from 'react-router-dom';
|
||||
import PageNotFound from './lib/PageNotFound';
|
||||
import { AuthProvider, useAuth } from '@/lib/AuthContext';
|
||||
import ScrollToTop from './components/ScrollToTop';
|
||||
@@ -23,10 +23,25 @@ import CourseDetail from '@/pages/CourseDetail';
|
||||
import WorkerProfile from '@/pages/WorkerProfile';
|
||||
import KrowIdentity from '@/pages/KrowIdentity';
|
||||
import Owliver from '@/pages/Owliver';
|
||||
import AdminDashboard from '@/pages/AdminDashboard';
|
||||
import EmployeeDashboard from '@/pages/EmployeeDashboard';
|
||||
import DesignSystem from '@/pages/DesignSystem';
|
||||
|
||||
/* Admin product — its own layout and route tree, so the Admin redesign can
|
||||
diverge without touching the Employer or Talent experiences. */
|
||||
import AdminLayout from '@/layouts/AdminLayout';
|
||||
import ControlCenter from '@/pages/admin/ControlCenter';
|
||||
import AdminPositions from '@/pages/admin/Positions';
|
||||
import AdminCandidates from '@/pages/admin/Candidates';
|
||||
import AdminCandidateProfile from '@/pages/admin/CandidateProfile';
|
||||
import AdminCandidatesAnalysis from '@/pages/admin/CandidatesAnalysis';
|
||||
import AdminHiredHistory from '@/pages/admin/HiredHistory';
|
||||
import AdminTalentPool from '@/pages/admin/TalentPool';
|
||||
import AdminAnalytics from '@/pages/admin/Analytics';
|
||||
import AdminActivity from '@/pages/admin/Activity';
|
||||
import AdminProfile from '@/pages/admin/Profile';
|
||||
import AdminLogin from '@/pages/admin/Login';
|
||||
import AdminRoute from '@/pages/admin/AdminRoute';
|
||||
|
||||
const AuthenticatedApp = () => {
|
||||
const { isLoadingAuth, isLoadingPublicSettings } = useAuth();
|
||||
|
||||
@@ -40,29 +55,44 @@ const AuthenticatedApp = () => {
|
||||
|
||||
return (
|
||||
<Routes>
|
||||
{/* Admin sign-in — outside the protected boundary. */}
|
||||
<Route path="/admin/login" element={<AdminLogin />} />
|
||||
|
||||
<Route element={<ProtectedRoute />}>
|
||||
<Route element={<Layout />}>
|
||||
<Route path="/" element={<Overview />} />
|
||||
<Route path="/positions" element={<Positions />} />
|
||||
<Route path="/positions/new" element={<CreatePosition />} />
|
||||
<Route path="/positions/:id" element={<PositionDetail />} />
|
||||
<Route path="/candidates" element={<Candidates />} />
|
||||
<Route path="/hired" element={<HiredHistory />} />
|
||||
<Route path="/talent-pool" element={<TalentPool />} />
|
||||
<Route path="/apply" element={<Apply />} />
|
||||
<Route path="/tracking" element={<UserTracking />} />
|
||||
<Route path="/analytics" element={<Analytics />} />
|
||||
<Route path="/profile" element={<Profile />} />
|
||||
<Route path="/university" element={<University />} />
|
||||
<Route path="/university/:id" element={<CourseDetail />} />
|
||||
<Route path="/me" element={<WorkerProfile />} />
|
||||
<Route path="/identity" element={<KrowIdentity />} />
|
||||
<Route path="/owliver" element={<Owliver />} />
|
||||
<Route path="/admin" element={<AdminDashboard />} />
|
||||
<Route path="/employee" element={<EmployeeDashboard />} />
|
||||
{/* Design system reference — not in product navigation. */}
|
||||
<Route path="/design-system" element={<DesignSystem />} />
|
||||
{/* The application opens on the Admin console, which is entered through
|
||||
its own sign-in. Employer keeps every one of its routes, including
|
||||
Overview at an explicit path — nothing of that product is removed,
|
||||
only the address the app happens to start at. */}
|
||||
<Route path="/" element={<Navigate to="/admin/login" replace />} />
|
||||
|
||||
<Route element={<AdminRoute />}>
|
||||
<Route path="/admin" element={<AdminLayout />}>
|
||||
<Route index element={<ControlCenter />} />
|
||||
<Route path="positions" element={<AdminPositions />} />
|
||||
<Route path="positions/new" element={<CreatePosition />} />
|
||||
<Route path="positions/:id" element={<PositionDetail />} />
|
||||
<Route path="candidates" element={<AdminCandidates />} />
|
||||
<Route path="hired" element={<AdminHiredHistory />} />
|
||||
<Route path="talent-pool" element={<AdminTalentPool />} />
|
||||
<Route path="university" element={<University />} />
|
||||
<Route path="university/:id" element={<CourseDetail />} />
|
||||
<Route path="analytics" element={<AdminAnalytics />} />
|
||||
<Route path="activity" element={<AdminActivity />} />
|
||||
<Route path="profile" element={<AdminProfile />} />
|
||||
</Route>
|
||||
</Route>
|
||||
|
||||
{/* Redirect top-level legacy aliases to the unified global shell */}
|
||||
<Route path="/overview" element={<Navigate to="/admin" replace />} />
|
||||
<Route path="/positions" element={<Navigate to="/admin/positions" replace />} />
|
||||
<Route path="/candidates" element={<Navigate to="/admin/candidates" replace />} />
|
||||
<Route path="/hired" element={<Navigate to="/admin/hired" replace />} />
|
||||
<Route path="/talent-pool" element={<Navigate to="/admin/talent-pool" replace />} />
|
||||
<Route path="/university" element={<Navigate to="/admin/university" replace />} />
|
||||
<Route path="/university/:id" element={<CourseDetail />} />
|
||||
<Route path="/analytics" element={<Navigate to="/admin/analytics" replace />} />
|
||||
<Route path="/activity" element={<Navigate to="/admin/activity" replace />} />
|
||||
<Route path="/tracking" element={<Navigate to="/admin/activity" replace />} />
|
||||
</Route>
|
||||
<Route path="*" element={<PageNotFound />} />
|
||||
</Routes>
|
||||
|
||||
Reference in New Issue
Block a user