mirror of
https://github.com/logseq/logseq.git
synced 2026-05-24 04:34:14 +00:00
enhance(modal): add default-height option to action sheets
This commit is contained in:
@@ -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}))]))))
|
||||
|
||||
@@ -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}))]]
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user