Skip to content

Commit

Permalink
Mobile - Media & Text - Show replace media button for both Image and …
Browse files Browse the repository at this point in the history
…video
  • Loading branch information
Gerardo committed Apr 28, 2022
1 parent 192f99d commit 6e8d7df
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/block-library/src/media-text/edit.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,8 @@ class MediaTextEdit extends Component {
const widthString = `${ temporaryMediaWidth }%`;
const innerBlockWidth = shouldStack ? 100 : 100 - temporaryMediaWidth;
const innerBlockWidthString = `${ innerBlockWidth }%`;
const hasMedia =
mediaType === MEDIA_TYPE_IMAGE || mediaType === MEDIA_TYPE_VIDEO;

const innerBlockContainerStyle = [
{ width: innerBlockWidthString },
Expand Down Expand Up @@ -344,7 +346,7 @@ class MediaTextEdit extends Component {
<>
{ mediaType === MEDIA_TYPE_IMAGE && this.getControls() }
<BlockControls>
{ ( isMediaSelected || mediaType === MEDIA_TYPE_VIDEO ) && (
{ hasMedia && (
<ToolbarGroup>
<Button
label={ __( 'Edit media' ) }
Expand Down

0 comments on commit 6e8d7df

Please sign in to comment.