Use new component definition convention for token-component

This commit is contained in:
Andrey Antukh 2025-02-04 18:15:23 +01:00
parent 769000da2d
commit 1f450c83ec

View file

@ -72,7 +72,8 @@
:shape-ids shape-ids :shape-ids shape-ids
:selected-pred #(seq (% ids-by-attributes))})) :selected-pred #(seq (% ids-by-attributes))}))
(mf/defc token-component (mf/defc token-component*
{::mf/private true}
[{:keys [type tokens selected-shapes token-type-props active-theme-tokens]}] [{:keys [type tokens selected-shapes token-type-props active-theme-tokens]}]
(let [open? (mf/deref (-> (l/key type) (let [open? (mf/deref (-> (l/key type)
(l/derived lens:token-type-open-status))) (l/derived lens:token-type-open-status)))
@ -289,12 +290,12 @@
(for [{:keys [token-key token-type-props tokens]} (concat (:filled token-groups) (for [{:keys [token-key token-type-props tokens]} (concat (:filled token-groups)
(:empty token-groups))] (:empty token-groups))]
[:& token-component {:key token-key [:> token-component* {:key token-key
:type token-key :type token-key
:selected-shapes selected-shapes :selected-shapes selected-shapes
:active-theme-tokens active-theme-tokens :active-theme-tokens active-theme-tokens
:tokens tokens :tokens tokens
:token-type-props token-type-props}])])) :token-type-props token-type-props}])]))
(mf/defc import-export-button (mf/defc import-export-button
{::mf/wrap-props false} {::mf/wrap-props false}