diff --git a/res/css/_components.scss b/res/css/_components.scss index 2d2e3f0de7..ad4193f7e2 100644 --- a/res/css/_components.scss +++ b/res/css/_components.scss @@ -277,6 +277,7 @@ @import "./views/settings/_ImageSizePanel.scss"; @import "./views/settings/_IntegrationManager.scss"; @import "./views/settings/_JoinRuleSettings.scss"; +@import "./views/settings/_KeyboardShortcut.scss"; @import "./views/settings/_LayoutSwitcher.scss"; @import "./views/settings/_Notifications.scss"; @import "./views/settings/_PhoneNumbers.scss"; diff --git a/res/css/views/settings/_KeyboardShortcut.scss b/res/css/views/settings/_KeyboardShortcut.scss new file mode 100644 index 0000000000..d3ca6cc943 --- /dev/null +++ b/res/css/views/settings/_KeyboardShortcut.scss @@ -0,0 +1,36 @@ +/* +Copyright 2020 The Matrix.org Foundation C.I.C. +Copyright 2021 Šimon Brandner + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +.mx_KeyboardShortcut { + kbd { + padding: 5px; + border-radius: 4px; + background-color: $header-panel-bg-color; + margin-right: 5px; + min-width: 20px; + text-align: center; + display: inline-block; + border: 1px solid $kbd-border-color; + box-shadow: 0 2px $kbd-border-color; + margin-bottom: 4px; + text-transform: capitalize; + + & + kbd { + margin-left: 5px; + } + } +} diff --git a/res/css/views/settings/tabs/user/_KeyboardUserSettingsTab.scss b/res/css/views/settings/tabs/user/_KeyboardUserSettingsTab.scss index 1ace6ec151..1ba3a8599b 100644 --- a/res/css/views/settings/tabs/user/_KeyboardUserSettingsTab.scss +++ b/res/css/views/settings/tabs/user/_KeyboardUserSettingsTab.scss @@ -21,22 +21,4 @@ limitations under the License. justify-content: space-between; align-items: center; } - - kbd { - padding: 5px; - border-radius: 4px; - background-color: $header-panel-bg-color; - margin-right: 5px; - min-width: 20px; - text-align: center; - display: inline-block; - border: 1px solid $kbd-border-color; - box-shadow: 0 2px $kbd-border-color; - margin-bottom: 4px; - text-transform: capitalize; - - & + kbd { - margin-left: 5px; - } - } } diff --git a/src/components/views/settings/KeyboardShortcut.tsx b/src/components/views/settings/KeyboardShortcut.tsx index 8863979a28..14dcf77d24 100644 --- a/src/components/views/settings/KeyboardShortcut.tsx +++ b/src/components/views/settings/KeyboardShortcut.tsx @@ -58,7 +58,7 @@ export const KeyboardShortcut: React.FC = ({ value }) => modifiersElement.push(); } - return
+ return
{ modifiersElement }
; diff --git a/test/components/views/settings/__snapshots__/KeyboardShortcut-test.tsx.snap b/test/components/views/settings/__snapshots__/KeyboardShortcut-test.tsx.snap index d2e43755fd..e4468c802f 100644 --- a/test/components/views/settings/__snapshots__/KeyboardShortcut-test.tsx.snap +++ b/test/components/views/settings/__snapshots__/KeyboardShortcut-test.tsx.snap @@ -23,7 +23,9 @@ exports[`KeyboardShortcut doesn't render same modifier twice 1`] = ` } } > -
+
-
+
-
+
-
+
-
+