aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiguel Ángel Moreno <mail@migalmoreno.com>2024-12-02 08:34:51 +0100
committerMiguel Ángel Moreno <mail@migalmoreno.com>2024-12-02 08:34:51 +0100
commit50681d5d9f887bc7653d1fac4a7014a1d6623181 (patch)
treed66bdf692c3e868ad16ebdebf725737b830c9ca1
parente2fec5b6220f5a918bdea7cf7494a7a667690488 (diff)
feat: add layout switcher to bookmarks pages
-rw-r--r--src/frontend/tubo/bookmarks/views.cljs15
-rw-r--r--src/frontend/tubo/kiosks/views.cljs4
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]]))))