mirror of
https://github.com/penpot/penpot.git
synced 2025-01-21 14:12:36 -05:00
Fix context menu missing name param
This commit is contained in:
parent
309476fdfd
commit
a1e4d6b3b3
2 changed files with 8 additions and 5 deletions
|
@ -93,7 +93,8 @@
|
||||||
(st/emit!
|
(st/emit!
|
||||||
(wdt/show-token-set-context-menu
|
(wdt/show-token-set-context-menu
|
||||||
{:position (dom/get-client-position event)
|
{:position (dom/get-client-position event)
|
||||||
:token-set-id id})))))]
|
:token-set-id id
|
||||||
|
:token-set-name name})))))]
|
||||||
[:div {:class (stl/css :set-item-container)
|
[:div {:class (stl/css :set-item-container)
|
||||||
:on-click on-select
|
:on-click on-select
|
||||||
:on-double-click #(on-edit id)
|
:on-double-click #(on-edit id)
|
||||||
|
|
|
@ -28,11 +28,11 @@
|
||||||
[:span {:class (stl/css :title)} title]])
|
[:span {:class (stl/css :title)} title]])
|
||||||
|
|
||||||
(mf/defc menu
|
(mf/defc menu
|
||||||
[{:keys [token-set-id]}]
|
[{:keys [token-set-id token-set-name]}]
|
||||||
(let [{:keys [on-edit]} (sets-context/use-context)]
|
(let [{:keys [on-edit]} (sets-context/use-context)]
|
||||||
[:ul {:class (stl/css :context-list)}
|
[:ul {:class (stl/css :context-list)}
|
||||||
[:& menu-entry {:title "Rename" :on-click #(on-edit token-set-id)}]
|
[:& menu-entry {:title "Rename" :on-click #(on-edit token-set-id)}]
|
||||||
[:& menu-entry {:title "Delete" :on-click #(st/emit! (wdt/delete-token-set token-set-id))}]]))
|
[:& menu-entry {:title "Delete" :on-click #(st/emit! (wdt/delete-token-set token-set-id token-set-name))}]]))
|
||||||
|
|
||||||
(mf/defc sets-context-menu
|
(mf/defc sets-context-menu
|
||||||
[]
|
[]
|
||||||
|
@ -41,7 +41,8 @@
|
||||||
left (+ (get-in mdata [:position :x]) 5)
|
left (+ (get-in mdata [:position :x]) 5)
|
||||||
width (mf/use-state 0)
|
width (mf/use-state 0)
|
||||||
dropdown-ref (mf/use-ref)
|
dropdown-ref (mf/use-ref)
|
||||||
token-set-id (:token-set-id mdata)]
|
token-set-id (:token-set-id mdata)
|
||||||
|
token-set-name (:token-set-name mdata)]
|
||||||
(mf/use-effect
|
(mf/use-effect
|
||||||
(mf/deps mdata)
|
(mf/deps mdata)
|
||||||
(fn []
|
(fn []
|
||||||
|
@ -53,4 +54,5 @@
|
||||||
:ref dropdown-ref
|
:ref dropdown-ref
|
||||||
:style {:top top :left left}
|
:style {:top top :left left}
|
||||||
:on-context-menu prevent-default}
|
:on-context-menu prevent-default}
|
||||||
[:& menu {:token-set-id token-set-id}]]]))
|
[:& menu {:token-set-id token-set-id
|
||||||
|
:token-set-name token-set-name}]]]))
|
||||||
|
|
Loading…
Add table
Reference in a new issue