From 774f603445ee4290180b4878424bbe3b9e1e7635 Mon Sep 17 00:00:00 2001 From: Miguel Ángel Moreno Date: Sun, 27 Aug 2023 22:17:45 +0200 Subject: feat(frontend): Rename routing namespace --- src/frontend/tubo/components/player.cljs | 4 ++-- src/frontend/tubo/routes.cljs | 7 ++++--- src/frontend/tubo/views.cljs | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/frontend/tubo/components/player.cljs b/src/frontend/tubo/components/player.cljs index 1d76e89..427d212 100644 --- a/src/frontend/tubo/components/player.cljs +++ b/src/frontend/tubo/components/player.cljs @@ -21,9 +21,9 @@ [:div.flex.flex-wrap.items-center [:div.flex.flex-col [:a.text-xs - {:href (rfe/href :tubo.router/stream nil {:url url})} name] + {:href (rfe/href :tubo.routes/stream nil {:url url})} name] [:a.text-xs.text-gray-300 - {:href (rfe/href :tubo.router/channel nil {:url uploader-url})} uploader-name]] + {:href (rfe/href :tubo.routes/channel nil {:url uploader-url})} uploader-name]] [:div.px-2.py-0.md:pt-4 [:audio {:src stream :ref #(reset! !player %) :loop @!loop?}]] [:div.mx-2 diff --git a/src/frontend/tubo/routes.cljs b/src/frontend/tubo/routes.cljs index eb40ac7..67ccc8c 100644 --- a/src/frontend/tubo/routes.cljs +++ b/src/frontend/tubo/routes.cljs @@ -10,7 +10,7 @@ [tubo.views.search :as search] [tubo.views.stream :as stream])) -(def routes +(def router (ref/router [["/" {:view kiosk/kiosk :name ::home @@ -22,8 +22,9 @@ :name ::search :controllers [{:parameters {:query [:q :serviceId]} :start (fn [{{:keys [serviceId q]} :query}] + (rf/dispatch [::events/get-search-results serviceId q]) (rf/dispatch [::events/change-service-id (js/parseInt serviceId)]) - (rf/dispatch [::events/get-search-results serviceId q]))}]}] + (rf/dispatch [::events/get-kiosks (js/parseInt serviceId)]))}]}] ["/stream" {:view stream/stream :name ::stream :controllers [{:parameters {:query [:url]} @@ -55,4 +56,4 @@ (defn start-routes! [] - (rfe/start! routes on-navigate {:use-fragment false})) + (rfe/start! router on-navigate {:use-fragment false})) diff --git a/src/frontend/tubo/views.cljs b/src/frontend/tubo/views.cljs index 8ee51f9..e3cb0ae 100644 --- a/src/frontend/tubo/views.cljs +++ b/src/frontend/tubo/views.cljs @@ -33,7 +33,7 @@ {:on-submit (fn [e] (.preventDefault e) (rf/dispatch [::events/navigate - {:name ::routes/search + {:name ::routes/search :params {} :query {:q global-search :serviceId service-id}}]))} [:div -- cgit v1.2.3