fix talent pool ui

This commit is contained in:
2026-08-11 17:09:53 +05:30
parent 7427359967
commit 8a256a4de7
12 changed files with 473 additions and 256 deletions

View File

@@ -1,7 +1,7 @@
import { Toaster } from "@/components/ui/toaster"
import { QueryClientProvider } from '@tanstack/react-query'
import { queryClientInstance } from '@/lib/query-client'
import { Navigate, BrowserRouter as Router, Route, Routes } from 'react-router-dom';
import { Navigate, BrowserRouter as Router, Route, Routes, useParams } from 'react-router-dom';
import PageNotFound from './lib/PageNotFound';
import { AuthProvider, useAuth } from '@/lib/AuthContext';
import ScrollToTop from './components/ScrollToTop';
@@ -42,6 +42,12 @@ import AdminProfile from '@/pages/admin/Profile';
import AdminLogin from '@/pages/admin/Login';
import AdminRoute from '@/pages/admin/AdminRoute';
/** `/university/:id` → the same challenge inside the Admin shell, id preserved. */
const LegacyCourseRedirect = () => {
const { id } = useParams();
return <Navigate to={`/admin/university/${id}`} replace />;
};
const AuthenticatedApp = () => {
const { isLoadingAuth, isLoadingPublicSettings } = useAuth();
@@ -94,7 +100,11 @@ const AuthenticatedApp = () => {
<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 />} />
{/* Same treatment as every other legacy alias: the challenge opens inside
the application shell rather than on a bare page, so Forge → challenge
keeps its navigation, header and page frame. Existing links to
/university/:id are unchanged and still resolve here. */}
<Route path="/university/:id" element={<LegacyCourseRedirect />} />
<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 />} />