blob: fcf6977904da4c94d11559414d513f669e9708b1 (
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
import { Route, Router, Switch } from "wouter";
import ProtectedRoute from "./components/ProtectedRoute";
import PublicOnlyRoute from "./components/PublicOnlyRoute";
import { BASE_PATH } from "./config";
import DashboardPage from "./pages/DashboardPage";
import GolfPlayPage from "./pages/GolfPlayPage";
import GolfWatchPage from "./pages/GolfWatchPage";
import IndexPage from "./pages/IndexPage";
import LoginPage from "./pages/LoginPage";
import TournamentPage from "./pages/TournamentPage";
export default function App() {
return (
<Router base={BASE_PATH.replace(/\/$/, "")}>
<Switch>
<Route path="/">
<PublicOnlyRoute>
<IndexPage />
</PublicOnlyRoute>
</Route>
<Route path="/login">
<PublicOnlyRoute>
<LoginPage />
</PublicOnlyRoute>
</Route>
<Route path="/dashboard">
<ProtectedRoute>
<DashboardPage />
</ProtectedRoute>
</Route>
<Route path="/golf/:gameId/play">
{(params) => (
<ProtectedRoute>
<GolfPlayPage gameId={params.gameId} />
</ProtectedRoute>
)}
</Route>
<Route path="/golf/:gameId/watch">
{(params) => (
<ProtectedRoute>
<GolfWatchPage gameId={params.gameId} />
</ProtectedRoute>
)}
</Route>
<Route path="/tournament">
<ProtectedRoute>
<TournamentPage />
</ProtectedRoute>
</Route>
<Route>
<div className="min-h-screen bg-gray-100 flex items-center justify-center">
<p className="text-gray-500 text-xl">404 - Page not found</p>
</div>
</Route>
</Switch>
</Router>
);
}
|