Skip to content

Commit

Permalink
remove conversion to cover block if image in gallery
Browse files Browse the repository at this point in the history
  • Loading branch information
Glen Davies committed Mar 9, 2021
1 parent 75c5165 commit 4bb8dfa
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions packages/block-library/src/image/image.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ export default function Image( {
allowResize = true,
linkTo: parentLinkDestination,
sizeSlug: parentSizeSlug,
isGrouped,
} = context;
const { block, currentId, image, multiImageSelection } = useSelect(
( select ) => {
Expand Down Expand Up @@ -360,18 +361,20 @@ export default function Image( {
label={ __( 'Upload external image' ) }
/>
) }
{ ! multiImageSelection && coverBlockExists && (
<ToolbarButton
icon={ overlayText }
label={ __( 'Add text over image' ) }
onClick={ () =>
replaceBlocks(
currentId,
switchToBlockType( block, 'core/cover' )
)
}
/>
) }
{ ! isGrouped &&
! multiImageSelection &&
coverBlockExists && (
<ToolbarButton
icon={ overlayText }
label={ __( 'Add text over image' ) }
onClick={ () =>
replaceBlocks(
currentId,
switchToBlockType( block, 'core/cover' )
)
}
/>
) }
</ToolbarGroup>
{ ! multiImageSelection && ! isEditingImage && (
<MediaReplaceFlow
Expand Down

0 comments on commit 4bb8dfa

Please sign in to comment.