aboutsummaryrefslogtreecommitdiffhomepage
path: root/frontend/src/main.tsx
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2024-07-21 16:13:58 +0900
committernsfisis <nsfisis@gmail.com>2024-07-21 16:13:58 +0900
commita46f583437e9b66ebec6fa22e27567a71b17b497 (patch)
treef375449ee38de9701637fbe77c79111da9f76307 /frontend/src/main.tsx
parent877c19ecbb2425d756f3cbafb1cf52f69279e92d (diff)
downloadphperkaigi-2025-albatross-a46f583437e9b66ebec6fa22e27567a71b17b497.tar.gz
phperkaigi-2025-albatross-a46f583437e9b66ebec6fa22e27567a71b17b497.tar.zst
phperkaigi-2025-albatross-a46f583437e9b66ebec6fa22e27567a71b17b497.zip
react router
Diffstat (limited to 'frontend/src/main.tsx')
-rw-r--r--frontend/src/main.tsx35
1 files changed, 35 insertions, 0 deletions
diff --git a/frontend/src/main.tsx b/frontend/src/main.tsx
new file mode 100644
index 0000000..0df5185
--- /dev/null
+++ b/frontend/src/main.tsx
@@ -0,0 +1,35 @@
+import React from 'react'
+import ReactDOM from 'react-dom/client'
+import {
+ createBrowserRouter,
+ RouterProvider,
+} from 'react-router-dom';
+import Home from './routes/Home.tsx';
+import GolfEntry from './routes/golf/GolfEntry.tsx';
+import GolfPlay from './routes/golf/GolfPlay.tsx';
+import GolfWatch from './routes/golf/GolfWatch.tsx';
+
+const router = createBrowserRouter([
+ {
+ path: "/",
+ element: (<Home />),
+ },
+ {
+ path: "/golf/entry/",
+ element: (<GolfEntry />),
+ },
+ {
+ path: "/golf/:gameId/play/:playerId/",
+ element: (<GolfPlay />),
+ },
+ {
+ path: "/golf/:gameId/watch/",
+ element: (<GolfWatch />),
+ },
+]);
+
+ReactDOM.createRoot(document.getElementById('root')!).render(
+ <React.StrictMode>
+ <RouterProvider router={router} />
+ </React.StrictMode>,
+)