mirror of
https://github.com/penpot/penpot.git
synced 2025-01-23 06:58:58 -05:00
Fix renaming via context menu
This commit is contained in:
parent
7418d1fa2c
commit
fa3e2c90e6
1 changed files with 3 additions and 5 deletions
|
@ -28,10 +28,10 @@
|
||||||
[:span {:class (stl/css :title)} title]])
|
[:span {:class (stl/css :title)} title]])
|
||||||
|
|
||||||
(mf/defc menu
|
(mf/defc menu
|
||||||
[{:keys [token-set-id token-set-name]}]
|
[{:keys [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-name)}]
|
||||||
[:& menu-entry {:title "Delete" :on-click #(st/emit! (wdt/delete-token-set token-set-name))}]]))
|
[:& menu-entry {:title "Delete" :on-click #(st/emit! (wdt/delete-token-set token-set-name))}]]))
|
||||||
|
|
||||||
(mf/defc sets-context-menu
|
(mf/defc sets-context-menu
|
||||||
|
@ -41,7 +41,6 @@
|
||||||
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-name (:token-set-name mdata)]
|
token-set-name (:token-set-name mdata)]
|
||||||
(mf/use-effect
|
(mf/use-effect
|
||||||
(mf/deps mdata)
|
(mf/deps mdata)
|
||||||
|
@ -54,5 +53,4 @@
|
||||||
: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-name token-set-name}]]]))
|
||||||
:token-set-name token-set-name}]]]))
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue