pull/10493/head
Ben Yorke 2023-09-29 17:03:31 +02:00
parent 2ab619e44a
commit 79a11f8b88
2 changed files with 7 additions and 6 deletions

View File

@ -37,16 +37,16 @@
(let [start-index (string/index-of normal-text normal-query)
end-index (+ start-index (count query))
text-string (cond-> (or text "") (keyword? text) name :always str)]
[(subs text-string 0 start-index)
(subs text-string start-index end-index)
(subs text-string end-index)]))
[(or (subs text-string 0 start-index) "")
(or (subs text-string start-index end-index) "")
(or (subs text-string end-index) "")]))
(defn span-with-single-highlight-token [text query normal-text normal-query]
(let [[before-text highlighted-text after-text] (split-text-on-highlight text query normal-text normal-query)]
[:span
(when-not (string/blank? before-text) [:span before-text])
(when-not (string/blank? highlighted-text) [:span {:class "bg-accent-06 dark:bg-accent-08-alpha"} highlighted-text])
(when-not (string/blank? after-text) [:span after-text])]))
(when-not (string/blank? after-text) [:span after-text])
(when-not (string/blank? highlighted-text) [:span {:class "bg-accent-06 dark:bg-accent-08-alpha"} highlighted-text])]))
(defn span-with-mutliple-highlight-tokens [app-config text query normal-text normal-query]
(loop [[query-token & more] (string/split normal-query #" ")

View File

@ -227,7 +227,8 @@
"database") {:size (if logged-in? 12 16)
:id "database-icon"
:class (when logged-in? "p-1 rounded")
:style {:background-color "var(--lx-gray-06-alpha, var(--color-level-5))"}})]
:style {:background-color "var(--lx-gray-06-alpha, var(--color-level-5))"
:padding 3}})]
[:div.graphs
[:span#repo-switch.block.pr-2.whitespace-nowrap
[:span [:span#repo-name.font-medium