aboutsummaryrefslogtreecommitdiffhomepage
path: root/frontend/src/main.tsx
blob: eb5399fd83bf850d6b77964a4bc7c24f44daec77 (plain)
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
import React from 'react'
import ReactDOM from 'react-dom/client'
import {
  createBrowserRouter,
  RouterProvider,
} from 'react-router-dom';
import Home from './routes/Home.tsx';
import Login from './routes/Login.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: "/login/",
    element: (<Login />),
  },
  {
    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>,
)