diff --git a/client/src/components/DashboardLayout.tsx b/client/src/components/DashboardLayout.tsx index 1f753eb..89d9941 100644 --- a/client/src/components/DashboardLayout.tsx +++ b/client/src/components/DashboardLayout.tsx @@ -182,6 +182,19 @@ function DashboardLayoutContent({ setOpenSection(prev => prev === label ? null : label); }; + // Ouvrir automatiquement la section parent quand on navigue vers une page enfant + useEffect(() => { + for (const section of menuStructure) { + if (section.children) { + const hasActiveChild = section.children.some(child => child.path === location); + if (hasActiveChild && openSection !== section.label) { + setOpenSection(section.label); + break; + } + } + } + }, [location]); + useEffect(() => { if (isCollapsed) { setIsResizing(false); diff --git a/todo.md b/todo.md index 4f8bc68..3b31848 100644 --- a/todo.md +++ b/todo.md @@ -425,5 +425,10 @@ - [x] Ajouter des animations fluides pour l'ouverture/fermeture - [x] Améliorer les effets hover et les transitions - [x] Optimiser les espacements et la typographie -- [ ] Tester le comportement exclusif +- [x] Tester le comportement exclusif +- [x] Déployer sur le VPS + +## Correction bug accordéon +- [x] Empêcher la fermeture de l'accordéon lors du clic sur un sous-menu +- [ ] Tester le comportement après correction - [ ] Déployer sur le VPS