init
This commit is contained in:
24
src/router.tsx
Normal file
24
src/router.tsx
Normal file
@@ -0,0 +1,24 @@
|
||||
import { createBrowserRouter, Navigate } from 'react-router-dom';
|
||||
|
||||
import { MainLayout } from './layouts/MainLayout';
|
||||
import { HomePage } from './pages/HomePage';
|
||||
import { ExamPage } from './pages/ExamPage';
|
||||
import { BookingPage } from './pages/BookingPage';
|
||||
import { SupportPage } from './pages/SupportPage';
|
||||
|
||||
export const router = createBrowserRouter([
|
||||
{
|
||||
path: '/',
|
||||
element: <MainLayout />,
|
||||
children: [
|
||||
{ index: true, element: <Navigate to='/home' replace /> },
|
||||
{ path: 'home', element: <HomePage /> },
|
||||
{ path: 'exam', element: <ExamPage /> },
|
||||
{ path: 'booking', element: <BookingPage /> },
|
||||
{ path: 'support', element: <SupportPage /> },
|
||||
],
|
||||
},
|
||||
{ path: '*', element: <Navigate to='/home' replace /> },
|
||||
]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user