Skip to content

Commit

Permalink
Rename class name to reflect component is now in edit-post, and reord…
Browse files Browse the repository at this point in the history
…er shortcuts
  • Loading branch information
talldan committed Aug 2, 2018
1 parent 6e29b99 commit fe8a15c
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 23 deletions.
8 changes: 4 additions & 4 deletions edit-post/components/keyboard-shortcut-help-modal/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.' ),
Expand All @@ -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.' ),
Expand Down
20 changes: 10 additions & 10 deletions edit-post/components/keyboard-shortcut-help-modal/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const splitShortcutKey = ( shortcutKey ) => {
return (
<kbd
key={ index }
className="editor-keyboard-shortcut-help__shortcut-key"
className="edit-post-keyboard-shortcut-help__shortcut-key"
>
{ character }
</kbd>
Expand All @@ -41,18 +41,18 @@ const splitShortcutKey = ( shortcutKey ) => {
};

const ShortcutList = ( { shortcuts } ) => (
<dl className="editor-keyboard-shortcut-help__shortcut-list">
<dl className="edit-post-keyboard-shortcut-help__shortcut-list">
{ shortcuts.map( ( { key, description }, index ) => (
<div
className="editor-keyboard-shortcut-help__shortcut"
className="edit-post-keyboard-shortcut-help__shortcut"
key={ index }
>
<dt className="editor-keyboard-shortcut-help__shortcut-term">
<kbd className="editor-keyboard-shortcut-help__shortcut-key-combination">
<dt className="edit-post-keyboard-shortcut-help__shortcut-term">
<kbd className="edit-post-keyboard-shortcut-help__shortcut-key-combination">
{ splitShortcutKey( key ) }
</kbd>
</dt>
<dd className="editor-keyboard-shortcut-help__shortcut-description">
<dd className="edit-post-keyboard-shortcut-help__shortcut-description">
{ description }
</dd>
</div>
Expand All @@ -61,8 +61,8 @@ const ShortcutList = ( { shortcuts } ) => (
);

const ShortcutSection = ( { title, shortcuts } ) => (
<section className="editor-keyboard-shortcut-help__section">
<h2 className="editor-keyboard-shortcut-help__section-title">
<section className="edit-post-keyboard-shortcut-help__section">
<h2 className="edit-post-keyboard-shortcut-help__section-title">
{ title }
</h2>
<ShortcutList shortcuts={ shortcuts } />
Expand All @@ -71,7 +71,7 @@ const ShortcutSection = ( { title, shortcuts } ) => (

export function KeyboardShortcutHelpModal( { isModalActive, toggleModal } ) {
const title = (
<span className="editor-keyboard-shortcut-help__title">
<span className="edit-post-keyboard-shortcut-help__title">
{ __( 'Keyboard Shortcuts' ) }
</span>
);
Expand All @@ -86,7 +86,7 @@ export function KeyboardShortcutHelpModal( { isModalActive, toggleModal } ) {
/>
{ isModalActive && (
<Modal
className="editor-keyboard-shortcut-help"
className="edit-post-keyboard-shortcut-help"
title={ title }
closeLabel={ __( 'Close' ) }
onRequestClose={ toggleModal }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.editor-keyboard-shortcut-help {
.edit-post-keyboard-shortcut-help {
&__title {
font-size: 1rem;
font-weight: bold;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,16 @@ exports[`KeyboardShortcutHelpModal should match snapshot when the modal is activ
}
/>
<WithInstanceId(Modal)
className="editor-keyboard-shortcut-help"
className="edit-post-keyboard-shortcut-help"
closeLabel="Close"
onRequestClose={[Function]}
title="Keyboard Shortcuts"
title={
<span
className="edit-post-keyboard-shortcut-help__title"
>
Keyboard Shortcuts
</span>
}
>
<ShortcutSection
key="0"
Expand All @@ -28,10 +34,6 @@ exports[`KeyboardShortcutHelpModal should match snapshot when the modal is activ
"description": "Save your changes.",
"key": "Ctrl+S",
},
Object {
"description": "Show or hide the settings sidebar.",
"key": "Ctrl+Shift+,",
},
Object {
"description": "Undo your last changes.",
"key": "Ctrl+Z",
Expand All @@ -40,6 +42,10 @@ exports[`KeyboardShortcutHelpModal should match snapshot when the modal is activ
"description": "Redo your last undo.",
"key": "Ctrl+Shift+Z",
},
Object {
"description": "Show or hide the settings sidebar.",
"key": "Ctrl+Shift+,",
},
Object {
"description": "Switch between Visual Editor and Code Editor.",
"key": "Ctrl+Shift+Alt+M",
Expand Down Expand Up @@ -101,11 +107,11 @@ exports[`KeyboardShortcutHelpModal should match snapshot when the modal is activ
"key": "Ctrl+U",
},
Object {
"description": "Convert the selected text into a link",
"description": "Convert the selected text into a link.",
"key": "Ctrl+K",
},
Object {
"description": "Remove a link",
"description": "Remove a link.",
"key": "Shift+Alt+S",
},
Object {
Expand Down

0 comments on commit fe8a15c

Please sign in to comment.