Improve editor modals style consistency

pull/2838/head
ranfdev 2021-09-17 17:15:19 +02:00 committed by Tienson Qin
parent 3cbd304a22
commit e1ad100b8c
2 changed files with 5 additions and 6 deletions

View File

@ -92,7 +92,7 @@
{:on-chosen (page-handler/on-chosen-handler input id q pos format) {:on-chosen (page-handler/on-chosen-handler input id q pos format)
:on-enter #(page-handler/page-not-exists-handler input id q current-pos) :on-enter #(page-handler/page-not-exists-handler input id q current-pos)
:item-render (fn [page-name chosen?] :item-render (fn [page-name chosen?]
[:div.py-2.preview-trigger-wrapper [:div.preview-trigger-wrapper
(block/page-preview-trigger (block/page-preview-trigger
{:children [:div (search/highlight-exact-query page-name q)] {:children [:div (search/highlight-exact-query page-name q)]
:open? chosen? :open? chosen?
@ -101,7 +101,7 @@
:tippy-distance 24 :tippy-distance 24
:tippy-position (if sidebar? "left" "right")} :tippy-position (if sidebar? "left" "right")}
page-name)]) page-name)])
:empty-div [:div.text-gray-500.pl-4.pr-4 "Search for a page"] :empty-div [:div.text-gray-500.text-sm.px-4.py-2 "Search for a page"]
:class "black"}))))) :class "black"})))))
(rum/defcs block-search-auto-complete < rum/reactive (rum/defcs block-search-auto-complete < rum/reactive
@ -171,7 +171,7 @@
matched-templates matched-templates
{:on-chosen (editor-handler/template-on-chosen-handler id) {:on-chosen (editor-handler/template-on-chosen-handler id)
:on-enter non-exist-handler :on-enter non-exist-handler
:empty-div [:div.text-gray-500.pl-4.pr-4 "Search for a template"] :empty-div [:div.text-gray-500.px-4.py-2.text-sm "Search for a template"]
:item-render (fn [[template _block-db-id]] :item-render (fn [[template _block-db-id]]
template) template)
:class "black"}))))) :class "black"})))))
@ -241,7 +241,7 @@
input-value (get state ::input-value)] input-value (get state ::input-value)]
(when (seq input-option) (when (seq input-option)
(let [command (:command (first input-option))] (let [command (:command (first input-option))]
[:div.p-2.mt-2.rounded-md.shadow-sm.bg-base-2 [:div.p-2.rounded-md.shadow-lg
(for [{:keys [id placeholder type autoFocus] :as input-item} input-option] (for [{:keys [id placeholder type autoFocus] :as input-item} input-option]
[:div.my-3 [:div.my-3
[:input.form-input.block.w-full.pl-2.sm:text-sm.sm:leading-5 [:input.form-input.block.w-full.pl-2.sm:text-sm.sm:leading-5

View File

@ -38,8 +38,7 @@
(not (util/safe-re-find #" " q))) (not (util/safe-re-find #" " q)))
(let [i (string/index-of lc-content lc-q) (let [i (string/index-of lc-content lc-q)
[before after] [(subs content 0 i) (subs content (+ i (count q)))]] [before after] [(subs content 0 i) (subs content (+ i (count q)))]]
[:p [:div
{:class "m-0"}
(when-not (string/blank? before) (when-not (string/blank? before)
[:span before]) [:span before])
[:mark {:class "p-0 rounded-none"} (subs content i (+ i (count q)))] [:mark {:class "p-0 rounded-none"} (subs content i (+ i (count q)))]