mirror of
https://github.com/penpot/penpot.git
synced 2025-06-07 21:41:40 +02:00
📎 Replace use-callback with use-fn on token themes modal
This commit is contained in:
parent
c1c22dc6c6
commit
9d2117e2ac
1 changed files with 6 additions and 6 deletions
|
@ -128,7 +128,7 @@
|
||||||
:class (stl/css :theme-row)}
|
:class (stl/css :theme-row)}
|
||||||
[:div {:class (stl/css :theme-row-left)}
|
[:div {:class (stl/css :theme-row-left)}
|
||||||
|
|
||||||
;; FIREEEEEEEEEE THIS
|
;; FIXME: FIREEEEEEEEEE THIS
|
||||||
[:div {:on-click (fn [e]
|
[:div {:on-click (fn [e]
|
||||||
(dom/prevent-default e)
|
(dom/prevent-default e)
|
||||||
(dom/stop-propagation e)
|
(dom/stop-propagation e)
|
||||||
|
@ -261,7 +261,7 @@
|
||||||
(swap! theme-state* #(assoc % field value))))
|
(swap! theme-state* #(assoc % field value))))
|
||||||
|
|
||||||
on-save-form
|
on-save-form
|
||||||
(mf/use-callback
|
(mf/use-fn
|
||||||
(mf/deps theme-state)
|
(mf/deps theme-state)
|
||||||
(fn [e]
|
(fn [e]
|
||||||
(dom/prevent-default e)
|
(dom/prevent-default e)
|
||||||
|
@ -378,7 +378,7 @@
|
||||||
(clt/toggle-token-set-group group-path lib' theme'))))))
|
(clt/toggle-token-set-group group-path lib' theme'))))))
|
||||||
|
|
||||||
on-click-token-set
|
on-click-token-set
|
||||||
(mf/use-callback
|
(mf/use-fn
|
||||||
(mf/deps on-toggle-token-set)
|
(mf/deps on-toggle-token-set)
|
||||||
(fn [prefixed-set-path-str]
|
(fn [prefixed-set-path-str]
|
||||||
(let [set-name (ctob/prefixed-set-path-string->set-name-string prefixed-set-path-str)]
|
(let [set-name (ctob/prefixed-set-path-string->set-name-string prefixed-set-path-str)]
|
||||||
|
@ -429,7 +429,7 @@
|
||||||
state (mf/use-state (if (empty? themes)
|
state (mf/use-state (if (empty? themes)
|
||||||
{:type :create-theme}
|
{:type :create-theme}
|
||||||
{:type :themes-overview}))
|
{:type :themes-overview}))
|
||||||
set-state (mf/use-callback #(swap! state %))
|
set-state (mf/use-fn #(swap! state %))
|
||||||
component (case (:type @state)
|
component (case (:type @state)
|
||||||
:empty-themes empty-themes
|
:empty-themes empty-themes
|
||||||
:themes-overview (if (empty? themes) empty-themes themes-overview)
|
:themes-overview (if (empty? themes) empty-themes themes-overview)
|
||||||
|
@ -442,8 +442,8 @@
|
||||||
{::mf/wrap-props false
|
{::mf/wrap-props false
|
||||||
::mf/register modal/components
|
::mf/register modal/components
|
||||||
::mf/register-as :tokens/themes}
|
::mf/register-as :tokens/themes}
|
||||||
[_args]
|
[]
|
||||||
(let [handle-close-dialog (mf/use-callback #(st/emit! (modal/hide)))]
|
(let [handle-close-dialog (mf/use-fn #(st/emit! (modal/hide)))]
|
||||||
[:div {:class (stl/css :modal-overlay)}
|
[:div {:class (stl/css :modal-overlay)}
|
||||||
[:div {:class (stl/css :modal-dialog)
|
[:div {:class (stl/css :modal-dialog)
|
||||||
:data-testid "token-theme-update-create-modal"}
|
:data-testid "token-theme-update-create-modal"}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue