mirror of
https://github.com/penpot/penpot.git
synced 2026-05-10 18:48:23 +00:00
♻️ Migrate components/link to modern component syntax (#9383)
* ♻️ Migrate components/link to modern component syntax Signed-off-by: tmimmanuel <155203395+tmimmanuel@users.noreply.github.com> * 📎 Fix cljfmt indent after link* rename Signed-off-by: tmimmanuel <155203395+tmimmanuel@users.noreply.github.com> --------- Signed-off-by: tmimmanuel <155203395+tmimmanuel@users.noreply.github.com> Co-authored-by: tmimmanuel <155203395+tmimmanuel@users.noreply.github.com> Co-authored-by: Andrey Antukh <niwi@niwi.nz>
This commit is contained in:
parent
60c718eba1
commit
ef4f57c4a1
@ -65,8 +65,8 @@
|
||||
(when (seq link-message)
|
||||
[:h3 {:class (stl/css :modal-msg)}
|
||||
[:span (:before link-message)]
|
||||
[:& lk/link {:action (:on-click link-message)
|
||||
:class (stl/css :link)}
|
||||
[:> lk/link* {:action (:on-click link-message)
|
||||
:class (stl/css :link)}
|
||||
(:text link-message)]
|
||||
[:span (:after link-message)]])
|
||||
(when (and (string? scd-message) (not= scd-message ""))
|
||||
|
||||
@ -191,9 +191,9 @@
|
||||
(or (contains? cf/flags :login)
|
||||
(contains? cf/flags :login-with-password)))
|
||||
[:div {:class (stl/css :fields-row :forgot-password)}
|
||||
[:& lk/link {:action on-recovery-request
|
||||
:class (stl/css :forgot-pass-link)
|
||||
:data-testid "forgot-password"}
|
||||
[:> lk/link* {:action on-recovery-request
|
||||
:class (stl/css :forgot-pass-link)
|
||||
:data-testid "forgot-password"}
|
||||
(tr "auth.forgot-password")]])
|
||||
|
||||
[:div {:class (stl/css :buttons-stack)}
|
||||
@ -284,7 +284,7 @@
|
||||
[:div {:class (stl/css :register)}
|
||||
[:span {:class (stl/css :register-text)}
|
||||
(tr "auth.register") " "]
|
||||
[:& lk/link {:action go-register
|
||||
:class (stl/css :register-link)
|
||||
:data-testid "register-submit"}
|
||||
[:> lk/link* {:action go-register
|
||||
:class (stl/css :register-link)
|
||||
:data-testid "register-submit"}
|
||||
(tr "auth.register-submit")]])]]))
|
||||
|
||||
@ -98,9 +98,9 @@
|
||||
[:& recovery-form {:params params :on-success-callback on-success-callback}]
|
||||
[:hr {:class (stl/css :separator)}]
|
||||
[:div {:class (stl/css :go-back)}
|
||||
[:& lk/link {:action go-back
|
||||
:class (stl/css :go-back-link)
|
||||
:data-testid "go-back-link"}
|
||||
[:> lk/link* {:action go-back
|
||||
:class (stl/css :go-back-link)
|
||||
:data-testid "go-back-link"}
|
||||
(tr "labels.go-back")]]]))
|
||||
|
||||
|
||||
|
||||
@ -212,17 +212,17 @@
|
||||
[:div {:class (stl/css :links)}
|
||||
[:div {:class (stl/css :account)}
|
||||
[:span {:class (stl/css :account-text)} (tr "auth.already-have-account") " "]
|
||||
[:& lk/link {:action #(st/emit! (rt/nav :auth-login params))
|
||||
:class (stl/css :account-link)
|
||||
:data-testid "login-here-link"}
|
||||
[:> lk/link* {:action #(st/emit! (rt/nav :auth-login params))
|
||||
:class (stl/css :account-link)
|
||||
:data-testid "login-here-link"}
|
||||
(tr "auth.login-here")]]
|
||||
|
||||
(when (contains? cf/flags :demo-users)
|
||||
[:*
|
||||
[:hr {:class (stl/css :separator)}]
|
||||
[:div {:class (stl/css :demo-account)}
|
||||
[:& lk/link {:action login/create-demo-profile
|
||||
:class (stl/css :demo-account-link)}
|
||||
[:> lk/link* {:action login/create-demo-profile
|
||||
:class (stl/css :demo-account-link)}
|
||||
(tr "auth.create-demo-account")]]])]])
|
||||
|
||||
|
||||
@ -355,6 +355,6 @@
|
||||
|
||||
[:div {:class (stl/css :links)}
|
||||
[:div {:class (stl/css :go-back)}
|
||||
[:& lk/link {:action #(st/emit! (rt/nav :auth-register {}))
|
||||
:class (stl/css :go-back-link)}
|
||||
[:> lk/link* {:action #(st/emit! (rt/nav :auth-register {}))
|
||||
:class (stl/css :go-back-link)}
|
||||
(tr "labels.go-back")]]]])
|
||||
|
||||
@ -10,8 +10,7 @@
|
||||
[app.util.keyboard :as kbd]
|
||||
[rumext.v2 :as mf]))
|
||||
|
||||
(mf/defc link
|
||||
{::mf/wrap-props false}
|
||||
(mf/defc link*
|
||||
[{:keys [action class data-testid keyboard-action children]}]
|
||||
(let [keyboard-action (d/nilv keyboard-action action)]
|
||||
[:a {:on-click action
|
||||
|
||||
@ -24,7 +24,7 @@
|
||||
[app.main.store :as st]
|
||||
[app.main.ui.components.dropdown-menu :refer [dropdown-menu*
|
||||
dropdown-menu-item*]]
|
||||
[app.main.ui.components.link :refer [link]]
|
||||
[app.main.ui.components.link :refer [link*]]
|
||||
[app.main.ui.components.org-avatar :refer [org-avatar*]]
|
||||
[app.main.ui.dashboard.comments :refer [comments-icon* comments-section]]
|
||||
[app.main.ui.dashboard.inline-edition :refer [inline-edition]]
|
||||
@ -1077,16 +1077,16 @@
|
||||
[:li {:class (stl/css-case :recent-projects true
|
||||
:sidebar-nav-item true
|
||||
:current projects?)}
|
||||
[:& link {:action go-projects
|
||||
:class (stl/css :sidebar-link)
|
||||
:keyboard-action go-projects-with-key}
|
||||
[:> link* {:action go-projects
|
||||
:class (stl/css :sidebar-link)
|
||||
:keyboard-action go-projects-with-key}
|
||||
[:span {:class (stl/css :element-title)} (tr "labels.projects")]]]
|
||||
|
||||
[:li {:class (stl/css-case :current drafts?
|
||||
:sidebar-nav-item true)}
|
||||
[:& link {:action go-drafts
|
||||
:class (stl/css :sidebar-link)
|
||||
:keyboard-action go-drafts-with-key}
|
||||
[:> link* {:action go-drafts
|
||||
:class (stl/css :sidebar-link)
|
||||
:keyboard-action go-drafts-with-key}
|
||||
[:span {:class (stl/css :element-title)} (tr "labels.drafts")]]]]]
|
||||
|
||||
|
||||
@ -1096,17 +1096,17 @@
|
||||
[:ul {:class (stl/css :sidebar-nav)}
|
||||
[:li {:class (stl/css-case :sidebar-nav-item true
|
||||
:current fonts?)}
|
||||
[:& link {:action go-fonts
|
||||
:class (stl/css :sidebar-link)
|
||||
:keyboard-action go-fonts-with-key
|
||||
:data-testid "fonts"}
|
||||
[:> link* {:action go-fonts
|
||||
:class (stl/css :sidebar-link)
|
||||
:keyboard-action go-fonts-with-key
|
||||
:data-testid "fonts"}
|
||||
[:span {:class (stl/css :element-title)} (tr "labels.fonts")]]]
|
||||
[:li {:class (stl/css-case :current libs?
|
||||
:sidebar-nav-item true)}
|
||||
[:& link {:action go-libs
|
||||
:data-testid "libs-link-sidebar"
|
||||
:class (stl/css :sidebar-link)
|
||||
:keyboard-action go-libs-with-key}
|
||||
[:> link* {:action go-libs
|
||||
:data-testid "libs-link-sidebar"
|
||||
:class (stl/css :sidebar-link)
|
||||
:keyboard-action go-libs-with-key}
|
||||
[:span {:class (stl/css :element-title)} (tr "labels.shared-libraries")]]]]]
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user