mirror of
http://172.20.10.11:3000/gitadmin/INSIGHT-MVP.git
synced 2026-06-24 22:46:39 +02:00
fix(frontend): Anwendungen-Gruppe bei Start eingeklappt, Dashboard-Klick resettet auf Home-Tab
- AppLayout: appsOpen initial false (Anwendungen immer eingeklappt beim Laden) - DashboardPage: useLocation + useEffect auf location.key → setzt activeTab auf 'home' bei jedem Navigations-Klick auf Dashboard in der Sidebar Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
5f50ba1315
commit
d9c6240a3e
2 changed files with 9 additions and 2 deletions
|
|
@ -125,7 +125,7 @@ export function AppLayout() {
|
|||
isModuleEnabled('deals') ||
|
||||
isModuleEnabled('pipelines');
|
||||
const [crmOpen, setCrmOpen] = useState(true);
|
||||
const [appsOpen, setAppsOpen] = useState(true);
|
||||
const [appsOpen, setAppsOpen] = useState(false);
|
||||
const [collapsed, setCollapsed] = useState(() => {
|
||||
return localStorage.getItem('sidebar-collapsed') === 'true';
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import { useState } from 'react';
|
||||
import { useState, useEffect } from 'react';
|
||||
import { useLocation } from 'react-router-dom';
|
||||
import { useAuth } from '../auth/AuthContext';
|
||||
import { WeatherWidget } from '../components/WeatherWidget';
|
||||
import { AnalogClock } from '../components/AnalogClock';
|
||||
|
|
@ -698,8 +699,14 @@ function ComingSoonTab({ label }: { label: string }) {
|
|||
|
||||
export function DashboardPage() {
|
||||
const { user } = useAuth();
|
||||
const location = useLocation();
|
||||
const [activeTab, setActiveTab] = useState<DashboardTab>('home');
|
||||
|
||||
// Immer auf Home-Tab springen wenn Dashboard-NavLink geklickt wird
|
||||
useEffect(() => {
|
||||
setActiveTab('home');
|
||||
}, [location.key]);
|
||||
|
||||
return (
|
||||
<div>
|
||||
{/* Tab-Leiste */}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue