0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-02 04:19:08 -05:00

Add a help icon to plugins menu items disabled by viewer role

This commit is contained in:
Pablo Alba 2024-11-11 13:08:52 +01:00
parent c89b6e2d6d
commit 134c23c70c
2 changed files with 11 additions and 2 deletions

View file

@ -686,10 +686,12 @@
(dp/open-plugin! manifest user-can-edit?)))))] (dp/open-plugin! manifest user-can-edit?)))))]
[:> dropdown-menu-item* {:key (dm/str "plugins-menu-" idx) [:> dropdown-menu-item* {:key (dm/str "plugins-menu-" idx)
:on-click on-click :on-click on-click
:title (when-not can-open? (tr "workspace.plugins.error.need-editor"))
:class (stl/css-case :submenu-item true :menu-disabled (not can-open?)) :class (stl/css-case :submenu-item true :menu-disabled (not can-open?))
:on-key-down on-key-down} :on-key-down on-key-down}
[:span {:class (stl/css :item-name)} name]]))]))) [:span {:class (stl/css :item-name)} name]
(when-not can-open?
[:span {:class (stl/css :item-icon)
:title (tr "workspace.plugins.error.need-editor")} i/help])]))])))
(mf/defc menu (mf/defc menu
{::mf/props :obj} {::mf/props :obj}

View file

@ -113,3 +113,10 @@
top: $s-192; top: $s-192;
} }
} }
.item-icon {
svg {
@extend .button-icon;
stroke: var(--icon-foreground);
}
}