From 91fdb3aa32c795e5851e3a32b1694f62ad968e7f Mon Sep 17 00:00:00 2001 From: Miguel Ángel Moreno Date: Mon, 2 Dec 2024 20:46:55 +0100 Subject: feat: only show like/dislike container when these exist --- src/frontend/tubo/stream/views.cljs | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/frontend/tubo/stream/views.cljs b/src/frontend/tubo/stream/views.cljs index 8b9c991..a9bf6ca 100644 --- a/src/frontend/tubo/stream/views.cljs +++ b/src/frontend/tubo/stream/views.cljs @@ -59,15 +59,16 @@ (defn metadata-stats [{:keys [like-count dislike-count] :as stream}] [:div.flex.items-center.justify-end.gap-x-2 - [:div.flex.bg-neutral-200.dark:bg-neutral-800.px-4.py-2.rounded-full.sm:text-base.text-sm.font-semibold.gap-x-4 - (when like-count - [:div.flex.items-center.gap-x-2 - [:i.fa-solid.fa-thumbs-up] - [:span (utils/format-quantity like-count)]]) - (when dislike-count - [:div.flex.items-center.gap-x-2 - [:i.fa-solid.fa-thumbs-down] - [:span dislike-count]])] + (when (or like-count dislike-count) + [:div.flex.bg-neutral-200.dark:bg-neutral-800.px-4.py-2.rounded-full.sm:text-base.text-sm.font-semibold.gap-x-4 + (when like-count + [:div.flex.items-center.gap-x-2 + [:i.fa-solid.fa-thumbs-up] + [:span (utils/format-quantity like-count)]]) + (when dislike-count + [:div.flex.items-center.gap-x-2 + [:i.fa-solid.fa-thumbs-down] + [:span dislike-count]])]) [:div.hidden.lg:flex.bg-neutral-200.dark:bg-neutral-800.px-4.py-2.rounded-full [metadata-popover stream]]]) -- cgit v1.2.3