From 50681d5d9f887bc7653d1fac4a7014a1d6623181 Mon Sep 17 00:00:00 2001 From: Miguel Ángel Moreno Date: Mon, 2 Dec 2024 08:34:51 +0100 Subject: feat: add layout switcher to bookmarks pages --- src/frontend/tubo/bookmarks/views.cljs | 15 ++++++++++----- src/frontend/tubo/kiosks/views.cljs | 4 +--- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/frontend/tubo/bookmarks/views.cljs b/src/frontend/tubo/bookmarks/views.cljs index 2b3bd14..6f71e84 100644 --- a/src/frontend/tubo/bookmarks/views.cljs +++ b/src/frontend/tubo/bookmarks/views.cljs @@ -9,7 +9,8 @@ (defn bookmarks [] - (let [!menu-active? (r/atom nil)] + (let [!menu-active? (r/atom nil) + !layout (r/atom (:items-layout @(rf/subscribe [:settings])))] (fn [] (let [bookmarks @(rf/subscribe [:bookmarks]) items (map @@ -25,7 +26,7 @@ :thumbnail-url)) bookmarks)] [layout/content-container - [layout/content-header "Bookmarked Playlists" + [layout/content-header "Bookmarks" [layout/popover-menu !menu-active? [{:label "Add New" :icon [:i.fa-solid.fa-plus] @@ -49,11 +50,13 @@ {:label "Clear All" :icon [:i.fa-solid.fa-trash] :on-click #(rf/dispatch [:bookmarks/clear])}]]] - [items/related-streams items]])))) + [items/layout-switcher !layout] + [items/related-streams items nil !layout]])))) (defn bookmark [] - (let [!menu-active? (r/atom nil)] + (let [!menu-active? (r/atom nil) + !layout (r/atom (:items-layout @(rf/subscribe [:settings])))] (fn [] (let [bookmarks @(rf/subscribe [:bookmarks]) {{:keys [id]} :query-params} @(rf/subscribe @@ -71,5 +74,7 @@ :icon [:i.fa-solid.fa-plus] :on-click #(rf/dispatch [:modals/open [modals/add-to-bookmark items]])}]])] + [items/layout-switcher !layout] [items/related-streams - (map #(assoc % :type "stream" :bookmark-id id) items)]])))) + (map #(assoc % :type "stream" :bookmark-id id) items) nil + !layout]])))) diff --git a/src/frontend/tubo/kiosks/views.cljs b/src/frontend/tubo/kiosks/views.cljs index 3ad3f42..842f591 100644 --- a/src/frontend/tubo/kiosks/views.cljs +++ b/src/frontend/tubo/kiosks/views.cljs @@ -44,7 +44,5 @@ (when scrolled-to-bottom? (rf/dispatch [:kiosks/fetch-paginated service-id id next-page-url])) [layout/content-container - [layout/content-header - id - [items/layout-switcher !layout]] + [layout/content-header id [items/layout-switcher !layout]] [items/related-streams related-streams next-page-url !layout]])))) -- cgit v1.2.3