From ea15735372698b71158ca7e255f20ed37cd9a082 Mon Sep 17 00:00:00 2001 From: Eva Date: Tue, 11 Oct 2022 10:05:42 +0200 Subject: [PATCH] :bug: Fix loading placeholder --- .../resources/styles/main/partials/dashboard-grid.scss | 8 ++++++++ frontend/src/app/main/ui/dashboard/libraries.cljs | 7 ++++--- frontend/src/app/main/ui/dashboard/placeholder.cljs | 2 +- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/frontend/resources/styles/main/partials/dashboard-grid.scss b/frontend/resources/styles/main/partials/dashboard-grid.scss index 0b3e34417..64341c9bb 100644 --- a/frontend/resources/styles/main/partials/dashboard-grid.scss +++ b/frontend/resources/styles/main/partials/dashboard-grid.scss @@ -420,6 +420,14 @@ background-color: rgba(227, 227, 227, 0.3); padding: 13px; margin-right: 13px; + &.loader { + justify-items: center; + } + .icon { + display: flex; + align-items: center; + justify-content: center; + } &.libs { background-image: url(/images/ph-left.svg), url(/images/ph-right.svg); background-position: 15% bottom, 85% top; diff --git a/frontend/src/app/main/ui/dashboard/libraries.cljs b/frontend/src/app/main/ui/dashboard/libraries.cljs index a2590d53e..73f33447e 100644 --- a/frontend/src/app/main/ui/dashboard/libraries.cljs +++ b/frontend/src/app/main/ui/dashboard/libraries.cljs @@ -24,10 +24,11 @@ (let [files-map (mf/deref refs/dashboard-shared-files) projects (mf/deref refs/dashboard-projects) default-project (->> projects vals (d/seek :is-default)) - files (->> (vals files-map) + files (if (nil? files-map) + nil + (->> (vals files-map) (sort-by :modified-at) - (reverse) - (not-empty)) + (reverse))) components-v2 (features/use-feature :components-v2) diff --git a/frontend/src/app/main/ui/dashboard/placeholder.cljs b/frontend/src/app/main/ui/dashboard/placeholder.cljs index 6ea8f2a09..1f093d7d7 100644 --- a/frontend/src/app/main/ui/dashboard/placeholder.cljs +++ b/frontend/src/app/main/ui/dashboard/placeholder.cljs @@ -35,7 +35,7 @@ (mf/defc loading-placeholder [] - [:div.grid-empty-placeholder + [:div.grid-empty-placeholder.loader [:div.icon i/loader] [:div.text (tr "dashboard.loading-files")]])