Skip to content

Commit

Permalink
Update sidebar titles for Template and Page management data views (#5…
Browse files Browse the repository at this point in the history
…9011)

* Update sidebar titles

* Template parts

* 'Pages' -> 'Manage pages'

* Fix dataview item title

---------

Co-authored-by: Tetsuaki Hamano <tetsuaki.hamano@gmail.com>
  • Loading branch information
2 people authored and getdave committed Feb 27, 2024
1 parent 698ec96 commit 3c1c03a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
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 /> }
/>
</SidebarScreenWrapper>
Expand Down

0 comments on commit 3c1c03a

Please sign in to comment.