mirror of
https://github.com/penpot/penpot.git
synced 2026-09-08 21:19:49 +00:00
♻️ Migrate link-button component to rumext modern syntax (#9264)
Rename component from link-button to link-button* and remove the legacy ::mf/wrap-props false metadata. Update all callsites to use the modern [:> lb/link-button* ...] syntax instead of [:& lb/link-button ...]. Part of the #9260 issue. Signed-off-by: Andrey Antukh <niwi@niwi.nz>
This commit is contained in:
parent
61cd757355
commit
18e289b15a
@ -9,8 +9,7 @@
|
|||||||
[app.util.keyboard :as kbd]
|
[app.util.keyboard :as kbd]
|
||||||
[rumext.v2 :as mf]))
|
[rumext.v2 :as mf]))
|
||||||
|
|
||||||
(mf/defc link-button
|
(mf/defc link-button*
|
||||||
{::mf/wrap-props false}
|
|
||||||
[{:keys [on-click class value data-testid]}]
|
[{:keys [on-click class value data-testid]}]
|
||||||
(let [on-key-down (mf/use-fn
|
(let [on-key-down (mf/use-fn
|
||||||
(mf/deps on-click)
|
(mf/deps on-click)
|
||||||
|
|||||||
@ -62,8 +62,8 @@
|
|||||||
(when (some? links)
|
(when (some? links)
|
||||||
(for [[index link] (d/enumerate links)]
|
(for [[index link] (d/enumerate links)]
|
||||||
;; TODO Review this component
|
;; TODO Review this component
|
||||||
[:& lb/link-button {:class (stl/css :link)
|
[:> lb/link-button* {:class (stl/css :link)
|
||||||
:on-click (:callback link)
|
:on-click (:callback link)
|
||||||
:value (:label link)
|
:value (:label link)
|
||||||
:key (dm/str "link-" index)}]))])]])
|
:key (dm/str "link-" index)}]))])]])
|
||||||
|
|
||||||
|
|||||||
@ -30,7 +30,7 @@
|
|||||||
(when (some? links)
|
(when (some? links)
|
||||||
[:nav {:class (stl/css :link-nav)}
|
[:nav {:class (stl/css :link-nav)}
|
||||||
(for [[index link] (d/enumerate links)]
|
(for [[index link] (d/enumerate links)]
|
||||||
[:& lb/link-button {:key (dm/str "link-" index)
|
[:> lb/link-button* {:key (dm/str "link-" index)
|
||||||
:class (stl/css :link)
|
:class (stl/css :link)
|
||||||
:on-click (:callback link)
|
:on-click (:callback link)
|
||||||
:value (:label link)}])])])
|
:value (:label link)}])])])
|
||||||
|
|||||||
@ -617,7 +617,7 @@
|
|||||||
(when (or (pos? (:components exceeded))
|
(when (or (pos? (:components exceeded))
|
||||||
(pos? (:colors exceeded))
|
(pos? (:colors exceeded))
|
||||||
(pos? (:typographies exceeded)))
|
(pos? (:typographies exceeded)))
|
||||||
[:& lb/link-button
|
[:> lb/link-button*
|
||||||
{:on-click see-all-assets
|
{:on-click see-all-assets
|
||||||
:class (stl/css :libraries-updates-see-all)
|
:class (stl/css :libraries-updates-see-all)
|
||||||
:value (str "(" (tr "workspace.libraries.update.see-all-changes") ")")}])])]])]]))
|
:value (str "(" (tr "workspace.libraries.update.see-all-changes") ")")}])])]])]]))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user