diff options
author | Miguel Ángel Moreno <mail@migalmoreno.com> | 2023-01-17 13:17:40 +0100 |
---|---|---|
committer | Miguel Ángel Moreno <mail@migalmoreno.com> | 2023-01-17 13:17:40 +0100 |
commit | 81f03c0b449bec1fa60cf2936bfc3f66a5ad58c1 (patch) | |
tree | a2a7aa01f61dd71b511dd3729a9f4b28c35b531f /src/frontend/tau/views/search.cljs | |
parent | 5e995881dd0c431ae63b1a50c2d03e59962241f1 (diff) |
chore: Rename project
Diffstat (limited to 'src/frontend/tau/views/search.cljs')
-rw-r--r-- | src/frontend/tau/views/search.cljs | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/src/frontend/tau/views/search.cljs b/src/frontend/tau/views/search.cljs deleted file mode 100644 index bfb0b20..0000000 --- a/src/frontend/tau/views/search.cljs +++ /dev/null @@ -1,28 +0,0 @@ -(ns tau.views.search - (:require - [re-frame.core :as rf] - [reitit.frontend.easy :as rfe] - [tau.components.items :as items] - [tau.components.loading :as loading] - [tau.events :as events])) - -(defn search - [{{:keys [q serviceId]} :query-params}] - (let [{:keys [items next-page] :as search-results} @(rf/subscribe [:search-results]) - next-page-url (:url next-page) - services @(rf/subscribe [:services]) - service-id @(rf/subscribe [:service-id]) - service-color @(rf/subscribe [:service-color]) - page-scroll @(rf/subscribe [:page-scroll]) - page-loading? @(rf/subscribe [:show-page-loading]) - scrolled-to-bottom? (= page-scroll (.-scrollHeight js/document.body))] - (when scrolled-to-bottom? - (rf/dispatch [::events/search-pagination q serviceId next-page-url])) - [:div.flex.flex-col.items-center.flex-auto - [:div.flex.flex-col.items-center.w-full.pt-4.flex-initial - [:h2 (str "Showing search results for: \"" q "\"")] - [:h1 (str "Number of search results: " (count items))]] - (if page-loading? - [loading/loading-icon service-color "text-5xl"] - [:div.flex.flex-col.flex-auto.w-full {:class "lg:w-4/5"} - [items/related-streams items next-page-url]])])) |