@@ -13,8 +12,6 @@ function PageFallback() {
);
}
-// `React.lazy` requires a default export; our pages use named exports, so we
-// adapt with a small helper that picks the named export from the module.
function lazyPage
(
loader: () => Promise>,
name: K,
@@ -33,8 +30,8 @@ function lazyPage(
}
const Dashboard = lazyPage(() => import('./pages/Dashboard.js'), 'DashboardPage');
-const Admin = lazyPage(() => import('./pages/Admin.js'), 'AdminPage');
-const AdminLesson = lazyPage(() => import('./pages/AdminLesson.js'), 'AdminLessonPage');
+const Lessons = lazyPage(() => import('./pages/Lessons.js'), 'LessonsPage');
+const LessonDetail = lazyPage(() => import('./pages/LessonDetail.js'), 'LessonDetailPage');
const PracticeSetup = lazyPage(() => import('./pages/PracticeSetup.js'), 'PracticeSetupPage');
const Practice = lazyPage(() => import('./pages/Practice.js'), 'PracticePage');
const PracticeDone = lazyPage(() => import('./pages/PracticeDone.js'), 'PracticeDonePage');
@@ -53,12 +50,17 @@ const ForgotPassword = lazyPage(() => import('./pages/auth/ForgotPassword.js'),
const ResetPassword = lazyPage(() => import('./pages/auth/ResetPassword.js'), 'ResetPasswordPage');
const AcceptInvite = lazyPage(() => import('./pages/auth/AcceptInvite.js'), 'AcceptInvitePage');
+function AdminToLessons() { return ; }
+function AdminLessonRedirect() {
+ const { id } = useParams();
+ return ;
+}
+
export const router = createBrowserRouter([
{
path: '/',
element: ,
children: [
- // Public auth routes
{ path: 'login', element: },
{ path: 'register', element: },
{ path: 'verify-email', element: },
@@ -66,13 +68,16 @@ export const router = createBrowserRouter([
{ path: 'reset-password', element: },
{ path: 'accept-invite', element: },
- // Authenticated routes
{
element: ,
children: [
{ index: true, element: },
- { path: 'admin', element: },
- { path: 'admin/lessons/:id', element: },
+ { path: 'lessons', element: },
+ { path: 'lessons/:id', element: },
+
+ { path: 'admin', element: },
+ { path: 'admin/lessons/:id', element: },
+
{ path: 'practice/:lessonId/setup', element: },
{ path: 'practice/:lessonId', element: },
{ path: 'practice/:lessonId/done', element: },