Skip to content

Commit

Permalink
Patterns: Fix sidebar tab label (#51953)
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronrobertshaw authored and tellthemachines committed Jul 3, 2023
1 parent b64bc8a commit 0702768
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 0702768

Please sign in to comment.