Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Site editor: Add a navigable region for content area of Library and Template views #51782

Merged
merged 1 commit into from
Jun 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>
);
}