From 04861769d80fb0d30eb3141fb67f9082f4e7bcac Mon Sep 17 00:00:00 2001 From: Miguel Ángel Moreno Date: Sun, 1 Dec 2024 13:17:44 +0100 Subject: feat: add original error message in error containers --- src/frontend/tubo/layout/views.cljs | 10 +++++----- src/frontend/tubo/notifications/views.cljs | 5 +++-- 2 files changed, 8 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/frontend/tubo/layout/views.cljs b/src/frontend/tubo/layout/views.cljs index 90dc3ef..d50c066 100644 --- a/src/frontend/tubo/layout/views.cljs +++ b/src/frontend/tubo/layout/views.cljs @@ -225,14 +225,14 @@ (defn error [{:keys [_failure parse-error status status-text]} cb] - [:div.flex.flex-auto.h-full.items-center.justify-center.p-5 - [:div.flex.flex-col.gap-y-6.border-border-neutral-300.rounded.dark:border-stone-700.bg-neutral-300.dark:bg-neutral-800.p-5 + [:div.flex.flex-auto.h-full.items-center.justify-center.p-8 + [:div.flex.flex-col.gap-y-8.border-border-neutral-300.rounded.dark:border-stone-700.bg-neutral-300.dark:bg-neutral-800.p-8 [:div.flex.items-center.gap-2.text-xl [:i.fa-solid.fa-circle-exclamation] [:h3.font-bold - (str status (when (and status status-text) ": ") status-text)]] + (str status " " status-text)]] (when parse-error - [:span (:status-text parse-error)]) - [:div.flex.justify-center.gap-x-3 + [:span (or (:original-text parse-error) (:status-text parse-error))]) + [:div.flex.justify-center.gap-x-6 [primary-button "Go Back" #(rf/dispatch [:navigation/history-go -1])] [secondary-button "Retry" #(rf/dispatch cb)]]]]) diff --git a/src/frontend/tubo/notifications/views.cljs b/src/frontend/tubo/notifications/views.cljs index 7d0ba98..66095a6 100644 --- a/src/frontend/tubo/notifications/views.cljs +++ b/src/frontend/tubo/notifications/views.cljs @@ -22,9 +22,10 @@ #(rf/dispatch [:notifications/remove (:id notification)])} [:i.fa-solid.fa-close]] [:span.font-bold - (str status (when (and status status-text) ": ") status-text)] + (str status " " status-text)] (when parse-error - [:span.line-clamp-1 (:status-text parse-error)])]]])) + [:span.line-clamp-1 + (or (:original-text parse-error) (:status-text parse-error))])]]])) (defn notifications-panel [] -- cgit v1.2.3