mirror of
https://github.com/logseq/logseq.git
synced 2026-06-01 19:01:22 +00:00
fix: react key warnings
This commit is contained in:
28
deps/shui/src/logseq/shui/shortcut/v1.cljs
vendored
28
deps/shui/src/logseq/shui/shortcut/v1.cljs
vendored
@@ -1,8 +1,8 @@
|
||||
(ns logseq.shui.shortcut.v1
|
||||
(:require [clojure.string :as string]
|
||||
[goog.userAgent]
|
||||
[logseq.shui.base.core :as shui.base]
|
||||
[rum.core :as rum]
|
||||
[goog.userAgent]))
|
||||
[rum.core :as rum]))
|
||||
|
||||
(def mac? goog.userAgent/MAC)
|
||||
(defn print-shortcut-key [key]
|
||||
@@ -57,15 +57,15 @@
|
||||
interactive? (true? interactive?)]
|
||||
(shui.base/button {:variant (if interactive? :default :text)
|
||||
:class (str "bg-gray-03 text-gray-10 px-1.5 py-0 leading-4 h-5 rounded font-normal "
|
||||
(if interactive?
|
||||
"hover:bg-gray-04 active:bg-gray-03 hover:text-gray-12"
|
||||
"bg-transparent cursor-default active:bg-gray-03 hover:text-gray-11 opacity-80"))
|
||||
(if interactive?
|
||||
"hover:bg-gray-04 active:bg-gray-03 hover:text-gray-12"
|
||||
"bg-transparent cursor-default active:bg-gray-03 hover:text-gray-11 opacity-80"))
|
||||
:size size}
|
||||
(for [[index tile] (map-indexed vector tiles)]
|
||||
[:<>
|
||||
(when (< 0 index)
|
||||
[:span.ui__button__tile-separator])
|
||||
[:span.ui__button__tile tile]]))))
|
||||
(for [[index tile] (map-indexed vector tiles)]
|
||||
[:<>
|
||||
(when (< 0 index)
|
||||
[:span.ui__button__tile-separator])
|
||||
[:span.ui__button__tile tile]]))))
|
||||
|
||||
(rum/defc root
|
||||
[shortcut & {:keys [size theme interactive?]
|
||||
@@ -80,8 +80,10 @@
|
||||
(for [[index binding] (map-indexed vector shortcuts)]
|
||||
[:<>
|
||||
(when (< 0 index)
|
||||
[:div.text-gray-11.text-sm "|"])
|
||||
[:div.text-gray-11.text-sm {:key "sep"} "|"])
|
||||
(if (coll? (first binding)) ; + included
|
||||
(for [ks binding]
|
||||
(part ks size opts))
|
||||
(for [[idx ks] (map-indexed vector binding)]
|
||||
(rum/with-key
|
||||
(part ks size opts)
|
||||
(str "part-" idx)))
|
||||
(part binding size opts))]))))
|
||||
|
||||
Reference in New Issue
Block a user