mirror of
https://github.com/penpot/penpot.git
synced 2025-06-06 09:31:38 +02:00
✨ Fix react warnings on workspace shortcuts panel
This commit is contained in:
parent
ca439cf604
commit
5d8562e072
1 changed files with 8 additions and 4 deletions
|
@ -7,6 +7,7 @@
|
||||||
(ns app.main.ui.workspace.sidebar.shortcuts
|
(ns app.main.ui.workspace.sidebar.shortcuts
|
||||||
(:require
|
(:require
|
||||||
[app.common.data :as d]
|
[app.common.data :as d]
|
||||||
|
[app.common.data.macros :as dm]
|
||||||
[app.config :as cf]
|
[app.config :as cf]
|
||||||
[app.main.data.dashboard.shortcuts]
|
[app.main.data.dashboard.shortcuts]
|
||||||
[app.main.data.events :as ev]
|
[app.main.data.events :as ev]
|
||||||
|
@ -213,7 +214,7 @@
|
||||||
[{:keys [content command] :as props}]
|
[{:keys [content command] :as props}]
|
||||||
(let [managed-list (if (coll? content)
|
(let [managed-list (if (coll? content)
|
||||||
content
|
content
|
||||||
(conj () content))
|
(conj () content))
|
||||||
chars-list (map ds/split-sc managed-list)
|
chars-list (map ds/split-sc managed-list)
|
||||||
last-element (last chars-list)
|
last-element (last chars-list)
|
||||||
short-char-list (if (= 1 (count chars-list))
|
short-char-list (if (= 1 (count chars-list))
|
||||||
|
@ -224,13 +225,16 @@
|
||||||
(for [chars short-char-list]
|
(for [chars short-char-list]
|
||||||
[:*
|
[:*
|
||||||
(for [char chars]
|
(for [char chars]
|
||||||
[:& converted-chars {:char char :command command}])
|
[:& converted-chars {:key (dm/str char "-" (name command))
|
||||||
|
:char char
|
||||||
|
:command command}])
|
||||||
(when (not= chars penultimate) [:span.space ","])])
|
(when (not= chars penultimate) [:span.space ","])])
|
||||||
(when (not= last-element penultimate)
|
(when (not= last-element penultimate)
|
||||||
[:*
|
[:*
|
||||||
[:span.space (tr "shortcuts.or")]
|
[:span.space (tr "shortcuts.or")]
|
||||||
(for [char last-element]
|
(for [char last-element]
|
||||||
[:& converted-chars {:char char
|
[:& converted-chars {:key (dm/str char "-" (name command))
|
||||||
|
:char char
|
||||||
:command command}])])]))
|
:command command}])])]))
|
||||||
|
|
||||||
(mf/defc shortcut-row
|
(mf/defc shortcut-row
|
||||||
|
@ -463,7 +467,7 @@
|
||||||
(when (kbd/enter? event)
|
(when (kbd/enter? event)
|
||||||
(on-search-clear-click)
|
(on-search-clear-click)
|
||||||
(dom/focus! (dom/get-element "shortcut-search")))))]
|
(dom/focus! (dom/get-element "shortcut-search")))))]
|
||||||
|
|
||||||
(mf/with-effect []
|
(mf/with-effect []
|
||||||
(dom/focus! (dom/get-element "shortcut-search")))
|
(dom/focus! (dom/get-element "shortcut-search")))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue