Skip to content

Commit

Permalink
Patterns: Fix sidebar tab label
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronrobertshaw committed Jun 28, 2023
1 parent 52d1b8d commit ce09420
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ import { STORE_NAME } from '../../../store/constants';
import { SIDEBAR_BLOCK, SIDEBAR_TEMPLATE } from '../constants';
import { store as editSiteStore } from '../../../store';

const entityLabels = {
wp_navigation: __( 'Navigation' ),
wp_block: __( 'Pattern' ),
wp_template: __( 'Template' ),
};

const SettingsHeader = ( { sidebarName } ) => {
const { hasPageContentFocus, entityType } = useSelect( ( select ) => {
const { getEditedPostType, hasPageContentFocus: _hasPageContentFocus } =
Expand All @@ -29,8 +35,7 @@ const SettingsHeader = ( { sidebarName } ) => {
};
} );

const entityLabel =
entityType === 'wp_navigation' ? __( 'Navigation' ) : __( 'Template' );
const entityLabel = entityLabels[ entityType ] || entityLabels.wp_template;

const { enableComplementaryArea } = useDispatch( interfaceStore );
const openTemplateSettings = () =>
Expand Down

0 comments on commit ce09420

Please sign in to comment.