Skip to content

Commit

Permalink
Use the keyboard shortcuts package for the title bar (#50873)
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad authored May 23, 2023
1 parent 58a22ce commit 97ab6b1
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
} from '@wordpress/components';
import { BlockIcon } from '@wordpress/block-editor';
import { privateApis as commandsPrivateApis } from '@wordpress/commands';
import { displayShortcut } from '@wordpress/keycodes';

/**
* Internal dependencies
Expand Down Expand Up @@ -43,8 +44,6 @@ export default function DocumentActions() {
? __( 'template part' )
: __( 'template' );

const isMac = /Mac|iPod|iPhone|iPad/.test( window.navigator.platform );

return (
<Button
className="edit-site-document-actions"
Expand All @@ -69,7 +68,7 @@ export default function DocumentActions() {
</Text>
</HStack>
<span className="edit-site-document-actions__shortcut">
{ isMac ? '⌘' : 'Ctrl' } K
{ displayShortcut.primary( 'k' ) }
</span>
</Button>
);
Expand Down

0 comments on commit 97ab6b1

Please sign in to comment.