Navigation: lucide-Icons, Sigillen für die Rechtstexte

Die selbstgezeichneten Icons passten nicht zur rohen Optik. Die Ziele nutzen
jetzt lucide-react (1.48.0, fest gepinnt); Datenschutz, Beitragsordnung und
Impressum tragen Chaos-Stern, Anarcho-A und Sab-Cat aus static/assets/sigils.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TiXsPUqw7oeomZ8wZrQW5q
This commit is contained in:
irrlicht
2026-10-09 22:16:42 +02:00
co-authored by Claude Opus 5.5
parent f0dbb67054
commit 2b17f6b58c
7 changed files with 40 additions and 132 deletions
+10
View File
@@ -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",
+1
View File
@@ -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"
+3 -3
View File
@@ -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)}
>
<MenuIcon />
<Menu className="icon" />
</button>
<Link to="/"><h1>Kontrollverlust</h1></Link>
<Link className="icon-btn mobile-only" to="/settings" aria-label="Einstellungen">
<SettingsIcon />
<Settings className="icon" />
</Link>
</div>
{path === "/" && (
+18 -15
View File
@@ -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: <FeedIcon />, to: "/", end: true },
{ title: "Suche", icon: <SearchIcon />, to: "/search" },
{ title: "Benachrichtigungen", icon: <BellIcon />, to: "/notifications" },
{ title: "Chats", icon: <ChatIcon />, to: "/chats" },
{ title: "Profil", icon: <ProfileIcon />, to: profile },
{ title: "Feed", icon: <House className="icon" />, to: "/", end: true },
{ title: "Suche", icon: <Search className="icon" />, to: "/search" },
{ title: "Benachrichtigungen", icon: <Bell className="icon" />, to: "/notifications" },
{ title: "Chats", icon: <MessageSquare className="icon" />, to: "/chats" },
{ title: "Profil", icon: <User className="icon" />, to: profile },
];
}
const moreTargets: Target[] = [
{ title: "Einstellungen", icon: <SettingsIcon />, to: "/settings" },
{ title: "Statistik", icon: <StatsIcon />, to: "/stats" },
{ title: "Einstellungen", icon: <Settings className="icon" />, to: "/settings" },
{ title: "Statistik", icon: <ChartColumn className="icon" />, to: "/stats" },
];
// Die Rechtstexte tragen die Sigillen aus static/assets/sigils statt
// lucide-Icons.
function Sigil({ name }: { name: string }) {
return <img className="icon sigil" src={`/static/assets/sigils/${name}.svg`} alt="" />;
}
const docs: Target[] = [
{ title: "Datenschutz", icon: <PrivacyIcon />, to: "/datenschutz" },
{ title: "Beitragsordnung", icon: <RulesIcon />, to: "/beitragsordnung" },
{ title: "Impressum", icon: <ImprintIcon />, to: "/impressum" },
{ title: "Datenschutz", icon: <Sigil name="chaos_star" />, to: "/datenschutz" },
{ title: "Beitragsordnung", icon: <Sigil name="anarchy_a" />, to: "/beitragsordnung" },
{ title: "Impressum", icon: <Sigil name="sab_cat" />, to: "/impressum" },
];
// Sidebar: alle Ziele mit Icon und Titel. Auf dem Desktop immer sichtbar,
@@ -76,7 +79,7 @@ function Logout({ onDone }: { onDone: () => void }) {
return (
<ul>
<li>
<button id="logout-btn" onClick={logout}><LogoutIcon /><span>Logout</span></button>
<button id="logout-btn" onClick={logout}><LogOut className="icon" /><span>Logout</span></button>
</li>
</ul>
);
+7
View File
@@ -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;
-112
View File
@@ -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 (
<svg
className="icon"
viewBox="0 0 24 24"
width="24"
height="24"
fill="none"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="square"
strokeLinejoin="miter"
aria-hidden="true"
focusable="false"
>
{children}
</svg>
);
}
export const FeedIcon = () => (
<Svg>
<path d="M3 11l9-8 9 8M5 9v12h14V9M10 21v-6h4v6" />
</Svg>
);
export const SearchIcon = () => (
<Svg>
<circle cx="10" cy="10" r="6" />
<path d="M15 15l5 5" />
</Svg>
);
export const BellIcon = () => (
<Svg>
<path d="M6 17V10a6 6 0 0 1 12 0v7M4 17h16M10 21h4" />
</Svg>
);
export const ChatIcon = () => (
<Svg>
<path d="M4 4h16v12H10l-4 4v-4H4z" />
</Svg>
);
export const ProfileIcon = () => (
<Svg>
<circle cx="12" cy="8" r="4" />
<path d="M4 21c0-4 4-6 8-6s8 2 8 6" />
</Svg>
);
export const StatsIcon = () => (
<Svg>
<path d="M4 20h16M7 20v-6M12 20V6M17 20v-10" />
</Svg>
);
export const PrivacyIcon = () => (
<Svg>
<rect x="5" y="11" width="14" height="10" />
<path d="M8 11V7a4 4 0 0 1 8 0v4" />
</Svg>
);
export const RulesIcon = () => (
<Svg>
<path d="M6 3h12v18H6zM9 8h6M9 12h6M9 16h4" />
</Svg>
);
export const ImprintIcon = () => (
<Svg>
<circle cx="12" cy="12" r="9" />
<path d="M12 11v6M12 7v1" />
</Svg>
);
export const SettingsIcon = () => (
<Svg>
<circle cx="12" cy="12" r="6" />
<circle cx="12" cy="12" r="2" />
{/* Zähne: kurze, dicke Striche direkt am Ring (sonst sieht es nach Sonne aus). */}
<path
d="M12 2.5v4M12 17.5v4M2.5 12h4M17.5 12h4M5.3 5.3l2.8 2.8M15.9 15.9l2.8 2.8M5.3 18.7l2.8-2.8M15.9 8.1l2.8-2.8"
strokeWidth="3.5"
strokeLinecap="butt"
/>
</Svg>
);
export const LogoutIcon = () => (
<Svg>
<path d="M10 4H4v16h6M14 8l4 4-4 4M18 12H9" />
</Svg>
);
export const MenuIcon = () => (
<Svg>
<path d="M3 6h18M3 12h18M3 18h18" />
</Svg>
);
export const CloseIcon = () => (
<Svg>
<path d="M5 5l14 14M19 5L5 19" />
</Svg>
);
+1 -2
View File
@@ -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 |