From fb1f8124f42d53830097b7ad437dd52be767e456 Mon Sep 17 00:00:00 2001 From: Saeid Doroudi Date: Sat, 20 Jan 2024 17:14:30 +0330 Subject: [PATCH] feat: show badge for orders menu item --- src/components/Sidebar.vue | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/Sidebar.vue b/src/components/Sidebar.vue index 0fa32cc..d16df79 100644 --- a/src/components/Sidebar.vue +++ b/src/components/Sidebar.vue @@ -79,12 +79,9 @@ const menuOptions: MenuOption[] = [ ], }, { - label: () => [ - renderLabel(t('menu.orders'), '/orders'), - h(NBadge, { processing: true, dot: true, value: 20, class: 'ml-2' }, {}), - ], + label: () => renderLabel(t('menu.orders'), '/orders'), key: 'orders', - icon: renderIcon(InvoicesIcon), + icon: renderIcon(InvoicesIcon, true), }, { label: t('menu.feedbacks'), @@ -154,7 +151,10 @@ const menuOptions: MenuOption[] = [ }, ] -function renderIcon(icon: any) { +function renderIcon(icon: any, showBadge = false) { + if (showBadge) + return () => h(NBadge, { processing: true, dot: true, type: 'success', offset: [-2, 2] }, { default: () => h(NIcon, { color: '#000' }, { default: () => h(icon) }) }) + return () => h(NIcon, null, { default: () => h(icon) }) }