diff options
author | Miguel Ángel Moreno <mail@migalmoreno.com> | 2023-07-25 22:01:12 +0200 |
---|---|---|
committer | Miguel Ángel Moreno <mail@migalmoreno.com> | 2023-07-25 22:01:12 +0200 |
commit | 34fab32d544dc98439fc853ed787970c3cee172f (patch) | |
tree | cf00b7ca04a61d3103a48ddf80ef0d62bfd41a6d /src/frontend | |
parent | 141da4b61792ff71d6ec12f85a94a4bd6368524f (diff) |
fix: Conditionally display comments container
Diffstat (limited to 'src/frontend')
-rw-r--r-- | src/frontend/tubo/views/stream.cljs | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/src/frontend/tubo/views/stream.cljs b/src/frontend/tubo/views/stream.cljs index a380b5e..e3a7e7d 100644 --- a/src/frontend/tubo/views/stream.cljs +++ b/src/frontend/tubo/views/stream.cljs @@ -98,24 +98,25 @@ [:div.min-w-full.py-3 [:h1 name] [:div {:dangerouslySetInnerHTML {:__html description}}]] - [:div.py-6 - [:div.flex.items-center - [:i.fa-solid.fa-comments] - [:p.px-2.py-4 "Comments"] - (if show-comments - [:i.fa-solid.fa-chevron-up {:on-click #(rf/dispatch [::events/toggle-comments]) - :style {:cursor "pointer"}}] - [:i.fa-solid.fa-chevron-down {:on-click #(if (or show-comments comments-page) - (rf/dispatch [::events/toggle-comments]) - (rf/dispatch [::events/get-comments url])) - :style {:cursor "pointer"}}])] - [:div - (if show-comments-loading - [loading/loading-icon service-color "text-2xl"] - (when (and show-comments comments-page) - [comments/comments comments-page uploader-name uploader-avatar url]))]] + (when-not (empty? (:comments comments-page)) + [:div.py-6 + [:div.flex.items-center + [:i.fa-solid.fa-comments] + [:p.px-2.py-4 "Comments"] + (if show-comments + [:i.fa-solid.fa-chevron-up {:on-click #(rf/dispatch [::events/toggle-comments]) + :style {:cursor "pointer"}}] + [:i.fa-solid.fa-chevron-down {:on-click #(if (or show-comments comments-page) + (rf/dispatch [::events/toggle-comments]) + (rf/dispatch [::events/get-comments url])) + :style {:cursor "pointer"}}])] + [:div + (if show-comments-loading + [loading/loading-icon service-color "text-2xl"] + (when (and show-comments comments-page) + [comments/comments comments-page uploader-name uploader-avatar url]))]]) (when-not (empty? related-streams) - [:div.py-3 + [:div.py-6 [:div.flex.items-center [:i.fa-solid.fa-list] [:h1.px-2.text-lg.bold "Related Results"]] |