mirror of
https://github.com/penpot/penpot.git
synced 2025-02-08 16:18:11 -05:00
✨ Show loading message in Libraries modal
This commit is contained in:
parent
8bd10c3c04
commit
d70fc33689
2 changed files with 20 additions and 11 deletions
|
@ -123,11 +123,12 @@
|
|||
|
||||
shared-libraries
|
||||
(mf/with-memo [shared-libraries linked-libraries file-id search-term]
|
||||
(->> shared-libraries
|
||||
(remove #(= (:id %) file-id))
|
||||
(remove #(contains? linked-libraries (:id %)))
|
||||
(filter #(matches-search (:name %) search-term))
|
||||
(sort-by (comp str/lower :name))))
|
||||
(when shared-libraries
|
||||
(->> shared-libraries
|
||||
(remove #(= (:id %) file-id))
|
||||
(remove #(contains? linked-libraries (:id %)))
|
||||
(filter #(matches-search (:name %) search-term))
|
||||
(sort-by (comp str/lower :name)))))
|
||||
|
||||
linked-libraries
|
||||
(mf/with-memo [linked-libraries]
|
||||
|
@ -275,12 +276,17 @@
|
|||
:on-click link-library}
|
||||
i/add-refactor]])]
|
||||
|
||||
[:div {:class (stl/css :section-list-empty)}
|
||||
(if (nil? shared-libraries)
|
||||
i/loader-pencil
|
||||
(if (str/empty? search-term)
|
||||
(when (empty? shared-libraries)
|
||||
[:div {:class (stl/css :section-list-empty)}
|
||||
(cond
|
||||
(nil? shared-libraries)
|
||||
(tr "workspace.libraries.loading")
|
||||
|
||||
(str/empty? search-term)
|
||||
(tr "workspace.libraries.no-shared-libraries-available")
|
||||
(tr "workspace.libraries.no-matches-for" search-term)))])]]))
|
||||
|
||||
:else
|
||||
(tr "workspace.libraries.no-matches-for" search-term))]))]]))
|
||||
|
||||
(defn- extract-assets
|
||||
[file-data library summary?]
|
||||
|
@ -519,4 +525,3 @@
|
|||
[:& updates-tab {:file-id file-id
|
||||
:file-data file-data
|
||||
:libraries libraries}]]]]]]]]))
|
||||
|
||||
|
|
|
@ -3593,6 +3593,10 @@ msgstr "Search shared libraries"
|
|||
msgid "workspace.libraries.shared-libraries"
|
||||
msgstr "SHARED LIBRARIES"
|
||||
|
||||
#: src/app/main/ui/workspace/libraries.cljs
|
||||
msgid "workspace.libraries.loading"
|
||||
msgstr "Loading…"
|
||||
|
||||
#: src/app/main/ui/workspace/sidebar/options/menus/text.cljs
|
||||
msgid "workspace.libraries.text.multiple-typography"
|
||||
msgstr "Multiple typographies"
|
||||
|
|
Loading…
Add table
Reference in a new issue