From a221383ca167cd3f2b00a3075dcdc9fc38c51629 Mon Sep 17 00:00:00 2001 From: charlie Date: Fri, 15 Aug 2025 11:07:43 +0800 Subject: [PATCH] enhance(modal): add default-height option to action sheets --- src/main/mobile/components/header.cljs | 1 + src/main/mobile/components/modal.cljs | 1 + src/main/mobile/components/popup.cljs | 7 +++++-- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/mobile/components/header.cljs b/src/main/mobile/components/header.cljs index 5ce8a92871..742fdb6e13 100644 --- a/src/main/mobile/components/header.cljs +++ b/src/main/mobile/components/header.cljs @@ -133,5 +133,6 @@ (shui/tabler-icon "bug" {:class "opacity-70" :size 22}) "Report bug"])]) {:title "Actions" + :default-height false :type :action-sheet}))} (shui/tabler-icon "dots" {:size 23}))])))) diff --git a/src/main/mobile/components/modal.cljs b/src/main/mobile/components/modal.cljs index 86aeda233e..0cef0d1a58 100644 --- a/src/main/mobile/components/modal.cljs +++ b/src/main/mobile/components/modal.cljs @@ -112,6 +112,7 @@ (shui/tabler-icon "trash" {:class "opacity-80" :size 22}) "Delete"])]) {:title "Actions" + :default-height false :type :action-sheet}))} (shui/tabler-icon "dots-vertical" {:size 20}))]] diff --git a/src/main/mobile/components/popup.cljs b/src/main/mobile/components/popup.cljs index a8953190c4..0171a2fe5a 100644 --- a/src/main/mobile/components/popup.cljs +++ b/src/main/mobile/components/popup.cljs @@ -70,7 +70,8 @@ [] (let [{:keys [open? content-fn opts]} (rum/react mobile-state/*popup-data) quick-add? (= :ls-quick-add (:id opts)) - action-sheet? (= :action-sheet (:type opts))] + action-sheet? (= :action-sheet (:type opts)) + default-height (:default-height opts)] (when open? (state/clear-edit!) @@ -103,7 +104,9 @@ (silkhq/bottom-sheet-handle) (let [title (or (:title opts) (when (string? content-fn) content-fn)) content (if (fn? content-fn) - [:div {:style {:min-height 300}} + [:div {:style (cond-> {} + (or (nil? default-height) (number? default-height)) + (assoc :min-height (or default-height 300)))} (content-fn)] (if-let [buttons (and action-sheet? (:buttons opts))] [:div.-mx-2