From 80f4c3d9a521321fff9d9ec495172b2a8318b0a4 Mon Sep 17 00:00:00 2001 From: Volpeon Date: Tue, 17 Oct 2023 12:37:17 +0200 Subject: Fix badge in menu item --- tpl/objects/badge.pug | 3 ++- tpl/views/menu.pug | 14 ++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) (limited to 'tpl') diff --git a/tpl/objects/badge.pug b/tpl/objects/badge.pug index 1525130..441eb51 100644 --- a/tpl/objects/badge.pug +++ b/tpl/objects/badge.pug @@ -1,7 +1,8 @@ mixin badge(variant) - let classes = { - 'o-badge': true + 'o-badge': true, + 'o-menu__badge': !!attributes.menu } if (attributes.size) { classes['o-badge--' + attributes.size] = true diff --git a/tpl/views/menu.pug b/tpl/views/menu.pug index 6d2cf10..4d7444f 100644 --- a/tpl/views/menu.pug +++ b/tpl/views/menu.pug @@ -19,10 +19,16 @@ mixin view-menu +menu-item(header=true) = 'Libera' - +menu-item(icon='hash')= 'achannel' - +menu-item(icon='hash')= 'kitsuneirc' - +menu-item(icon='green' iconIsStatus=true)= 'volpeon' - +menu-item(icon='red' iconIsStatus=true)= 'someone' + +menu-item(icon='hash') + = 'achannel' + +badge('primary')(menu=true)= '12 ' + +menu-item(icon='hash') + = 'kitsuneirc' + +badge(menu=true)= '31 ' + +menu-item(icon='green' iconIsStatus=true) + = 'volpeon' + +menu-item(icon='red' iconIsStatus=true) + = 'someone' +menu-separator -- cgit v1.2.3-70-g09d2