Skip to content

Commit

Permalink
Move the label to the list
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed Oct 24, 2019
1 parent afdda38 commit 6d1268a
Showing 1 changed file with 32 additions and 34 deletions.
66 changes: 32 additions & 34 deletions packages/block-editor/src/components/block-breadcrumb/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,41 +37,39 @@ const BlockBreadcrumb = function() {
*/
/* eslint-disable jsx-a11y/no-redundant-roles */
return (
<nav aria-label={ __( 'Block breadcrumb' ) }>
<ul className="block-editor-block-breadcrumb" role="list">
<li
className={ ! hasSelection ? 'block-editor-block-breadcrumb__current' : undefined }
aria-current={ ! hasSelection ? 'true' : undefined }
>
{ hasSelection && (
<Button
className="block-editor-block-breadcrumb__button"
isTertiary
onClick={ clearSelectedBlock }
>
{ __( 'Document' ) }
</Button>
) }
{ ! hasSelection && __( 'Document' ) }
</li>
{ parents.map( ( parentClientId ) => (
<li key={ parentClientId }>
<Button
className="block-editor-block-breadcrumb__button"
isTertiary
onClick={ () => selectBlock( parentClientId ) }
>
<BlockTitle clientId={ parentClientId } />
</Button>
</li>
) ) }
{ !! clientId && (
<li className="block-editor-block-breadcrumb__current" aria-current="true">
<BlockTitle clientId={ clientId } />
</li>
<ul className="block-editor-block-breadcrumb" role="list" aria-label={ __( 'Block breadcrumb' ) }>
<li
className={ ! hasSelection ? 'block-editor-block-breadcrumb__current' : undefined }
aria-current={ ! hasSelection ? 'true' : undefined }
>
{ hasSelection && (
<Button
className="block-editor-block-breadcrumb__button"
isTertiary
onClick={ clearSelectedBlock }
>
{ __( 'Document' ) }
</Button>
) }
</ul>
</nav>
{ ! hasSelection && __( 'Document' ) }
</li>
{ parents.map( ( parentClientId ) => (
<li key={ parentClientId }>
<Button
className="block-editor-block-breadcrumb__button"
isTertiary
onClick={ () => selectBlock( parentClientId ) }
>
<BlockTitle clientId={ parentClientId } />
</Button>
</li>
) ) }
{ !! clientId && (
<li className="block-editor-block-breadcrumb__current" aria-current="true">
<BlockTitle clientId={ clientId } />
</li>
) }
</ul>
/* eslint-enable jsx-a11y/no-redundant-roles */
);
};
Expand Down

0 comments on commit 6d1268a

Please sign in to comment.