aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMiguel Ángel Moreno <mail@migalmoreno.com>2024-12-02 20:46:55 +0100
committerMiguel Ángel Moreno <mail@migalmoreno.com>2024-12-02 20:46:55 +0100
commit91fdb3aa32c795e5851e3a32b1694f62ad968e7f (patch)
treea464cc4be087cfd78a61d5c2a1d7904c150b492d /src
parentf86353131541b8c47178fdcecc685a4284adeb2a (diff)
feat: only show like/dislike container when these exist
Diffstat (limited to 'src')
-rw-r--r--src/frontend/tubo/stream/views.cljs19
1 files 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]]])