Skip to content

Commit

Permalink
Site editor: Add a navigable region for content area of Library and T…
Browse files Browse the repository at this point in the history
…emplate views (#51782)
  • Loading branch information
talldan authored Jun 23, 2023
1 parent 1cdf6df commit b2a7941
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
7 changes: 6 additions & 1 deletion packages/edit-site/src/components/page-library/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/**
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n';
import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
import { getQueryArgs } from '@wordpress/url';

Expand All @@ -26,7 +27,11 @@ export default function PageLibrary() {
// from the site editor store to the block editor store.
return (
<ExperimentalBlockEditorProvider settings={ settings }>
<Page className="edit-site-library">
<Page
className="edit-site-library"
title={ __( 'Library content' ) }
hideTitleFromUI
>
<PatternsList type={ type } categoryId={ category } />
</Page>
</ExperimentalBlockEditorProvider>
Expand Down
12 changes: 9 additions & 3 deletions packages/edit-site/src/components/page/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
*/
import classnames from 'classnames';

/**
* WordPress dependencies
*/
import { NavigableRegion } from '@wordpress/interface';

/**
* Internal dependencies
*/
Expand All @@ -14,19 +19,20 @@ export default function Page( {
actions,
children,
className,
hideTitleFromUI = false,
} ) {
const classes = classnames( 'edit-site-page', className );

return (
<div className={ classes }>
{ title && (
<NavigableRegion className={ classes } ariaLabel={ title }>
{ ! hideTitleFromUI && title && (
<Header
title={ title }
subTitle={ subTitle }
actions={ actions }
/>
) }
<div className="edit-site-page-content">{ children }</div>
</div>
</NavigableRegion>
);
}

0 comments on commit b2a7941

Please sign in to comment.