diff options
author | Miguel Ángel Moreno <mail@migalmoreno.com> | 2022-12-30 21:22:13 +0100 |
---|---|---|
committer | Miguel Ángel Moreno <mail@migalmoreno.com> | 2022-12-30 21:22:13 +0100 |
commit | 7732d3feccf351acfc478c34646a77f2b08aa3f4 (patch) | |
tree | 9109956dda8c5bcad0beaf570b637c8f1f71c3e3 /src/frontend/tau/components | |
parent | 9166ed65ff0d2cf4783d1efeab0630b4292fce68 (diff) |
feat(frontend): Use a more general loading icon component
Diffstat (limited to 'src/frontend/tau/components')
-rw-r--r-- | src/frontend/tau/components/comments.cljs | 2 | ||||
-rw-r--r-- | src/frontend/tau/components/loading.cljs | 20 |
2 files changed, 5 insertions, 17 deletions
diff --git a/src/frontend/tau/components/comments.cljs b/src/frontend/tau/components/comments.cljs index 8f9300b..044f87a 100644 --- a/src/frontend/tau/components/comments.cljs +++ b/src/frontend/tau/components/comments.cljs @@ -51,7 +51,7 @@ [comment-item (assoc comment :key i) author-name author-avatar])] (when (:url next-page) (if pagination-loading? - (loading/comments-pagination-loading-icon service-color) + (loading/loading-icon service-color) [:div.flex.items-center.justify-center {:style {:cursor "pointer"} :on-click #(rf/dispatch [::events/comments-pagination url (:url next-page)])} diff --git a/src/frontend/tau/components/loading.cljs b/src/frontend/tau/components/loading.cljs index 9b1fee8..40f6db3 100644 --- a/src/frontend/tau/components/loading.cljs +++ b/src/frontend/tau/components/loading.cljs @@ -1,20 +1,8 @@ (ns tau.components.loading) -(defn page-loading-icon - [service-color] - [:div.w-full.flex.justify-center.items-center.flex-auto - [:i.fas.fa-circle-notch.fa-spin.text-5xl - {:style {:color service-color}}]]) - -(defn items-pagination-loading-icon - [service-color loading?] - [:div.w-full.flex.items-center.justify-center.py-4 - {:class (when-not loading? "invisible")} - [:i.fas.fa-circle-notch.fa-spin.text-2xl - {:style {:color service-color}}]]) - -(defn comments-pagination-loading-icon - [service-color] +(defn loading-icon + [service-color & styles] [:div.w-full.flex.justify-center.items-center.flex-auto [:i.fas.fa-circle-notch.fa-spin - {:style {:color service-color}}]]) + {:class (apply str (if (> (count styles) 1) (interpose " " styles) styles)) + :style {:color service-color}}]]) |