diff options
| author | nsfisis <nsfisis@gmail.com> | 2025-11-02 00:00:35 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2025-11-02 00:00:35 +0900 |
| commit | 104341ddc4add57f83c58cb3fabb23b6fbfdd3e4 (patch) | |
| tree | 862b109fe257e6170a88929729dae3bddfb6eb49 /frontend/src/App.tsx | |
| parent | ba1e0c904f810193f25d4f88cc2bb168f1d625fe (diff) | |
| download | feedaka-104341ddc4add57f83c58cb3fabb23b6fbfdd3e4.tar.gz feedaka-104341ddc4add57f83c58cb3fabb23b6fbfdd3e4.tar.zst feedaka-104341ddc4add57f83c58cb3fabb23b6fbfdd3e4.zip | |
Diffstat (limited to 'frontend/src/App.tsx')
| -rw-r--r-- | frontend/src/App.tsx | 35 |
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> ); } |
