♻️ Migrate dashboard assets to modern syntax (#9404)

Co-authored-by: Andrey Antukh <niwi@niwi.nz>
This commit is contained in:
sxxtony 2026-06-10 11:52:54 +03:00 committed by GitHub
parent bfad78d39c
commit ebb5738c7b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 22 additions and 29 deletions

View File

@ -273,9 +273,8 @@
:on-click on-delete}
deprecated-icon/close]]]))]]))
(mf/defc installed-font-context-menu
{::mf/props :obj
::mf/private true}
(mf/defc installed-font-context-menu*
{::mf/private true}
[{:keys [is-open on-close on-edit on-download on-delete]}]
(let [options (mf/with-memo [on-edit on-download on-delete]
[{:name (tr "labels.edit")
@ -296,10 +295,9 @@
:left -115
:options options}]))
(mf/defc installed-font
{::mf/props :obj
::mf/private true
::mf/memo true}
(mf/defc installed-font*
{::mf/private true
::mf/wrap [mf/memo]}
[{:keys [font-id variants can-edit]}]
(let [font (first variants)
@ -445,7 +443,7 @@
:on-click on-menu-open}
deprecated-icon/menu]
[:& installed-font-context-menu
[:> installed-font-context-menu*
{:on-close on-menu-close
:is-open menu-open?
:on-delete on-delete-font
@ -480,10 +478,10 @@
(for [[font-id variants] (->> (vals fonts)
(filter matches?)
(group-by :font-id))]
[:& installed-font {:key (dm/str font-id "-installed")
:font-id font-id
:can-edit can-edit
:variants variants}])]
[:> installed-font* {:key (dm/str font-id "-installed")
:font-id font-id
:can-edit can-edit
:variants variants}])]
(nil? fonts)
[:div {:class (stl/css :fonts-placeholder)}

View File

@ -50,10 +50,8 @@
:entries entries
:on-finish-import on-finish-import})))))))
(mf/defc import-form
{::mf/forward-ref true
::mf/props :obj}
(mf/defc import-form*
{::mf/forward-ref true}
[{:keys [project-id on-finish-import]} external-ref]
(let [on-file-selected (use-import-file project-id on-finish-import)]
[:form.import-file {:aria-hidden "true"}

View File

@ -59,9 +59,9 @@
[:div {:class (stl/css :empty-project-card-subtitle)}
(tr "dashboard.empty-project.explore")]]
[:& udi/import-form {:ref file-input
:project-id project-id
:on-finish-import on-finish-import}]]))
[:> udi/import-form* {:ref file-input
:project-id project-id
:on-finish-import on-finish-import}]]))
(defn- make-has-other-files-or-projects-ref
"Return a ref that resolves to true or false if there are at least some

View File

@ -137,8 +137,7 @@
:top top
:left left
:options options}]
[:& udi/import-form {:ref file-input
:project-id (:id project)
:on-finish-import on-finish-import}]]))
[:> udi/import-form* {:ref file-input
:project-id (:id project)
:on-finish-import on-finish-import}]]))

View File

@ -91,8 +91,7 @@
[:span {:class (stl/css :title-icon)}
arrow-icon]])]]))
(mf/defc card-item
{::mf/wrap-props false}
(mf/defc card-item*
[{:keys [item index is-visible collapsed on-import]}]
(let [id (dm/str "card-container-" index)
href (u/join cf/public-uri (dm/str "images/thumbnails/template-" (:id item) ".jpg"))
@ -134,8 +133,7 @@
(:name item))]
download-icon]]]))
(mf/defc card-item-link
{::mf/wrap-props false}
(mf/defc card-item-link*
[{:keys [total is-visible collapsed section]}]
(let [id (dm/str "card-container-" total)
@ -270,7 +268,7 @@
:ref content-ref}
(for [index (range (count templates))]
[:& card-item
[:> card-item*
{:on-import on-import-template
:item (nth templates index)
:index index
@ -278,7 +276,7 @@
:is-visible true
:collapsed collapsed}])
[:& card-item-link
[:> card-item-link*
{:is-visible true
:collapsed collapsed
:section section