0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-21 06:02:32 -05:00

Only show atrribute actions when shapes are selected

This commit is contained in:
Florian Schroedl 2024-07-08 15:10:01 +02:00
parent bf994fcd56
commit 7b2d11019c

View file

@ -277,7 +277,8 @@
(defn generate-menu-entries [{:keys [token-id token-type-props _token-type _selected-shapes] :as context-data}]
(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))}
{:title "Duplicate Token" :action #(st/emit! (dt/duplicate-token token-id))}
{:title "Edit Token" :action (fn [event]
@ -292,7 +293,7 @@
:token token})))}]]
(concat
attribute-actions
[:separator]
(when attribute-actions [:separator])
default-actions)))
(mf/defc token-pill-context-menu