diff --git a/packages/block-library/src/cover/edit.native.js b/packages/block-library/src/cover/edit.native.js index 29e8a76b57e5f..e74dd7410f3b5 100644 --- a/packages/block-library/src/cover/edit.native.js +++ b/packages/block-library/src/cover/edit.native.js @@ -95,6 +95,7 @@ const Cover = ( { customOverlayColor, } = attributes; const CONTAINER_HEIGHT = minHeight || COVER_DEFAULT_HEIGHT; + const isImage = backgroundType === MEDIA_TYPE_IMAGE; const THEME_COLORS_COUNT = 4; const coverDefaultPalette = { @@ -160,7 +161,7 @@ const Cover = ( { requestImageUploadCancelDialog( id ); } else if ( shouldShowFailure ) { requestImageFailedRetryDialog( id ); - } else if ( backgroundType === MEDIA_TYPE_IMAGE && url ) { + } else if ( isImage && url ) { requestImageFullscreenPreview( url ); } }; @@ -207,7 +208,8 @@ const Cover = ( { }, // While we don't support theme colors we add a default bg color ! overlayColor.color && ! url ? backgroundColor : {}, - isParentSelected && + isImage && + isParentSelected && ! isUploadInProgress && ! didUploadFail && styles.overlaySelected, @@ -386,7 +388,8 @@ const Cover = ( { { controls } - { url && + { isImage && + url && openMediaOptionsRef.current && isParentSelected && ! isUploadInProgress &&