Match sidebar bottom layout to the Wochenplanung reference (theme toggle + Abmelden in one row)
Square icon-only theme toggle sits next to the Abmelden button in a shared row, collapsing to just the toggle when the sidebar is collapsed - same arrangement as pm-app's Sidebar.tsx. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
parent
c56cfb30ad
commit
8d2948cdb1
3 changed files with 38 additions and 19 deletions
|
|
@ -200,12 +200,17 @@ export function Sidebar({ isCollapsed, onToggleCollapsed }: SidebarProps) {
|
|||
<span className="sidebar-identity-name">{user.name}</span>
|
||||
</div>
|
||||
)}
|
||||
<ThemeToggle />
|
||||
{user && (
|
||||
<button type="button" className="sidebar-logout" onClick={() => void logout()}>
|
||||
{isCollapsed ? "⏻" : "Abmelden"}
|
||||
</button>
|
||||
)}
|
||||
{/* Toggle and Abmelden share one row: the toggle stays a fixed-size
|
||||
square, Abmelden takes the rest of the width. Collapsed, only
|
||||
the square toggle remains (centered). */}
|
||||
<div className="sidebar-bottom-row">
|
||||
<ThemeToggle />
|
||||
{user && !isCollapsed && (
|
||||
<button type="button" className="sidebar-logout" onClick={() => void logout()}>
|
||||
Abmelden
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</aside>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -48,16 +48,17 @@ export function ThemeToggle() {
|
|||
}
|
||||
|
||||
return (
|
||||
// Square, icon-only: it shares a row with the Abmelden button, so there
|
||||
// is no room for a text label. The label moves to title/aria-label.
|
||||
<button
|
||||
aria-pressed={theme === "dark"}
|
||||
className="sidebar-theme-toggle"
|
||||
onClick={toggleTheme}
|
||||
title={theme === "dark" ? "Hellmodus" : "Dunkelmodus"}
|
||||
aria-label={theme === "dark" ? "Hellmodus einschalten" : "Dunkelmodus einschalten"}
|
||||
type="button"
|
||||
>
|
||||
<span className="sidebar-icon" aria-hidden="true">
|
||||
{theme === "dark" ? "☀" : "☾"}
|
||||
</span>
|
||||
{theme === "dark" ? "Hellmodus" : "Dunkelmodus"}
|
||||
<span aria-hidden="true">{theme === "dark" ? "☀" : "☾"}</span>
|
||||
</button>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue