aboutsummaryrefslogtreecommitdiff
path: root/src/frontend/tau/views/search.cljs
diff options
context:
space:
mode:
authorMiguel Ángel Moreno <mail@migalmoreno.com>2022-12-29 23:03:32 +0100
committerMiguel Ángel Moreno <mail@migalmoreno.com>2022-12-29 23:03:32 +0100
commitfce327a72558b41ce6a7303b38c804bfada694a1 (patch)
tree29b641622a2de287c09efd0f43655ae8926162c3 /src/frontend/tau/views/search.cljs
parent8c46de38348c421c0c9f102d604fcfc18807c0bb (diff)
feat(frontend): Modularize related streams and add responsive styles
Diffstat (limited to 'src/frontend/tau/views/search.cljs')
-rw-r--r--src/frontend/tau/views/search.cljs15
1 files changed, 3 insertions, 12 deletions
diff --git a/src/frontend/tau/views/search.cljs b/src/frontend/tau/views/search.cljs
index b6bc75d..8cb4192 100644
--- a/src/frontend/tau/views/search.cljs
+++ b/src/frontend/tau/views/search.cljs
@@ -15,23 +15,14 @@
service-color @(rf/subscribe [:service-color])
page-scroll @(rf/subscribe [:page-scroll])
page-loading? @(rf/subscribe [:show-page-loading])
- pagination-loading? @(rf/subscribe [:show-pagination-loading])
scrolled-to-bottom? (= page-scroll (.-scrollHeight js/document.body))]
(when scrolled-to-bottom?
(rf/dispatch [::events/search-pagination q serviceId next-page-url]))
- [:div.flex.flex-col.text-gray-300.h-box-border.flex-auto
+ [:div.flex.flex-col.items-center.flex-auto
[:div.flex.flex-col.items-center.w-full.pt-4.flex-initial
[:h2 (str "Showing search results for: \"" q "\"")]
[:h1 (str "Number of search results: " (count items))]]
(if page-loading?
[loading/page-loading-icon service-color]
- (when items
- [:div.flex.flex-col
- [:div.flex.justify-center.align-center.flex-wrap.flex-auto
- (for [[i item] (map-indexed vector items)]
- (case (:type item)
- "stream" [items/stream-item (assoc item :key i)]
- "channel" [items/channel-item (assoc item :key i)]
- "playlist" [items/playlist-item (assoc item :key i)]))
- (when-not (empty? next-page-url)
- [loading/items-pagination-loading-icon service-color pagination-loading?])]]))]))
+ [:div.flex.flex-col.flex-auto.w-full {:class "lg:w-4/5"}
+ [items/related-streams items next-page-url]])]))