mirror of
https://github.com/penpot/penpot.git
synced 2026-09-07 20:49:37 +00:00
🐛 Fix show 'add new property' from menu when a variant is selected (#7042)
This commit is contained in:
parent
e55d184d2b
commit
8d5ee92f16
@ -361,6 +361,7 @@
|
|||||||
main-instance? (ctk/main-instance? shape)
|
main-instance? (ctk/main-instance? shape)
|
||||||
|
|
||||||
component-id (:component-id shape)
|
component-id (:component-id shape)
|
||||||
|
variant-id (:variant-id shape)
|
||||||
library-id (:component-file shape)
|
library-id (:component-file shape)
|
||||||
|
|
||||||
local-component? (= library-id current-file-id)
|
local-component? (= library-id current-file-id)
|
||||||
@ -441,6 +442,9 @@
|
|||||||
(st/emit! (dwv/add-new-variant id))
|
(st/emit! (dwv/add-new-variant id))
|
||||||
(st/emit! (dwv/transform-in-variant id))))
|
(st/emit! (dwv/transform-in-variant id))))
|
||||||
|
|
||||||
|
do-add-new-property
|
||||||
|
#(st/emit! (dwv/add-new-property variant-id {:property-value "Value 1"}))
|
||||||
|
|
||||||
do-show-local-component
|
do-show-local-component
|
||||||
#(st/emit! (dwl/go-to-local-component :id component-id))
|
#(st/emit! (dwl/go-to-local-component :id component-id))
|
||||||
|
|
||||||
@ -497,5 +501,8 @@
|
|||||||
(when (and variants? (or (not multi) same-variant?) main-instance?)
|
(when (and variants? (or (not multi) same-variant?) main-instance?)
|
||||||
{:title (tr "workspace.shape.menu.add-variant")
|
{:title (tr "workspace.shape.menu.add-variant")
|
||||||
:shortcut :create-component
|
:shortcut :create-component
|
||||||
:action do-add-variant})]]
|
:action do-add-variant})
|
||||||
|
(when (and variants? same-variant? main-instance? variant-id)
|
||||||
|
{:title (tr "workspace.shape.menu.add-variant-property")
|
||||||
|
:action do-add-new-property})]]
|
||||||
(filter (complement nil?) menu-entries)))
|
(filter (complement nil?) menu-entries)))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user