enhance: use css to handle select-none instead of component state

This commit is contained in:
Tienson Qin
2024-04-09 14:24:53 +08:00
parent 69966361b2
commit e962797aba
4 changed files with 15 additions and 16 deletions

View File

@@ -891,6 +891,7 @@
[state route-match main-content]
(let [{:keys [open-fn]} state
current-repo (state/sub :git/current-repo)
selection-mode? (state/sub :selection/mode)
granted? (state/sub [:nfs/user-granted? (state/get-current-repo)])
theme (state/sub :ui/theme)
accent-color (some-> (state/sub :ui/radix-color) (name))
@@ -952,7 +953,8 @@
(when (= "Enter" (.-key e))
(ui/focus-element (ui/main-node))))}
(t :accessibility/skip-to-main-content)]
[:div.#app-container
[:div.#app-container (cond-> {} selection-mode?
(assoc :class "blocks-selection-mode"))
[:div#left-container
{:class (if (state/sub :ui/sidebar-open?) "overflow-hidden" "w-full")}
(header/header {:open-fn open-fn