From fdffab85c1f8213d183adde79935e0489403df64 Mon Sep 17 00:00:00 2001 From: charlie Date: Tue, 27 May 2025 14:37:38 +0800 Subject: [PATCH] enhance(capacitor): polish page blocks list --- src/main/capacitor/components/app.cljs | 24 ++++-------------------- src/main/capacitor/components/page.cljs | 10 ++++++---- src/main/capacitor/components/ui.cljs | 7 +++++++ 3 files changed, 17 insertions(+), 24 deletions(-) diff --git a/src/main/capacitor/components/app.cljs b/src/main/capacitor/components/app.cljs index 341f03c630..a95d329138 100644 --- a/src/main/capacitor/components/app.cljs +++ b/src/main/capacitor/components/app.cljs @@ -84,26 +84,10 @@ {:id "app-keep-keyboard-open-input"}]) (rum/defc journals [] - (let [[reload set-reload!] (hooks/use-state 0)] - (ion/content - (ion/refresher - {:slot "fixed" - :pull-factor 0.5 - :pull-min 100 - :pull-max 200 - :on-ion-refresh (fn [^js e] - (js/setTimeout - (fn [] (.complete (.-detail e)) - (set-reload! (inc reload))) - 1000))} - (ion/refresher-content)) - - [:div.pt-4 - [:main#app-container-wrapper.ls-fold-button-on-right - [:div#app-container - [:div#main-container.flex.flex-1 - [:div#main-content-container.w-full.!px-0 - (journal/all-journals)]]]]]))) + (ion/content + (ui/classic-app-container-wrap + [:div.pt-3 + (journal/all-journals)]))) (rum/defc home < rum/reactive [] diff --git a/src/main/capacitor/components/page.cljs b/src/main/capacitor/components/page.cljs index dba558d039..020d7090d0 100644 --- a/src/main/capacitor/components/page.cljs +++ b/src/main/capacitor/components/page.cljs @@ -1,6 +1,7 @@ (ns capacitor.components.page (:require [capacitor.ionic :as ion] [capacitor.state :as state] + [capacitor.components.ui :as ui] [frontend.components.page :as cp-page] [frontend.db.async :as db-async] [frontend.db.utils :as db-utils] @@ -57,7 +58,8 @@ (ion/title title))) - (ion/content {:class "ion-padding"} - (if loading? - [:p.text-xl.text-center "Loading ..."] - (cp-page/page-blocks-cp page {})))))) + (ion/content {:class "ion-padding"} + (ui/classic-app-container-wrap + (if loading? + [:p.text-xl.text-center "Loading ..."] + (cp-page/page-blocks-cp page {}))))))) diff --git a/src/main/capacitor/components/ui.cljs b/src/main/capacitor/components/ui.cljs index 9beb3896d8..e456c86f19 100644 --- a/src/main/capacitor/components/ui.cljs +++ b/src/main/capacitor/components/ui.cljs @@ -20,6 +20,13 @@ (merge {:class "ion-padding"} content-props) content))) +(rum/defc classic-app-container-wrap + [content] + [:main#app-container-wrapper.ls-fold-button-on-right + [:div#app-container.pt-2 + [:div#main-container.flex.flex-1 + [:div#main-content-container.w-full.!px-0 content]]]]) + (rum/defc notification-clear-all [] [:div.ui__notifications-content