feat: Complete design foundation with responsive navigation
Deploy Development / deploy (push) Failing after 26s

Design System:
- app.css already exists with full design tokens, dark mode, responsive breakpoints
- CSS variables for colors, spacing, typography
- Mobile-first layout with safe-area support (iOS notch)

Navigation System:
- config/appNav.js: Single source of truth for navigation items
- Bottom-Nav for mobile (<1024px) with horizontal scrolling
- DesktopSidebar for desktop (≥1024px) with fixed left sidebar
- Role-based navigation (isAdmin adds Admin link)

App.jsx Restructure:
- Responsive layout: Bottom-Nav (mobile) + DesktopSidebar (desktop)
- Protected/Public routes with loading states
- Logout handler with confirmation

PWA Setup:
- viewport-fit=cover for notch support
- apple-mobile-web-app meta tags
- Icon links prepared (icons pending)

Architecture:
- Follows Mitai design patterns
- Responsive breakpoint at 1024px
- Single source of truth for navigation config

Next: Icons, Exercise CRUD, Clubs/Groups Management
This commit is contained in:
Lars committed 2026-04-22 16:25:36 +02:00
1 parent edb33b8fc3
commit 46a90ae910
4 files changed
+211 -9

No files matched your search

@@ -0,0 +1,86 @@
import { NavLink, useLocation } from 'react-router-dom'
import { LogOut } from 'lucide-react'
import { getMainNavItems } from '../config/appNav'
function sidebarLinkActive(pathname, item, routerIsActive) {
if (item.to.startsWith('/admin')) return pathname.startsWith('/admin')
return routerIsActive
}
/**
* Desktop-Sidebar (≥1024px) — Sichtbarkeit via CSS (.desktop-sidebar).
*/
export default function DesktopSidebar({
isAdmin,
user,
onLogout
}) {
const loc = useLocation()
const items = getMainNavItems(isAdmin)
const tier = user?.tier || ''
return (
<aside className="desktop-sidebar" aria-label="Hauptnavigation">
<div className="desktop-sidebar__brand">
<div className="desktop-sidebar__logo" aria-hidden />
<div className="desktop-sidebar__title">Shinkan Jinkendo</div>
</div>
<nav className="desktop-sidebar__nav">
{items.map((item) => (
<NavLink
key={item.to}
to={item.to}
end={!!item.end}
className={({ isActive }) =>
'desktop-sidebar__link' +
(sidebarLinkActive(loc.pathname, item, isActive)
? ' desktop-sidebar__link--active'
: '')
}
>
<item.Icon size={20} strokeWidth={2} />
<span>{item.label}</span>
</NavLink>
))}
</nav>
<div className="desktop-sidebar__footer">
<div className="desktop-sidebar__user">
<div
style={{
width: 32,
height: 32,
borderRadius: '50%',
background: 'var(--accent)',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
color: 'white',
fontWeight: 600,
fontSize: '14px'
}}
>
{user?.name?.charAt(0) || 'U'}
</div>
<div className="desktop-sidebar__user-text">
<span className="desktop-sidebar__user-name">
{user?.name || user?.email || 'User'}
</span>
{tier ? (
<span className="desktop-sidebar__user-tier">{tier}</span>
) : null}
</div>
</div>
<button
type="button"
className="desktop-sidebar__logout"
onClick={onLogout}
title="Abmelden"
>
<LogOut size={18} />
</button>
</div>
</aside>
)
}