diff options
| author | Adam Mathes <adam@adammathes.com> | 2026-02-13 07:46:58 -0800 |
|---|---|---|
| committer | Adam Mathes <adam@adammathes.com> | 2026-02-13 09:38:38 -0800 |
| commit | 23a48e1d498680be769e931f46ddb1fd44f38d1a (patch) | |
| tree | 54bb607e19b3eec0e5c932e6748d9ca6304d4b17 /frontend/src/App.tsx | |
| parent | a5cd9538b0db731a0d0e10e58804ef8ad32211b7 (diff) | |
| download | neko-23a48e1d498680be769e931f46ddb1fd44f38d1a.tar.gz neko-23a48e1d498680be769e931f46ddb1fd44f38d1a.tar.bz2 neko-23a48e1d498680be769e931f46ddb1fd44f38d1a.zip | |
Implement Tag View and fix tests
Diffstat (limited to 'frontend/src/App.tsx')
| -rw-r--r-- | frontend/src/App.tsx | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 8c7be19..09148d6 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -1,5 +1,5 @@ import React, { useEffect, useState } from 'react'; -import { BrowserRouter, Routes, Route, Navigate, useLocation } from 'react-router-dom'; +import { BrowserRouter, Routes, Route, Navigate, useLocation, useNavigate } from 'react-router-dom'; import Login from './components/Login'; import './App.css'; @@ -36,24 +36,17 @@ import FeedItems from './components/FeedItems'; import Settings from './components/Settings'; function Dashboard() { + const navigate = useNavigate(); return ( <div className="dashboard"> <header className="dashboard-header"> <h1>Neko Reader</h1> <nav> - <a href="/settings" onClick={(e) => { - e.preventDefault(); - window.history.pushState({}, '', '/settings'); - // Quick hack for navigation without full router link if inside Router context, - // but here we are inside BrowserRouter so we should use Link or just simple navigation - // actually let's just use a real Link if we can, but we need import. - // For now, let's just rely on the Router catching the URL change if we use proper Link - // or just a button that navigates. - }} style={{ color: 'white', marginRight: '1rem' }}>Settings</a> + <button onClick={() => navigate('/settings')} className="nav-link" style={{ color: 'white', marginRight: '1rem', background: 'none', border: 'none', cursor: 'pointer', fontSize: 'inherit', fontFamily: 'inherit' }}>Settings</button> <button onClick={() => { fetch('/api/logout', { method: 'POST' }) - .then(() => window.location.href = '/login/'); + .then(() => window.location.href = '/v2/login'); }} className="logout-btn"> Logout </button> @@ -66,6 +59,7 @@ function Dashboard() { <main className="dashboard-main"> <Routes> <Route path="/feed/:feedId" element={<FeedItems />} /> + <Route path="/tag/:tagName" element={<FeedItems />} /> <Route path="/settings" element={<Settings />} /> <Route path="/" element={<p>Select a feed to view items.</p>} /> </Routes> |
