aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/client/App.tsx
blob: 8da919d77a06df35182268e8f4e00586d5bf9f19 (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
import { Route, Switch } from "wouter";
import { OfflineBanner, ProtectedRoute } from "./components";
import {
	DeckCardsPage,
	DeckDetailPage,
	HomePage,
	LoginPage,
	NoteTypesPage,
	NotFoundPage,
	StudyPage,
} from "./pages";

export function App() {
	return (
		<div className="min-h-screen flex flex-col">
			<OfflineBanner />
			<div className="flex-1">
				<Switch>
					<Route path="/">
						<ProtectedRoute>
							<HomePage />
						</ProtectedRoute>
					</Route>
					<Route path="/decks/:deckId/cards">
						<ProtectedRoute>
							<DeckCardsPage />
						</ProtectedRoute>
					</Route>
					<Route path="/decks/:deckId/study">
						<ProtectedRoute>
							<StudyPage />
						</ProtectedRoute>
					</Route>
					<Route path="/decks/:deckId">
						<ProtectedRoute>
							<DeckDetailPage />
						</ProtectedRoute>
					</Route>
					<Route path="/note-types">
						<ProtectedRoute>
							<NoteTypesPage />
						</ProtectedRoute>
					</Route>
					<Route path="/login" component={LoginPage} />
					<Route component={NotFoundPage} />
				</Switch>
			</div>
			<footer className="py-2 text-center text-xs text-muted">
				v{__APP_VERSION__}
			</footer>
		</div>
	);
}