mirror of
https://github.com/penpot/penpot.git
synced 2026-02-12 22:53:02 +00:00
✨ Show create variant shortcut also for stand-alone components (#7195)
This commit is contained in:
@@ -876,6 +876,11 @@
|
||||
(when can-swap? (st/emit! (dwsp/open-specialized-panel :component-swap)))
|
||||
(tm/schedule-on-idle #(dom/focus! (dom/get-element search-id))))))
|
||||
|
||||
transform-into-variant
|
||||
(mf/use-fn
|
||||
(mf/deps id)
|
||||
#(st/emit! (dwv/transform-in-variant id)))
|
||||
|
||||
create-variant
|
||||
(mf/use-fn
|
||||
(mf/deps id)
|
||||
@@ -936,10 +941,10 @@
|
||||
:on-click on-click-variant-title-help
|
||||
:icon "help"}])
|
||||
|
||||
(when (and is-variant? main-instance?)
|
||||
(when main-instance?
|
||||
[:> icon-button* {:variant "ghost"
|
||||
:aria-label (tr "workspace.shape.menu.add-variant")
|
||||
:on-click create-variant
|
||||
:on-click (if is-variant? create-variant transform-into-variant)
|
||||
:icon "variant"}])])]
|
||||
|
||||
(when open?
|
||||
|
||||
Reference in New Issue
Block a user