From fe8a15cb6ce4c550d08732e6eec0ce266d181e25 Mon Sep 17 00:00:00 2001 From: Daniel Richards Date: Thu, 2 Aug 2018 17:44:53 +0800 Subject: [PATCH] Rename class name to reflect component is now in edit-post, and reorder shortcuts --- .../keyboard-shortcut-help-modal/config.js | 8 +++---- .../keyboard-shortcut-help-modal/index.js | 20 ++++++++--------- .../keyboard-shortcut-help-modal/style.scss | 2 +- .../test/__snapshots__/index.js.snap | 22 ++++++++++++------- 4 files changed, 29 insertions(+), 23 deletions(-) diff --git a/edit-post/components/keyboard-shortcut-help-modal/config.js b/edit-post/components/keyboard-shortcut-help-modal/config.js index 832a98c7bac28b..05e7633ccf33f1 100644 --- a/edit-post/components/keyboard-shortcut-help-modal/config.js +++ b/edit-post/components/keyboard-shortcut-help-modal/config.js @@ -15,10 +15,6 @@ const globalShortcuts = { key: displayShortcut.primary( 's' ), description: __( 'Save your changes.' ), }, - { - key: displayShortcut.primaryShift( ',' ), - description: __( 'Show or hide the settings sidebar.' ), - }, { key: displayShortcut.primary( 'z' ), description: __( 'Undo your last changes.' ), @@ -27,6 +23,10 @@ const globalShortcuts = { key: displayShortcut.primaryShift( 'z' ), description: __( 'Redo your last undo.' ), }, + { + key: displayShortcut.primaryShift( ',' ), + description: __( 'Show or hide the settings sidebar.' ), + }, { key: displayShortcut.secondary( 'm' ), description: __( 'Switch between Visual Editor and Code Editor.' ), diff --git a/edit-post/components/keyboard-shortcut-help-modal/index.js b/edit-post/components/keyboard-shortcut-help-modal/index.js index ab2d444c0b3c71..e7f7cf9290000d 100644 --- a/edit-post/components/keyboard-shortcut-help-modal/index.js +++ b/edit-post/components/keyboard-shortcut-help-modal/index.js @@ -25,7 +25,7 @@ const splitShortcutKey = ( shortcutKey ) => { return ( { character } @@ -41,18 +41,18 @@ const splitShortcutKey = ( shortcutKey ) => { }; const ShortcutList = ( { shortcuts } ) => ( -
+
{ shortcuts.map( ( { key, description }, index ) => (
-
- +
+ { splitShortcutKey( key ) }
-
+
{ description }
@@ -61,8 +61,8 @@ const ShortcutList = ( { shortcuts } ) => ( ); const ShortcutSection = ( { title, shortcuts } ) => ( -
-

+
+

{ title }

@@ -71,7 +71,7 @@ const ShortcutSection = ( { title, shortcuts } ) => ( export function KeyboardShortcutHelpModal( { isModalActive, toggleModal } ) { const title = ( - + { __( 'Keyboard Shortcuts' ) } ); @@ -86,7 +86,7 @@ export function KeyboardShortcutHelpModal( { isModalActive, toggleModal } ) { /> { isModalActive && ( + Keyboard Shortcuts + + } >