From 74ca4fc514605dd8be39e0a5b133534f6740a23e Mon Sep 17 00:00:00 2001 From: Volpeon Date: Mon, 7 Feb 2022 19:05:45 +0100 Subject: Improved action menu example --- tpl/index.pug | 1 + tpl/objects/action-menu.pug | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/tpl/index.pug b/tpl/index.pug index 1b10016..5112f87 100644 --- a/tpl/index.pug +++ b/tpl/index.pug @@ -447,6 +447,7 @@ html +action-button(quiet=true selected=true)= 'Menu' +action-menu +action-menu-item(icon='user')= 'View profile' + +action-menu-item(icon='red' iconIsStatus=true)= 'Mark as away' +action-menu-separator +action-menu-item(icon='trash')= 'Delete' +action-menu-item(icon='bookmark')= 'Bookmark' diff --git a/tpl/objects/action-menu.pug b/tpl/objects/action-menu.pug index 6ab4e0d..e236b7c 100644 --- a/tpl/objects/action-menu.pug +++ b/tpl/objects/action-menu.pug @@ -1,5 +1,6 @@ -include ../objects/action-button.pug +include action-button.pug include icon.pug +include status-indicator.pug mixin action-menu - @@ -17,7 +18,10 @@ mixin action-menu-item .l-card.l-card--flush .l-card__block.o-action-menu__icon-slot if attributes.icon - +icon(attributes.icon)(class='o-action-menu__icon') + if attributes.iconIsStatus + +status-indicator(attributes.icon)(class='o-action-menu__icon') + else + +icon(attributes.icon)(class='o-action-menu__icon') .l-card__block.l-card__block--main block .l-card__block.o-action-menu__icon-slot -- cgit v1.2.3-70-g09d2