From 6e8d7dff9745b408546040cd578f654732d215a0 Mon Sep 17 00:00:00 2001 From: Gerardo Date: Thu, 28 Apr 2022 13:52:46 +0200 Subject: [PATCH] Mobile - Media & Text - Show replace media button for both Image and video --- packages/block-library/src/media-text/edit.native.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/block-library/src/media-text/edit.native.js b/packages/block-library/src/media-text/edit.native.js index 530452eb63593c..3cb2c410520289 100644 --- a/packages/block-library/src/media-text/edit.native.js +++ b/packages/block-library/src/media-text/edit.native.js @@ -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 }, @@ -344,7 +346,7 @@ class MediaTextEdit extends Component { <> { mediaType === MEDIA_TYPE_IMAGE && this.getControls() } - { ( isMediaSelected || mediaType === MEDIA_TYPE_VIDEO ) && ( + { hasMedia && (