Skip to content

Commit

Permalink
Focus Mode: Use the symbol icon if a pattern is being edited (#52031)
Browse files Browse the repository at this point in the history
  • Loading branch information
carolinan authored and tellthemachines committed Jul 3, 2023
1 parent 7b8db97 commit ea6e8c5
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
chevronLeftSmall as chevronLeftSmallIcon,
page as pageIcon,
navigation as navigationIcon,
symbol,
} from '@wordpress/icons';
import { displayShortcut } from '@wordpress/keycodes';
import { useState, useEffect, useRef } from '@wordpress/element';
Expand Down Expand Up @@ -118,10 +119,17 @@ function TemplateDocumentActions( { className, onBack } ) {

const entityLabel = getEntityLabel( record.type );

let typeIcon = icon;
if ( record.type === 'wp_navigation' ) {
typeIcon = navigationIcon;
} else if ( record.type === 'wp_block' ) {
typeIcon = symbol;
}

return (
<BaseDocumentActions
className={ className }
icon={ record.type === 'wp_navigation' ? navigationIcon : icon }
icon={ typeIcon }
onBack={ onBack }
>
<VisuallyHidden as="span">
Expand Down

0 comments on commit ea6e8c5

Please sign in to comment.