aboutsummaryrefslogtreecommitdiffhomepage
path: root/frontend/src/App.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/src/App.tsx')
-rw-r--r--frontend/src/App.tsx35
1 files changed, 24 insertions, 11 deletions
diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx
index 02db0ca..58b6687 100644
--- a/frontend/src/App.tsx
+++ b/frontend/src/App.tsx
@@ -1,18 +1,31 @@
import { Redirect, Route, Switch } from "wouter";
-import { Layout } from "./components";
-import { NotFound, ReadArticles, Settings, UnreadArticles } from "./pages";
+import { Layout, ProtectedRoute } from "./components";
+import {
+ Login,
+ NotFound,
+ ReadArticles,
+ Settings,
+ UnreadArticles,
+} from "./pages";
function App() {
return (
- <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>
+ <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>
);
}