-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tsx
55 lines (53 loc) · 1.29 KB
/
main.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import React from 'react'
import ReactDOM from 'react-dom/client'
import './index.css'
import {
createBrowserRouter,
RouterProvider,
} from "react-router-dom";
import { ErrorPage, App, UserPage, ItemPage, UsersPage, CollectionPage, WallLabelPage } from './App.tsx';
import { loadUser, loadUsers, loadItem, loadCollection } from './manifest.tsx';
const router = createBrowserRouter([
{
path: "/",
element: <App />,
// @ts-ignore
errorElement: <ErrorPage />,
children: [
{
path: "",
element: <UsersPage />,
loader: loadUsers,
},
{
path: ":userId",
element: <UserPage />,
// @ts-ignore
loader: loadUser,
},
{
path: ":userId/:collectionId",
element: <CollectionPage />,
// @ts-ignore
loader: loadCollection,
},
{
path: ":userId/:collectionId/:itemId",
element: <ItemPage />,
// @ts-ignore
loader: loadItem,
},
{
path: ":userId/:collectionId/:itemId/label",
element: <WallLabelPage />,
// @ts-ignore
loader: loadItem,
},
]
},
]);
ReactDOM.createRoot(document.getElementById('root')!).render(
<React.StrictMode>
<RouterProvider router={router} />
</React.StrictMode>,
)