mirror of
https://github.com/penpot/penpot.git
synced 2025-08-07 14:38:33 +02:00
Only show atrribute actions when shapes are selected
This commit is contained in:
parent
bf994fcd56
commit
7b2d11019c
1 changed files with 3 additions and 2 deletions
|
@ -277,7 +277,8 @@
|
||||||
|
|
||||||
(defn generate-menu-entries [{:keys [token-id token-type-props _token-type _selected-shapes] :as context-data}]
|
(defn generate-menu-entries [{:keys [token-id token-type-props _token-type _selected-shapes] :as context-data}]
|
||||||
(let [{:keys [modal]} token-type-props
|
(let [{:keys [modal]} token-type-props
|
||||||
attribute-actions (shape-attribute-actions context-data)
|
attribute-actions (when (seq selected-shapes)
|
||||||
|
(shape-attribute-actions context-data))
|
||||||
default-actions [{:title "Delete Token" :action #(st/emit! (dt/delete-token token-id))}
|
default-actions [{:title "Delete Token" :action #(st/emit! (dt/delete-token token-id))}
|
||||||
{:title "Duplicate Token" :action #(st/emit! (dt/duplicate-token token-id))}
|
{:title "Duplicate Token" :action #(st/emit! (dt/duplicate-token token-id))}
|
||||||
{:title "Edit Token" :action (fn [event]
|
{:title "Edit Token" :action (fn [event]
|
||||||
|
@ -292,7 +293,7 @@
|
||||||
:token token})))}]]
|
:token token})))}]]
|
||||||
(concat
|
(concat
|
||||||
attribute-actions
|
attribute-actions
|
||||||
[:separator]
|
(when attribute-actions [:separator])
|
||||||
default-actions)))
|
default-actions)))
|
||||||
|
|
||||||
(mf/defc token-pill-context-menu
|
(mf/defc token-pill-context-menu
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue