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

Update sidebar titles for Template and Page management data views #59011

Merged
merged 7 commits into from
Feb 26, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function TemplateDataviewItem( { template, isActive } ) {
export default function DataviewsTemplatesSidebarContent( {
activeView,
postType,
config,
title,
} ) {
const { records } = useEntityRecords( 'postType', postType, {
per_page: -1,
Expand All @@ -54,7 +54,7 @@ export default function DataviewsTemplatesSidebarContent( {
<ItemGroup>
<DataViewItem
slug={ 'all' }
title={ config[ postType ].title }
title={ title }
icon={ layout }
isActive={ activeView === 'all' }
isCustom="false"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,19 @@ import DataviewsTemplatesSidebarContent from './content';

const config = {
[ TEMPLATE_POST_TYPE ]: {
title: __( 'All templates' ),
title: __( 'Manage templates' ),
description: __(
'Create new templates, or reset any customizations made to the templates supplied by your theme.'
),
contentTitle: __( 'All templates' ),
},
[ TEMPLATE_PART_POST_TYPE ]: {
title: __( 'All template parts' ),
title: __( 'Manage template parts' ),
description: __(
'Create new template parts, or reset any customizations made to the template parts supplied by your theme.'
),
backPath: '/patterns',
contentTitle: __( 'All template parts' ),
},
};

Expand Down Expand Up @@ -62,7 +64,7 @@ export default function SidebarNavigationScreenTemplatesBrowse() {
<DataviewsTemplatesSidebarContent
activeView={ activeView }
postType={ postType }
config={ config }
title={ config[ postType ].contentTitle }
/>
}
/>
Expand Down
2 changes: 1 addition & 1 deletion packages/edit-site/src/components/sidebar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ function SidebarScreens() {
</SidebarScreenWrapper>
<SidebarScreenWrapper path="/pages">
<SidebarNavigationScreen
title={ __( 'Pages' ) }
title={ __( 'Manage pages' ) }
content={ <DataViewsSidebarContent /> }
backPath="/page"
/>
Expand Down
Loading