diff options
| author | Adam Mathes <adam@adammathes.com> | 2026-02-14 10:12:22 -0800 |
|---|---|---|
| committer | Adam Mathes <adam@adammathes.com> | 2026-02-14 10:12:22 -0800 |
| commit | 9d3b2a90316a1a5f735845f61abbd8a875529060 (patch) | |
| tree | b51c86306a75c4ea57a0e733eeda67a099f15d58 /frontend/src/App.tsx | |
| parent | 90fa99359fafea4b0e10a88716675de9de4593ed (diff) | |
| download | neko-9d3b2a90316a1a5f735845f61abbd8a875529060.tar.gz neko-9d3b2a90316a1a5f735845f61abbd8a875529060.tar.bz2 neko-9d3b2a90316a1a5f735845f61abbd8a875529060.zip | |
feat: add font theme support (fixing NK-rn4nzp)
Diffstat (limited to 'frontend/src/App.tsx')
| -rw-r--r-- | frontend/src/App.tsx | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 74ae89e..1812451 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -36,12 +36,19 @@ import FeedList from './components/FeedList'; import FeedItems from './components/FeedItems'; import Settings from './components/Settings'; -function Dashboard({ theme, setTheme }: { theme: string; setTheme: (t: string) => void }) { +interface DashboardProps { + theme: string; + setTheme: (t: string) => void; + fontTheme: string; + setFontTheme: (t: string) => void; +} + +function Dashboard({ theme, setTheme, fontTheme, setFontTheme }: DashboardProps) { const [sidebarVisible, setSidebarVisible] = useState(true); return ( <div - className={`dashboard ${sidebarVisible ? 'sidebar-visible' : 'sidebar-hidden'} theme-${theme}`} + className={`dashboard ${sidebarVisible ? 'sidebar-visible' : 'sidebar-hidden'} theme-${theme} font-${fontTheme}`} > <div className="dashboard-content"> {!sidebarVisible && ( @@ -60,7 +67,7 @@ function Dashboard({ theme, setTheme }: { theme: string; setTheme: (t: string) = <Routes> <Route path="/feed/:feedId" element={<FeedItems />} /> <Route path="/tag/:tagName" element={<FeedItems />} /> - <Route path="/settings" element={<Settings />} /> + <Route path="/settings" element={<Settings fontTheme={fontTheme} setFontTheme={setFontTheme} />} /> <Route path="/" element={<FeedItems />} /> </Routes> </main> @@ -71,12 +78,18 @@ function Dashboard({ theme, setTheme }: { theme: string; setTheme: (t: string) = function App() { const [theme, setTheme] = useState(localStorage.getItem('neko-theme') || 'light'); + const [fontTheme, setFontTheme] = useState(localStorage.getItem('neko-font-theme') || 'default'); const handleSetTheme = (newTheme: string) => { setTheme(newTheme); localStorage.setItem('neko-theme', newTheme); }; + const handleSetFontTheme = (newFontTheme: string) => { + setFontTheme(newFontTheme); + localStorage.setItem('neko-font-theme', newFontTheme); + }; + const basename = window.location.pathname.startsWith('/v2') ? '/v2' : '/'; return ( @@ -87,7 +100,12 @@ function App() { path="/*" element={ <RequireAuth> - <Dashboard theme={theme} setTheme={handleSetTheme} /> + <Dashboard + theme={theme} + setTheme={handleSetTheme} + fontTheme={fontTheme} + setFontTheme={handleSetFontTheme} + /> </RequireAuth> } /> |
