Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function KeyboardShortcutsHelpMenuItem( { openModal } ) {
return (
<menuitem> {
openModal( 'edit-post/keyboard-shortcut-help' );
} }
shortcut={ displayShortcut.access( 'h' ) }
>
{ __( 'Keyboard Shortcuts' ) }
</menuitem>
);
}
renderToggle={ ( { isOpen, onToggle } ) => (
<>
{ isEnabled &&
}
<button aria-disabled="{" label="{" aria-expanded="{">
) }
renderContent={ ( { onClose } ) => (</button>
export function KeyboardShortcutsHelpMenuItem( { openModal, onSelect } ) {
return (
<menuitem> {
onSelect();
openModal( 'edit-post/keyboard-shortcut-help' );
} }
shortcut={ displayShortcut.access( 'h' ) }
>
{ __( 'Keyboard Shortcuts' ) }
</menuitem>
);
}
{
icon: 'editor-italic',
title: __( 'Italic' ),
shortcut: displayShortcut.primary( 'i' ),
format: 'italic',
},
{
icon: 'admin-links',
title: __( 'Link' ),
shortcut: displayShortcut.primary( 'k' ),
format: 'link',
},
{
icon: 'editor-strikethrough',
title: __( 'Strikethrough' ),
shortcut: displayShortcut.access( 'd' ),
format: 'strikethrough',
},
];