From 5e4f87b1f482c1f14665a28e906fccc81281aab0 Mon Sep 17 00:00:00 2001 From: Nik Tsekouras Date: Thu, 13 Jan 2022 14:07:52 +0200 Subject: [PATCH] [Block Library - Post Featured Image]: Show all the controls when inside a Query Loop (#37945) --- .../src/post-featured-image/edit.js | 48 +++++++++++-------- 1 file changed, 29 insertions(+), 19 deletions(-) diff --git a/packages/block-library/src/post-featured-image/edit.js b/packages/block-library/src/post-featured-image/edit.js index 6d38eb17f79b15..ed84d7b95a1804 100644 --- a/packages/block-library/src/post-featured-image/edit.js +++ b/packages/block-library/src/post-featured-image/edit.js @@ -92,9 +92,36 @@ function PostFeaturedImageDisplay( { createErrorNotice( message[ 2 ], { type: 'snackbar' } ); }; + const controls = ( + <> + + + + setAttributes( { isLink: ! isLink } ) } + checked={ isLink } + /> + + + + ); let image; if ( ! featuredImage && isDescendentOfQueryLoop ) { - return
{ placeholderChip }
; + return ( + <> + { controls } +
{ placeholderChip }
+ + ); } const label = __( 'Add a featured image' ); @@ -138,24 +165,7 @@ function PostFeaturedImageDisplay( { return ( <> - - - - setAttributes( { isLink: ! isLink } ) } - checked={ isLink } - /> - - + { controls } { !! media && ! isDescendentOfQueryLoop && (