feat: band NC folder config, fix watcher event filter, add light/dark theme

- Add PATCH /bands/{id} endpoint for admins to update nc_folder_path
- Add band NC scan folder UI panel with inline edit
- Fix watcher: use activity type field (not human-readable subject) for upload detection
- Reorder watcher filters: audio extension check first, then band path, then type
- Add dark/light theme toggle using GitHub Primer-inspired CSS custom properties
- All inline styles migrated to CSS variables for theme-awareness

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Steffen Schuhmann
2026-03-29 00:29:58 +01:00
parent 5536bf4394
commit fbac62a0ea
13 changed files with 419 additions and 211 deletions

View File

@@ -1,5 +1,7 @@
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { BrowserRouter, Route, Routes, Navigate } from "react-router-dom";
import "./index.css";
import { ThemeProvider, useTheme } from "./theme";
import { LoginPage } from "./pages/LoginPage";
import { HomePage } from "./pages/HomePage";
import { BandPage } from "./pages/BandPage";
@@ -16,40 +18,73 @@ function PrivateRoute({ children }: { children: React.ReactNode }) {
return token ? <>{children}</> : <Navigate to="/login" replace />;
}
export default function App() {
function ThemeToggle() {
const { theme, toggle } = useTheme();
return (
<QueryClientProvider client={queryClient}>
<BrowserRouter>
<Routes>
<Route path="/login" element={<LoginPage />} />
<Route
path="/bands/:bandId"
element={
<PrivateRoute>
<BandPage />
</PrivateRoute>
}
/>
<Route
path="/bands/:bandId/songs/:songId"
element={
<PrivateRoute>
<SongPage />
</PrivateRoute>
}
/>
<Route
path="/settings"
element={
<PrivateRoute>
<SettingsPage />
</PrivateRoute>
}
/>
<Route path="/invite/:token" element={<InvitePage />} />
<Route path="/" element={<PrivateRoute><HomePage /></PrivateRoute>} />
</Routes>
</BrowserRouter>
</QueryClientProvider>
<button
onClick={toggle}
title={`Switch to ${theme === "dark" ? "light" : "dark"} mode`}
style={{
position: "fixed",
bottom: 20,
right: 20,
zIndex: 9999,
background: "var(--bg-subtle)",
border: "1px solid var(--border)",
borderRadius: "50%",
width: 36,
height: 36,
cursor: "pointer",
fontSize: 16,
display: "flex",
alignItems: "center",
justifyContent: "center",
color: "var(--text-muted)",
boxShadow: "0 2px 8px rgba(0,0,0,0.3)",
}}
>
{theme === "dark" ? "☀" : "◑"}
</button>
);
}
export default function App() {
return (
<ThemeProvider>
<QueryClientProvider client={queryClient}>
<BrowserRouter>
<Routes>
<Route path="/login" element={<LoginPage />} />
<Route
path="/bands/:bandId"
element={
<PrivateRoute>
<BandPage />
</PrivateRoute>
}
/>
<Route
path="/bands/:bandId/songs/:songId"
element={
<PrivateRoute>
<SongPage />
</PrivateRoute>
}
/>
<Route
path="/settings"
element={
<PrivateRoute>
<SettingsPage />
</PrivateRoute>
}
/>
<Route path="/invite/:token" element={<InvitePage />} />
<Route path="/" element={<PrivateRoute><HomePage /></PrivateRoute>} />
</Routes>
<ThemeToggle />
</BrowserRouter>
</QueryClientProvider>
</ThemeProvider>
);
}