mirror of
https://github.com/penpot/penpot.git
synced 2026-05-09 01:58:46 +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]
|
||||
[rumext.v2 :as mf]))
|
||||
|
||||
(mf/defc link-button
|
||||
{::mf/wrap-props false}
|
||||
(mf/defc link-button*
|
||||
[{:keys [on-click class value data-testid]}]
|
||||
(let [on-key-down (mf/use-fn
|
||||
(mf/deps on-click)
|
||||
|
||||
@ -62,8 +62,8 @@
|
||||
(when (some? links)
|
||||
(for [[index link] (d/enumerate links)]
|
||||
;; TODO Review this component
|
||||
[:& lb/link-button {:class (stl/css :link)
|
||||
:on-click (:callback link)
|
||||
:value (:label link)
|
||||
:key (dm/str "link-" index)}]))])]])
|
||||
[:> lb/link-button* {:class (stl/css :link)
|
||||
:on-click (:callback link)
|
||||
:value (:label link)
|
||||
:key (dm/str "link-" index)}]))])]])
|
||||
|
||||
|
||||
@ -30,7 +30,7 @@
|
||||
(when (some? links)
|
||||
[:nav {:class (stl/css :link-nav)}
|
||||
(for [[index link] (d/enumerate links)]
|
||||
[:& lb/link-button {:key (dm/str "link-" index)
|
||||
:class (stl/css :link)
|
||||
:on-click (:callback link)
|
||||
:value (:label link)}])])])
|
||||
[:> lb/link-button* {:key (dm/str "link-" index)
|
||||
:class (stl/css :link)
|
||||
:on-click (:callback link)
|
||||
:value (:label link)}])])])
|
||||
|
||||
@ -617,7 +617,7 @@
|
||||
(when (or (pos? (:components exceeded))
|
||||
(pos? (:colors exceeded))
|
||||
(pos? (:typographies exceeded)))
|
||||
[:& lb/link-button
|
||||
[:> lb/link-button*
|
||||
{:on-click see-all-assets
|
||||
:class (stl/css :libraries-updates-see-all)
|
||||
:value (str "(" (tr "workspace.libraries.update.see-all-changes") ")")}])])]])]]))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user