fix(frontend): Topbar auf Dashboard ausblenden – Profil nur in Tab-Leiste

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Thomas Reitz 2026-03-13 15:53:26 +01:00
parent 2af54246c8
commit 8b4a71edb2

View file

@ -1,5 +1,5 @@
import { useState, useEffect, useCallback } from 'react'; import { useState, useEffect, useCallback } from 'react';
import { Outlet, NavLink, useNavigate } from 'react-router-dom'; import { Outlet, NavLink, useNavigate, useLocation } from 'react-router-dom';
import { useQuery } from '@tanstack/react-query'; import { useQuery } from '@tanstack/react-query';
import { useAuth } from '../auth/AuthContext'; import { useAuth } from '../auth/AuthContext';
import { UserAvatar } from '../components/UserAvatar'; import { UserAvatar } from '../components/UserAvatar';
@ -113,7 +113,11 @@ const THEME_OPTIONS = [
export function AppLayout() { export function AppLayout() {
const { user, logout } = useAuth(); const { user, logout } = useAuth();
const navigate = useNavigate(); const navigate = useNavigate();
const location = useLocation();
const { mode, setMode } = useTheme(); const { mode, setMode } = useTheme();
// Auf der Dashboard-Seite hat die Tab-Leiste bereits das Profil kein Topbar nötig
const isDashboard = location.pathname === '/';
const { isModuleEnabled } = useCrmSettings(); const { isModuleEnabled } = useCrmSettings();
// Silently sync INSIGHT profile from O365 once per browser session // Silently sync INSIGHT profile from O365 once per browser session
@ -584,8 +588,8 @@ export function AppLayout() {
marginLeft: collapsed ? 60 : (branding?.sidebarWidth ?? undefined), marginLeft: collapsed ? 60 : (branding?.sidebarWidth ?? undefined),
}} }}
> >
{/* Topbar: Profil + Logout + Modiwahl oben rechts */} {/* Topbar: Profil + Logout + Modiwahl oben rechts (nicht auf Dashboard) */}
<header className={styles.topbar}> <header className={styles.topbar} style={isDashboard ? { display: 'none' } : undefined}>
{/* Theme-Schalter (☀ ☾ ⚙) */} {/* Theme-Schalter (☀ ☾ ⚙) */}
<div className={styles.topbarThemeGroup}> <div className={styles.topbarThemeGroup}>
{THEME_OPTIONS.map((opt) => ( {THEME_OPTIONS.map((opt) => (