Keybinding code unification #6 (#8042)

This commit is contained in:
Šimon Brandner
2022-03-14 14:25:51 +01:00
committed by GitHub
parent e725f14651
commit 8d13e238b9
10 changed files with 462 additions and 351 deletions
@@ -1,104 +1,5 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`KeyboardUserSettingsTab doesn't render + if last 1`] = `
<KeyboardKey
last={true}
name="a"
>
<kbd>
a
</kbd>
</KeyboardKey>
`;
exports[`KeyboardUserSettingsTab doesn't render same modifier twice 1`] = `
<KeyboardShortcut
name="keybind1"
>
<div>
<KeyboardKey
key="ctrlOrCmdKey"
name="Control"
>
<kbd>
missing translation: en|Ctrl
</kbd>
+
</KeyboardKey>
<KeyboardKey
last={true}
name="a"
>
<kbd>
a
</kbd>
</KeyboardKey>
</div>
</KeyboardShortcut>
`;
exports[`KeyboardUserSettingsTab doesn't render same modifier twice 2`] = `
<KeyboardShortcut
name="keybind1"
>
<div>
<KeyboardKey
key="ctrlOrCmdKey"
name="Control"
>
<kbd>
missing translation: en|Ctrl
</kbd>
+
</KeyboardKey>
<KeyboardKey
last={true}
name="a"
>
<kbd>
a
</kbd>
</KeyboardKey>
</div>
</KeyboardShortcut>
`;
exports[`KeyboardUserSettingsTab renders alternative key name 1`] = `
<KeyboardKey
name="PageDown"
>
<kbd>
missing translation: en|Page Down
</kbd>
+
</KeyboardKey>
`;
exports[`KeyboardUserSettingsTab renders key icon 1`] = `
<KeyboardKey
name="ArrowDown"
>
<kbd>
↓
</kbd>
+
</KeyboardKey>
`;
exports[`KeyboardUserSettingsTab renders list of keyboard shortcuts 1`] = `
<KeyboardUserSettingsTab>
<div
@@ -140,9 +41,14 @@ exports[`KeyboardUserSettingsTab renders list of keyboard shortcuts 1`] = `
<div
className="mx_KeyboardShortcut_shortcutRow"
>
missing translation: en|Cancel replying to a message
Cancel replying to a message
<KeyboardShortcut
name="keybind1"
value={
Object {
"ctrlKey": true,
"key": "a",
}
}
>
<div>
<KeyboardKey
@@ -177,9 +83,14 @@ exports[`KeyboardUserSettingsTab renders list of keyboard shortcuts 1`] = `
<div
className="mx_KeyboardShortcut_shortcutRow"
>
missing translation: en|Toggle Bold
Toggle Bold
<KeyboardShortcut
name="keybind2"
value={
Object {
"ctrlKey": true,
"key": "b",
}
}
>
<div>
<KeyboardKey
@@ -241,9 +152,13 @@ exports[`KeyboardUserSettingsTab renders list of keyboard shortcuts 1`] = `
<div
className="mx_KeyboardShortcut_shortcutRow"
>
missing translation: en|Select room from the room list
Select room from the room list
<KeyboardShortcut
name="keybind3"
value={
Object {
"key": "Enter",
}
}
>
<div>
<KeyboardKey