diff --git a/frontend/package-lock.json b/frontend/package-lock.json index e8077c6..7db8751 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -7,6 +7,7 @@ "name": "kver-frontend", "dependencies": { "@tanstack/react-query": "^5.104.0", + "lucide-react": "1.48.0", "react": "^19.3.0", "react-dom": "^19.3.0", "react-router": "^8.4.0" @@ -1071,6 +1072,15 @@ "url": "https://opencollective.com/parcel" } }, + "node_modules/lucide-react": { + "version": "1.48.0", + "resolved": "https://registry.npmjs.org/lucide-react/-/lucide-react-1.48.0.tgz", + "integrity": "sha512-R0CIKY/fXiC6y9xRBADgsK+VW2p/pcTJOMhLZf1T+uG+vJUvyUR02nGOgmIIC7MPkiNK4Ox8QDnbqF8rJYWPZQ==", + "license": "ISC", + "peerDependencies": { + "react": "^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0" + } + }, "node_modules/nanoid": { "version": "3.3.19", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.19.tgz", diff --git a/frontend/package.json b/frontend/package.json index 693c68a..473ed2c 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -9,6 +9,7 @@ }, "dependencies": { "@tanstack/react-query": "^5.104.0", + "lucide-react": "1.48.0", "react": "^19.3.0", "react-dom": "^19.3.0", "react-router": "^8.4.0" diff --git a/frontend/src/Layout.tsx b/frontend/src/Layout.tsx index 3956037..a2bee76 100644 --- a/frontend/src/Layout.tsx +++ b/frontend/src/Layout.tsx @@ -1,6 +1,6 @@ import { useEffect, useState } from "react"; import { Link, Outlet, useLocation } from "react-router"; -import { MenuIcon, SettingsIcon } from "./icons"; +import { Menu, Settings } from "lucide-react"; import { Sidebar, TabBar } from "./Nav"; // Tage ohne Datenverlust (fester Startpunkt, Kontinuität seit der alten @@ -43,11 +43,11 @@ export function Layout() { aria-controls="sidebar" onClick={() => setMenuOpen(!menuOpen)} > - +

Kontrollverlust

- + {path === "/" && ( diff --git a/frontend/src/Nav.tsx b/frontend/src/Nav.tsx index 8549852..18fc6d6 100644 --- a/frontend/src/Nav.tsx +++ b/frontend/src/Nav.tsx @@ -1,11 +1,8 @@ import type { ReactNode } from "react"; import { NavLink } from "react-router"; +import { Bell, ChartColumn, House, LogOut, MessageSquare, Search, Settings, User } from "lucide-react"; import { api } from "./api"; import { useAuthChanged, useMe } from "./auth"; -import { - BellIcon, ChatIcon, FeedIcon, ImprintIcon, LogoutIcon, PrivacyIcon, - ProfileIcon, RulesIcon, SearchIcon, SettingsIcon, StatsIcon, -} from "./icons"; type Target = { title: string; icon: ReactNode; to: string; end?: boolean }; @@ -16,23 +13,29 @@ function useMainTargets(): Target[] { const me = useMe().data; const profile = me ? `/u/${encodeURIComponent(me.username)}` : "/me"; return [ - { title: "Feed", icon: , to: "/", end: true }, - { title: "Suche", icon: , to: "/search" }, - { title: "Benachrichtigungen", icon: , to: "/notifications" }, - { title: "Chats", icon: , to: "/chats" }, - { title: "Profil", icon: , to: profile }, + { title: "Feed", icon: , to: "/", end: true }, + { title: "Suche", icon: , to: "/search" }, + { title: "Benachrichtigungen", icon: , to: "/notifications" }, + { title: "Chats", icon: , to: "/chats" }, + { title: "Profil", icon: , to: profile }, ]; } const moreTargets: Target[] = [ - { title: "Einstellungen", icon: , to: "/settings" }, - { title: "Statistik", icon: , to: "/stats" }, + { title: "Einstellungen", icon: , to: "/settings" }, + { title: "Statistik", icon: , to: "/stats" }, ]; +// Die Rechtstexte tragen die Sigillen aus static/assets/sigils statt +// lucide-Icons. +function Sigil({ name }: { name: string }) { + return ; +} + const docs: Target[] = [ - { title: "Datenschutz", icon: , to: "/datenschutz" }, - { title: "Beitragsordnung", icon: , to: "/beitragsordnung" }, - { title: "Impressum", icon: , to: "/impressum" }, + { title: "Datenschutz", icon: , to: "/datenschutz" }, + { title: "Beitragsordnung", icon: , to: "/beitragsordnung" }, + { title: "Impressum", icon: , to: "/impressum" }, ]; // Sidebar: alle Ziele mit Icon und Titel. Auf dem Desktop immer sichtbar, @@ -76,7 +79,7 @@ function Logout({ onDone }: { onDone: () => void }) { return (
  • - +
); diff --git a/frontend/src/app.css b/frontend/src/app.css index c614867..8ff61f7 100644 --- a/frontend/src/app.css +++ b/frontend/src/app.css @@ -99,9 +99,16 @@ h2 { Seitenleiste ist eine Schublade hinter dem Menü. */ .icon { flex: 0 0 auto; + width: 24px; + height: 24px; vertical-align: middle; } +/* Sigillen sind schwarze Bilder: im aktiven (invertierten) Eintrag weiß. */ +#sidebar a.active .sigil { + filter: invert(1); +} + #topbar { display: flex; align-items: center; diff --git a/frontend/src/icons.tsx b/frontend/src/icons.tsx deleted file mode 100644 index 3d13ab6..0000000 --- a/frontend/src/icons.tsx +++ /dev/null @@ -1,112 +0,0 @@ -import type { ReactNode } from "react"; - -// Strichicons als Inline-SVG (keine Icon-Bibliothek): 24er Raster, schwarze -// Linie, eckige Enden -- passend zur rohen Optik. -function Svg({ children }: { children: ReactNode }) { - return ( - - ); -} - -export const FeedIcon = () => ( - - - -); - -export const SearchIcon = () => ( - - - - -); - -export const BellIcon = () => ( - - - -); - -export const ChatIcon = () => ( - - - -); - -export const ProfileIcon = () => ( - - - - -); - -export const StatsIcon = () => ( - - - -); - -export const PrivacyIcon = () => ( - - - - -); - -export const RulesIcon = () => ( - - - -); - -export const ImprintIcon = () => ( - - - - -); - -export const SettingsIcon = () => ( - - - - {/* Zähne: kurze, dicke Striche direkt am Ring (sonst sieht es nach Sonne aus). */} - - -); - -export const LogoutIcon = () => ( - - - -); - -export const MenuIcon = () => ( - - - -); - -export const CloseIcon = () => ( - - - -); diff --git a/notes/frontend.md b/notes/frontend.md index b9b11a6..8a773c8 100644 --- a/notes/frontend.md +++ b/notes/frontend.md @@ -46,8 +46,7 @@ githooks` läuft das nach jedem Commit automatisch im Hintergrund (Log: | `src/auth.ts` | `useMe()` (eigenes Konto oder `null`), `useAuthChanged()` | | `src/main.tsx` | Router, QueryClient | | `src/Layout.tsx` | Seitenrahmen: Kopf (mobil mit Menü und Einstellungen), Schublade | -| `src/Nav.tsx` | Seitenleiste (alle Ziele) und mobile TabBar (fünf wichtigste) | -| `src/icons.tsx` | Strichicons als Inline-SVG (keine Icon-Bibliothek) | +| `src/Nav.tsx` | Seitenleiste (alle Ziele) und mobile TabBar (fünf wichtigste); Icons von lucide-react, die Rechtstexte tragen die Sigillen aus `static/assets/sigils` | | `src/docs/*.html` | Rechtstexte (Impressum, Datenschutz, Beitragsordnung) | | `src/pages/*` | Startseite, Thread, Profil, Statistik, Rechtstexte (`DocPage.tsx`); `Placeholder.tsx` für Suche, Benachrichtigungen, Chats, Einstellungen und die Profil-Weiche `/me` | | `src/components/*` | Feed, Beitragskarte, Votes, Repost, Login, Beitrag verfassen |