]> git.localhorst.tv Git - alttp.git/blob - resources/js/app/Routes.js
snes settings
[alttp.git] / resources / js / app / Routes.js
1 import React from 'react';
2 import {
3         createBrowserRouter,
4         createRoutesFromElements,
5         Navigate,
6         Route,
7         RouterProvider,
8 } from 'react-router-dom';
9
10 import FullLayout from './FullLayout';
11 import Front from '../pages/Front';
12 import Technique from '../pages/Technique';
13 import Techniques from '../pages/Techniques';
14 import User from '../pages/User';
15
16 const router = createBrowserRouter(
17         createRoutesFromElements(
18                 <Route>
19                         <Route element={<FullLayout />}>
20                                 <Route
21                                         path="discord-bot"
22                                         lazy={() => import(
23                                                 /* webpackChunkName: "admin" */
24                                                 '../pages/DiscordBot'
25                                         )}
26                                 />
27                                 <Route
28                                         path="dungeons"
29                                         element={<Techniques namespace="dungeons" type="dungeon" />}
30                                 />
31                                 <Route
32                                         path="dungeons/:name"
33                                         element={<Technique basepath="dungeons" type="dungeon" />}
34                                 />
35                                 <Route
36                                         path="events"
37                                         lazy={() => import(
38                                                 /* webpackChunkName: "events" */
39                                                 '../pages/Events'
40                                         )}
41                                 />
42                                 <Route
43                                         path="events/:name"
44                                         lazy={() => import(
45                                                 /* webpackChunkName: "events" */
46                                                 '../pages/Event'
47                                         )}
48                                 />
49                                 <Route
50                                         path="h/:hash"
51                                         lazy={() => import(
52                                                 /* webpackChunkName: "seeds" */
53                                                 '../pages/AlttpSeed'
54                                         )}
55                                 />
56                                 <Route
57                                         path="locations"
58                                         element={<Techniques namespace="locations" type="location" />}
59                                 />
60                                 <Route
61                                         path="locations/:name"
62                                         element={<Technique basepath="locations" type="location" />}
63                                 />
64                                 <Route path="map">
65                                         <Route index element={<Navigate replace to="lw" />} />
66                                         <Route
67                                                 path=":activeMap"
68                                                 lazy={() => import(
69                                                         /* webpackChunkName: "map" */
70                                                         '../pages/Map'
71                                                 )}
72                                         />
73                                 </Route>
74                                 <Route
75                                         path="modes"
76                                         element={<Techniques namespace="modes" type="mode" />}
77                                 />
78                                 <Route
79                                         path="modes/:name"
80                                         element={<Technique basepath="modes" type="mode" />}
81                                 />
82                                 <Route
83                                         path="rulesets"
84                                         element={<Techniques namespace="rulesets" type="ruleset" />}
85                                         />
86                                 <Route
87                                         path="rulesets/:name"
88                                         element={<Technique basepath="rulesets" type="ruleset" />}
89                                 />
90                                 <Route
91                                         path="schedule"
92                                         lazy={() => import(
93                                                 /* webpackChunkName: "events" */
94                                                 '../pages/Schedule'
95                                         )}
96                                 />
97                                 <Route
98                                         path="tech"
99                                         element={<Techniques namespace="techniques" type="tech" />}
100                                 />
101                                 <Route
102                                         path="tech/:name"
103                                         element={<Technique basepath="tech" type="tech" />}
104                                 />
105                                 <Route
106                                         path="tournaments/:id"
107                                         lazy={() => import(
108                                                 /* webpackChunkName: "tournament" */
109                                                 '../pages/Tournament'
110                                         )}
111                                 />
112                                 <Route
113                                         path="twitch-bot"
114                                         lazy={() => import(
115                                                 /* webpackChunkName: "admin" */
116                                                 '../pages/TwitchBot'
117                                         )}
118                                 />
119                                 <Route
120                                         path="twitch-legal"
121                                         lazy={() => import(
122                                                 /* webpackChunkName: "twitch" */
123                                                 '../pages/TwitchLegal'
124                                         )}
125                                 />
126                                 <Route path="users/:id" element={<User />} />
127                                 <Route path="/" element={<Front />} />
128                                 <Route path="*" element={<Navigate to="/" />} />
129                         </Route>
130                         <Route
131                                 path="doors-tracker"
132                                 lazy={() => import(
133                                         /* webpackChunkName: "tracker" */
134                                         '../pages/DoorsTracker'
135                                 )}
136                         />
137                         <Route path="guessing-game">
138                                 <Route
139                                         path="controls/:channelId?"
140                                         lazy={() => import(
141                                                 /* webpackChunkName: "guessing" */
142                                                 '../pages/GuessingGameControls'
143                                         )}
144                                 />
145                                 <Route
146                                         path="monitor/:key"
147                                         lazy={() => import(
148                                                 /* webpackChunkName: "guessing" */
149                                                 '../pages/GuessingGameMonitor'
150                                         )}
151                                 />
152                         </Route>
153                 </Route>
154         )
155 );
156
157 const AppRoutes = () => <RouterProvider router={router} />;
158
159 export default AppRoutes;