Skip to content

Commit

Permalink
Fix bug with wrong icon and highlight showing for theme templates on …
Browse files Browse the repository at this point in the history
…template swap modal (#56538)
  • Loading branch information
glendaviesnz authored Nov 28, 2023
1 parent bd6767b commit a3dd66a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
25 changes: 14 additions & 11 deletions packages/block-editor/src/components/block-patterns-list/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ function BlockPattern( {
} }
>
<WithToolTip
showTooltip={ showTooltip && ! pattern.id }
showTooltip={ showTooltip && ! pattern.type === 'user' }
title={ pattern.title }
>
<CompositeItem
Expand All @@ -82,7 +82,8 @@ function BlockPattern( {
'block-editor-block-patterns-list__item',
{
'block-editor-block-patterns-list__list-item-synced':
pattern.id && ! pattern.syncStatus,
pattern.type === 'user' &&
! pattern.syncStatus,
}
) }
onClick={ () => {
Expand All @@ -107,15 +108,17 @@ function BlockPattern( {
/>

<HStack className="block-editor-patterns__pattern-details">
{ pattern.id && ! pattern.syncStatus && (
<div className="block-editor-patterns__pattern-icon-wrapper">
<Icon
className="block-editor-patterns__pattern-icon"
icon={ symbol }
/>
</div>
) }
{ ( ! showTooltip || pattern.id ) && (
{ pattern.type === 'user' &&
! pattern.syncStatus && (
<div className="block-editor-patterns__pattern-icon-wrapper">
<Icon
className="block-editor-patterns__pattern-icon"
icon={ symbol }
/>
</div>
) }
{ ( ! showTooltip ||
pattern.type === 'user' ) && (
<div className="block-editor-block-patterns-list__item-title">
{ pattern.title }
</div>
Expand Down
1 change: 1 addition & 0 deletions packages/block-editor/src/store/selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -2304,6 +2304,7 @@ function getUserPatterns( state ) {
return {
name: `core/block/${ userPattern.id }`,
id: userPattern.id,
type: 'user',
title: userPattern.title.raw,
categories: userPattern.wp_pattern_category.map( ( catId ) =>
categories && categories.get( catId )
Expand Down

0 comments on commit a3dd66a

Please sign in to comment.