From 999b9a6d6c4c4bf15c08f8a06c09f08876a90b7d Mon Sep 17 00:00:00 2001 From: Miguel Ángel Moreno Date: Sun, 28 Jan 2024 02:46:02 +0100 Subject: feat(frontend): rename bookmarks to playlists --- src/backend/tubo/routes.clj | 2 +- src/frontend/tubo/events.cljs | 5 +++++ src/frontend/tubo/routes.cljs | 7 ++++--- src/frontend/tubo/views/bookmarks.cljs | 16 ---------------- src/frontend/tubo/views/playlists.cljs | 16 ++++++++++++++++ 5 files changed, 26 insertions(+), 20 deletions(-) delete mode 100644 src/frontend/tubo/views/bookmarks.cljs create mode 100644 src/frontend/tubo/views/playlists.cljs (limited to 'src') diff --git a/src/backend/tubo/routes.clj b/src/backend/tubo/routes.clj index 2bf56f8..1492139 100644 --- a/src/backend/tubo/routes.clj +++ b/src/backend/tubo/routes.clj @@ -20,7 +20,7 @@ ["/playlist" handler/index] ["/kiosk" handler/index] ["/settings" handler/index] - ["/bookmarks" handler/index] + ["/playlists" handler/index] ["/api" ["/services" ["" {:get handler/services}] diff --git a/src/frontend/tubo/events.cljs b/src/frontend/tubo/events.cljs index 0ee184d..889719d 100644 --- a/src/frontend/tubo/events.cljs +++ b/src/frontend/tubo/events.cljs @@ -656,3 +656,8 @@ (fn [{:keys [db store]} [_ key val]] {:db (assoc-in db [:settings key] val) :store (assoc store key val)})) + +(rf/reg-event-fx + ::get-playlists-page + (fn [_] + {::document-title! "Playlists"})) diff --git a/src/frontend/tubo/routes.cljs b/src/frontend/tubo/routes.cljs index 4cf97c3..b062544 100644 --- a/src/frontend/tubo/routes.cljs +++ b/src/frontend/tubo/routes.cljs @@ -4,10 +4,10 @@ [reitit.frontend.easy :as rfe] [re-frame.core :as rf] [tubo.events :as events] - [tubo.views.bookmarks :as bookmarks] [tubo.views.channel :as channel] [tubo.views.kiosk :as kiosk] [tubo.views.playlist :as playlist] + [tubo.views.playlists :as playlists] [tubo.views.search :as search] [tubo.views.settings :as settings] [tubo.views.stream :as stream])) @@ -45,8 +45,9 @@ (rf/dispatch [::events/get-kiosk-page serviceId kioskId]))}]}] ["/settings" {:view settings/settings-page :name ::settings}] - ["/bookmarks" {:view bookmarks/bookmarks-page - :name ::bookmarks}]])) + ["/playlists" {:view playlists/playlists-page + :name ::playlists + :controllers [{:start #(rf/dispatch [::events/get-playlists-page])}]}]])) (defn on-navigate [new-match] diff --git a/src/frontend/tubo/views/bookmarks.cljs b/src/frontend/tubo/views/bookmarks.cljs deleted file mode 100644 index 3f47c02..0000000 --- a/src/frontend/tubo/views/bookmarks.cljs +++ /dev/null @@ -1,16 +0,0 @@ -(ns tubo.views.bookmarks - (:require - [re-frame.core :as rf] - [tubo.components.items :as items] - [tubo.components.layout :as layout] - [tubo.events :as events])) - -(defn bookmarks-page - [] - (let [service-color @(rf/subscribe [:service-color]) - bookmarks @(rf/subscribe [:bookmarks])] - [layout/content-container - [layout/content-header "Bookmarks" - [layout/primary-button "Enqueue" - #(rf/dispatch [::events/enqueue-related-streams bookmarks service-color]) "fa-solid fa-headphones"]] - [items/related-streams bookmarks]])) diff --git a/src/frontend/tubo/views/playlists.cljs b/src/frontend/tubo/views/playlists.cljs new file mode 100644 index 0000000..b640960 --- /dev/null +++ b/src/frontend/tubo/views/playlists.cljs @@ -0,0 +1,16 @@ +(ns tubo.views.playlists + (:require + [re-frame.core :as rf] + [tubo.components.items :as items] + [tubo.components.layout :as layout] + [tubo.events :as events])) + +(defn playlists-page + [] + (let [service-color @(rf/subscribe [:service-color]) + bookmarks @(rf/subscribe [:bookmarks])] + [layout/content-container + [layout/content-header "Bookmarks" + [layout/primary-button "Enqueue" + #(rf/dispatch [::events/enqueue-related-streams bookmarks service-color]) "fa-solid fa-headphones"]] + [items/related-streams bookmarks]])) -- cgit v1.2.3