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

Merge pull request #281 from tokens-studio/token-refactor-common

Fixes missing name attribute
This commit is contained in:
Florian Schrödl 2024-09-12 13:17:26 +02:00 committed by GitHub
commit 6cba685e87
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 8 additions and 8 deletions

View file

@ -93,7 +93,8 @@
(st/emit!
(wdt/show-token-set-context-menu
{: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)
:on-click on-select
:on-double-click #(on-edit id)

View file

@ -28,11 +28,11 @@
[:span {:class (stl/css :title)} title]])
(mf/defc menu
[{:keys [token-set-id]}]
[{:keys [token-set-id token-set-name]}]
(let [{:keys [on-edit]} (sets-context/use-context)]
[:ul {:class (stl/css :context-list)}
[:& 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
[]
@ -41,7 +41,8 @@
left (+ (get-in mdata [:position :x]) 5)
width (mf/use-state 0)
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/deps mdata)
(fn []
@ -53,4 +54,5 @@
:ref dropdown-ref
:style {:top top :left left}
: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}]]]))

View file

@ -6,9 +6,6 @@
;; Themes ----------------------------------------------------------------------
(defn get-theme-group [theme]
(:group theme))
(defn get-workspace-themes [state]
(get-in state [:workspace-data :token-themes] []))