aboutsummaryrefslogtreecommitdiffhomepage
path: root/frontend/src/App.tsx
blob: 58b6687e985161d1af16eb70e92083405cf5793f (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
import { Redirect, Route, Switch } from "wouter";
import { Layout, ProtectedRoute } from "./components";
import {
	Login,
	NotFound,
	ReadArticles,
	Settings,
	UnreadArticles,
} from "./pages";

function App() {
	return (
		<Switch>
			<Route path="/login" component={Login} />
			<Route path="*">
				<ProtectedRoute>
					<Layout>
						<Switch>
							<Route path="/" component={() => <Redirect to="/unread" />} />
							<Route path="/unread" component={UnreadArticles} />
							<Route path="/read" component={ReadArticles} />
							<Route path="/settings" component={Settings} />
							<Route component={NotFound} />
						</Switch>
					</Layout>
				</ProtectedRoute>
			</Route>
		</Switch>
	);
}

export default App;