From 14884e6e55bcdadabf029ef6e72b15d77297a943 Mon Sep 17 00:00:00 2001 From: Lars Date: Wed, 6 May 2026 10:37:01 +0200 Subject: [PATCH] UX. refactor: simplify AdminPageNav component by removing unused hooks and improving styling - Removed the useLocation hook as it was unnecessary for the component's functionality. - Updated the navigation styling to use CSS classes instead of inline styles, enhancing maintainability and readability. - Improved accessibility by adding aria-labels to navigation elements. --- frontend/src/app.css | 115 +++++++++++++++++++- frontend/src/components/AdminPageNav.jsx | 49 ++------- frontend/src/components/AppSubnavShell.jsx | 50 +++++++++ frontend/src/pages/AdminHierarchyPage.jsx | 85 +++------------ frontend/src/pages/Dashboard.jsx | 82 ++++---------- frontend/src/pages/TrainingPlanningPage.jsx | 95 ++++++++-------- 6 files changed, 255 insertions(+), 221 deletions(-) create mode 100644 frontend/src/components/AppSubnavShell.jsx diff --git a/frontend/src/app.css b/frontend/src/app.css index da9d417..cd5bc65 100644 --- a/frontend/src/app.css +++ b/frontend/src/app.css @@ -1,7 +1,7 @@ :root { - --bg: #f4f3ef; + --bg: #f6f5f0; --surface: #ffffff; - --surface2: #f9f8f5; + --surface2: #fafaf6; --border: rgba(0,0,0,0.09); --border2: rgba(0,0,0,0.16); --text1: #1c1b18; @@ -1075,6 +1075,15 @@ a.analysis-split__nav-item { } } +button.capture-shell__nav-item { + font-family: inherit; + text-align: left; + -webkit-tap-highlight-color: transparent; +} +.capture-shell__nav-item svg.capture-shell__nav-icon { + flex-shrink: 0; +} + /* Einstellungen: gleiche Split-Struktur wie Analyse/Admin */ .settings-shell { width: 100%; @@ -1135,6 +1144,108 @@ a.analysis-split__nav-item { background: var(--surface2); } +/* Admin: horizontale Seiten-Weiche (Hierarchie · Nutzer · …) */ +.admin-top-nav { + display: flex; + gap: 8px; + border-bottom: 2px solid var(--border); + margin-bottom: 24px; + flex-wrap: wrap; +} +.admin-top-nav__link { + padding: 12px 18px; + background: transparent; + border: none; + border-bottom: 3px solid transparent; + margin-bottom: -2px; + cursor: pointer; + font-size: 15px; + font-weight: 500; + color: var(--text2); + text-decoration: none; + display: inline-flex; + align-items: center; + gap: 8px; + transition: color 0.15s, background 0.15s, border-color 0.15s; + font-family: inherit; + border-radius: 8px 8px 0 0; + box-sizing: border-box; +} +.admin-top-nav__link:hover { + color: var(--text1); + background: var(--surface2); +} +.admin-top-nav__link--active { + color: var(--accent); + border-bottom-color: var(--accent); + background: transparent; +} + +/* Trainingsplanung: kompakte Segmente (Gruppe / Verein) */ +.planning-segment-group { + display: inline-flex; + border-radius: 10px; + border: 1.5px solid var(--border2); + overflow: hidden; + background: var(--surface2); +} +.planning-segment-group__btn { + border: none; + padding: 8px 14px; + font-weight: 600; + font-size: 0.85rem; + cursor: pointer; + font-family: inherit; + background: transparent; + color: var(--text1); + white-space: nowrap; + transition: background 0.12s, color 0.12s; +} +.planning-segment-group__btn:disabled { + cursor: not-allowed; + opacity: 0.55; +} +.planning-segment-group__btn--active { + background: var(--accent); + color: #fff; +} +.planning-segment-group__btn:not(:first-child) { + border-left: 1.5px solid var(--border2); +} + +/* Ausklappbare Kontext-Hilfe (Filterzeile Planung) */ +.planning-filter-help { + flex: 1 1 100%; + margin-top: 4px; + max-width: 100%; +} +.planning-filter-help__summary { + cursor: pointer; + font-size: 0.8rem; + font-weight: 600; + color: var(--accent-dark); + list-style: none; + user-select: none; +} +.planning-filter-help__summary::-webkit-details-marker { + display: none; +} +.planning-filter-help__body { + margin-top: 10px; + padding: 12px 14px; + font-size: 0.82rem; + line-height: 1.5; + color: var(--text2); + background: var(--surface2); + border: 1px solid var(--border); + border-radius: 10px; +} +@media (prefers-color-scheme: dark) { + .planning-filter-help__summary { + color: var(--accent); + } +} + /* Admin: Split-Layout wie .analysis-split (nur Gruppen in der Nav) */ .admin-shell { width: 100%; diff --git a/frontend/src/components/AdminPageNav.jsx b/frontend/src/components/AdminPageNav.jsx index 4ad7a50..2e6aa4c 100644 --- a/frontend/src/components/AdminPageNav.jsx +++ b/frontend/src/components/AdminPageNav.jsx @@ -1,4 +1,4 @@ -import { NavLink, useLocation } from 'react-router-dom' +import { NavLink } from 'react-router-dom' import { TreePine, FolderTree, Download, Grid3x3, Users } from 'lucide-react' /** @@ -6,8 +6,6 @@ import { TreePine, FolderTree, Download, Grid3x3, Users } from 'lucide-react' * Wechselt zwischen verschiedenen Admin-Seiten */ export default function AdminPageNav() { - const location = useLocation() - const pages = [ { to: '/admin/hierarchy', label: 'Hierarchie', icon: TreePine }, { to: '/admin/users', label: 'Nutzer', icon: Users }, @@ -17,51 +15,18 @@ export default function AdminPageNav() { ] return ( -