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