From d954370ea1ba01904f521cb0c8b8b0ea3812b4ab Mon Sep 17 00:00:00 2001 From: Miguel Ángel Moreno Date: Mon, 9 Dec 2024 00:14:27 +0100 Subject: feat: add loading notification type and refine styles --- src/frontend/tubo/notifications/views.cljs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/frontend') diff --git a/src/frontend/tubo/notifications/views.cljs b/src/frontend/tubo/notifications/views.cljs index e4f8a53..d3202a4 100644 --- a/src/frontend/tubo/notifications/views.cljs +++ b/src/frontend/tubo/notifications/views.cljs @@ -1,11 +1,12 @@ (ns tubo.notifications.views (:require - [re-frame.core :as rf])) + [re-frame.core :as rf] + [tubo.layout.views :as layout])) (defn notification-content [{:keys [failure parse-error status status-text] :as notification}] (when notification - [:div.relative.flex.justify-center.pl-4.pr-8.py-4.rounded.shadow.dark:shadow-neutral-900.shadow-neutral-400 + [:div.relative.flex.justify-center.pl-4.pr-8.py-5.rounded.shadow.dark:shadow-neutral-900.shadow-neutral-400 {:class (case failure :success ["bg-green-600/90" :text-white] :error ["bg-red-600/90" :text-white] @@ -15,13 +16,14 @@ (case failure :success [:i.fa-solid.fa-circle-check] :error [:i.fa-solid.fa-circle-exclamation] + :loading [:div.grow-0 [layout/loading-icon]] [:i.fa-solid.fa-circle-info]) [:div.flex.flex-col - [:button.text-lg.absolute.top-1.right-2 + [:button.absolute.top-1.right-2 {:on-click #(rf/dispatch [:notifications/remove (:id notification)])} [:i.fa-solid.fa-close]] - [:span.font-bold + [:span.font-bold.break-all (str status " " status-text)] (when parse-error [:span.line-clamp-1 -- cgit v1.2.3