Skip to content

Commit

Permalink
feat: show badge for orders menu item
Browse files Browse the repository at this point in the history
  • Loading branch information
doroudi committed Jan 20, 2024
1 parent 7ea11d1 commit fb1f812
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/components/Sidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down Expand Up @@ -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) })
}
</script>
Expand Down

0 comments on commit fb1f812

Please sign in to comment.