Skip to content

Commit

Permalink
Block Switcher: The navigable menu should only wrap the menu elements
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed Oct 12, 2017
1 parent 0efd05e commit 5e5b8c0
Showing 1 changed file with 21 additions and 20 deletions.
41 changes: 21 additions & 20 deletions editor/block-switcher/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,31 +73,32 @@ function BlockSwitcher( { block, onTransform } ) {
);
} }
renderContent={ ( { onClose } ) => (
<NavigableMenu
className="editor-block-switcher__menu"
role="menu"
aria-label={ __( 'Block types' ) }
>
<div>
<span
className="editor-block-switcher__menu-title"
>
{ __( 'Transform into:' ) }
</span>
{ allowedBlocks.map( ( { name, title, icon } ) => (
<IconButton
key={ name }
onClick={ () => {
onTransform( block, name );
onClose();
} }
className="editor-block-switcher__menu-item"
icon={ icon }
role="menuitem"
>
{ title }
</IconButton>
) ) }
</NavigableMenu>
<NavigableMenu
role="menu"
aria-label={ __( 'Block types' ) }
>
{ allowedBlocks.map( ( { name, title, icon } ) => (
<IconButton
key={ name }
onClick={ () => {
onTransform( block, name );
onClose();
} }
className="editor-block-switcher__menu-item"
icon={ icon }
role="menuitem"
>
{ title }
</IconButton>
) ) }
</NavigableMenu>
</div>
) }
/>
);
Expand Down

0 comments on commit 5e5b8c0

Please sign in to comment.