mirror of
https://github.com/penpot/penpot.git
synced 2025-05-08 00:15:54 +02:00
⚡ Don't sort tokens on each rerender
This commit is contained in:
parent
1f450c83ec
commit
c1ce24e5f0
1 changed files with 5 additions and 1 deletions
|
@ -79,6 +79,10 @@
|
||||||
(l/derived lens:token-type-open-status)))
|
(l/derived lens:token-type-open-status)))
|
||||||
{:keys [modal attributes all-attributes title]} token-type-props
|
{:keys [modal attributes all-attributes title]} token-type-props
|
||||||
|
|
||||||
|
tokens
|
||||||
|
(mf/with-memo [tokens]
|
||||||
|
(vec (sort-by :name tokens)))
|
||||||
|
|
||||||
on-context-menu
|
on-context-menu
|
||||||
(mf/use-fn
|
(mf/use-fn
|
||||||
(fn [event token]
|
(fn [event token]
|
||||||
|
@ -138,7 +142,7 @@
|
||||||
(when open?
|
(when open?
|
||||||
[:& cmm/asset-section-block {:role :content}
|
[:& cmm/asset-section-block {:role :content}
|
||||||
[:div {:class (stl/css :token-pills-wrapper)}
|
[:div {:class (stl/css :token-pills-wrapper)}
|
||||||
(for [token (sort-by :name tokens)]
|
(for [token tokens]
|
||||||
(let [theme-token (get active-theme-tokens (:name token))
|
(let [theme-token (get active-theme-tokens (:name token))
|
||||||
multiple-selection (< 1 (count selected-shapes))
|
multiple-selection (< 1 (count selected-shapes))
|
||||||
full-applied (:all-selected? (attribute-actions token selected-shapes (or all-attributes attributes)))
|
full-applied (:all-selected? (attribute-actions token selected-shapes (or all-attributes attributes)))
|
||||||
|
|
Loading…
Add table
Reference in a new issue