From 62a9b030c457a9bcc4736fafff17f4126edf4f95 Mon Sep 17 00:00:00 2001 From: Miguel Ángel Moreno Date: Sun, 18 Feb 2024 17:01:52 +0100 Subject: fix(frontend): fix display behavior of search form --- src/frontend/tubo/components/navigation.cljs | 6 +++--- src/frontend/tubo/events.cljs | 6 +++--- src/frontend/tubo/routes.cljs | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/frontend/tubo/components/navigation.cljs b/src/frontend/tubo/components/navigation.cljs index c1767ce..eeeb665 100644 --- a/src/frontend/tubo/components/navigation.cljs +++ b/src/frontend/tubo/components/navigation.cljs @@ -35,7 +35,7 @@ :query {:q search-query :serviceId service-id}}])))} [:div.flex [:button.mx-2 - {:on-click #(rf/dispatch [::events/toggle-search-form]) + {:on-click #(rf/dispatch [::events/show-search-form false]) :type "button"} [:i.fa-solid.fa-arrow-left]] [:input.bg-transparent.border-none.py-2.pr-6.mx-2.focus:ring-transparent.placeholder-white.sm:w-96.w-full @@ -169,13 +169,13 @@ [:div.flex.items-center.text-white.justify-end (when-not show-search-form? [:button.mx-3 - {:on-click #(rf/dispatch [::events/toggle-search-form])} + {:on-click #(rf/dispatch [::events/show-search-form true])} [:i.fa-solid.fa-search]]) [:a.mx-3.hidden.lg:block {:href (rfe/href ::routes/settings)} [:i.fa-solid.fa-cog]] [:a.mx-3.hidden.lg:block - {:href (rfe/href ::routes/playlists)} + {:href (rfe/href ::routes/bookmarks)} [:i.fa-solid.fa-bookmark]] [:a.mx-3.hidden.lg:block {:href "https://github.com/migalmoreno/tubo" :target "_blank"} diff --git a/src/frontend/tubo/events.cljs b/src/frontend/tubo/events.cljs index 0916f65..e155881 100644 --- a/src/frontend/tubo/events.cljs +++ b/src/frontend/tubo/events.cljs @@ -169,10 +169,10 @@ {::history-go! idx})) (rf/reg-event-db - ::toggle-search-form - (fn [db _] + ::show-search-form + (fn [db [_ show?]] (when-not (= (-> db :current-match :path) "search") - (assoc db :show-search-form (not (:show-search-form db)))))) + (assoc db :show-search-form show?)))) (rf/reg-event-fx ::toggle-mobile-nav diff --git a/src/frontend/tubo/routes.cljs b/src/frontend/tubo/routes.cljs index c089322..6bfb5dc 100644 --- a/src/frontend/tubo/routes.cljs +++ b/src/frontend/tubo/routes.cljs @@ -22,7 +22,7 @@ :controllers [{:parameters {:query [:q :serviceId]} :start (fn [{{:keys [serviceId q]} :query}] (rf/dispatch [::events/get-search-page serviceId q])) - :stop #(rf/dispatch [::events/toggle-search-form])}]}] + :stop #(rf/dispatch [::events/show-search-form false])}]}] ["/stream" {:view stream/stream :name ::stream :controllers [{:parameters {:query [:url]} -- cgit v1.2.3