From eeb8447d7aa2c5260ce05758c415f820690c3a17 Mon Sep 17 00:00:00 2001 From: "ext.jeremy.guillot@maxicoffee.domains" Date: Wed, 26 Mar 2025 20:25:33 +0100 Subject: [PATCH] =?UTF-8?q?refactor:=20am=C3=A9lioration=20de=20la=20Sideb?= =?UTF-8?q?ar.vue=20avec=20suppression=20de=20MenuItem.vue=20et=20mise=20?= =?UTF-8?q?=C3=A0=20jour=20de=20MenuGroup.vue=20pour=20une=20gestion=20sim?= =?UTF-8?q?plifi=C3=A9e=20des=20=C3=A9l=C3=A9ments=20de=20menu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/shared/components/layout/Sidebar.vue | 44 ++++------------- .../components/layout/sidebar/MenuGroup.vue | 26 +++++++--- .../components/layout/sidebar/MenuItem.vue | 47 ------------------- 3 files changed, 29 insertions(+), 88 deletions(-) delete mode 100644 assets/vue/app/shared/components/layout/sidebar/MenuItem.vue diff --git a/assets/vue/app/shared/components/layout/Sidebar.vue b/assets/vue/app/shared/components/layout/Sidebar.vue index 3e06c94..bce2e03 100644 --- a/assets/vue/app/shared/components/layout/Sidebar.vue +++ b/assets/vue/app/shared/components/layout/Sidebar.vue @@ -9,22 +9,12 @@ @@ -43,8 +33,7 @@ ClockIcon, Cog6ToothIcon, ComputerDesktopIcon - } from '@heroicons/vue/24/outline'; - import MenuItem from './sidebar/MenuItem.vue'; + } from '@heroicons/vue/24/solid'; import MenuGroup from './sidebar/MenuGroup.vue'; const route = useRoute(); @@ -55,22 +44,6 @@ } }); - const isActiveRoute = path => { - return route.path === path; - }; - - const isActive = item => { - if (!item.to) { - return item.subItems?.some(subItem => route.path === subItem.to) || false; - } - - if (item.to === '/') { - return route.path === '/' || ['/add', '/import', '/discover'].includes(route.path); - } - - return route.path.startsWith(item.to); - }; - const menuItems = [ { icon: BookOpenIcon, @@ -90,17 +63,20 @@ { icon: ArrowsRightLeftIcon, text: 'Convertir CBR en CBZ', - to: '/convert' + to: '/convert', + id: 'convert' }, { icon: CalendarIcon, text: 'Calendrier', - to: '/calendar' + to: '/calendar', + id: 'calendar' }, { icon: ClockIcon, text: 'Activité', to: '/activity', + id: 'activity', badge: '3' }, { diff --git a/assets/vue/app/shared/components/layout/sidebar/MenuGroup.vue b/assets/vue/app/shared/components/layout/sidebar/MenuGroup.vue index 9364fd8..beb0223 100644 --- a/assets/vue/app/shared/components/layout/sidebar/MenuGroup.vue +++ b/assets/vue/app/shared/components/layout/sidebar/MenuGroup.vue @@ -14,9 +14,12 @@ }">
- {{ text }} + {{ text }}
- + @@ -32,7 +35,7 @@ - -