mirror of
https://github.com/penpot/penpot.git
synced 2026-06-10 17:32:38 +00:00
♻️ Migrate dashboard assets to modern syntax (#9404)
Co-authored-by: Andrey Antukh <niwi@niwi.nz>
This commit is contained in:
parent
bfad78d39c
commit
ebb5738c7b
@ -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)}
|
||||
|
||||
@ -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"}
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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}]]))
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user