From 6e384c92525e1812a1443e399e769ab4a559df3a Mon Sep 17 00:00:00 2001 From: Miguel Ángel Moreno Date: Thu, 19 Dec 2024 22:37:07 +0100 Subject: feat: amend navigation controls logic --- src/frontend/tubo/navigation/views.cljs | 40 ++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/src/frontend/tubo/navigation/views.cljs b/src/frontend/tubo/navigation/views.cljs index accff34..e0eb8f5 100644 --- a/src/frontend/tubo/navigation/views.cljs +++ b/src/frontend/tubo/navigation/views.cljs @@ -71,28 +71,32 @@ [:button.ml-2.invisible.absolute.lg:visible.lg:relative [:a.font-bold {:href (rfe/href :homepage)} [layout/logo :height 35 :width 35]]]) - (when (and show-queue? (not show-search-form?)) - [:button.text-white.mx-2 - {:on-click #(rf/dispatch [:queue/show false])} - [:i.fa-solid.fa-arrow-left]]) - (when (and show-main-player? (not show-search-form?)) - [:button.text-white.mx-2 - {:on-click #(rf/dispatch [:bg-player/switch-from-main nil])} - [:i.fa-solid.fa-arrow-left]]) - (when-not (or show-queue? show-main-player? show-search-form?) + (cond (and show-main-player? (not show-search-form?)) + [:button.text-white.mx-2 + {:on-click #(rf/dispatch [:bg-player/switch-from-main nil])} + [:i.fa-solid.fa-arrow-left]] + (and show-queue? (not show-search-form?)) + [:button.text-white.mx-2 + {:on-click #(rf/dispatch [:queue/show false])} + [:i.fa-solid.fa-arrow-left]]) + (when (and (not show-queue?) + (not show-main-player?) + (not show-search-form?)) [:button.text-white.mx-3.lg:hidden {:on-click #(rf/dispatch [:navigation/show-mobile-menu])} [:i.fa-solid.fa-bars]]) - (when-not (or show-queue? show-main-player? show-search-form?) - [:h1.text-white.text-lg.sm:text-xl.font-bold.line-clamp-1.lg:hidden - title]) - (when (and show-queue? (not show-search-form?)) - [:h1.text-white.text-lg.sm:text-xl.font-bold.line-clamp-1 - "Play Queue"]) - (when (and show-main-player? (not show-search-form?)) - [:h1.text-white.text-lg.sm:text-xl.font-bold.line-clamp-1 - "Main Player"])])) + (cond (and (not show-queue?) + (not show-main-player?) + (not show-search-form?)) + [:h1.text-white.text-lg.sm:text-xl.font-bold.line-clamp-1.lg:hidden + title] + (and show-main-player? (not show-search-form?)) + [:h1.text-white.text-lg.sm:text-xl.font-bold.line-clamp-1 + "Main Player"] + (and show-queue? (not show-search-form?)) + [:h1.text-white.text-lg.sm:text-xl.font-bold.line-clamp-1 + "Play Queue"])])) (defn nav-right-content [{{:keys [kioskId]} :query-params path :path :as match}] -- cgit v1.2.3