From 39b3c80af7618108eed0a448743d9a9eed136b82 Mon Sep 17 00:00:00 2001 From: karthick-murugan Date: Wed, 18 Dec 2024 11:57:33 +0530 Subject: [PATCH] feedback changes --- .../block-library/src/latest-posts/edit.js | 62 ++++++++++--------- .../src/latest-posts/editor.scss | 16 +++++ 2 files changed, 49 insertions(+), 29 deletions(-) diff --git a/packages/block-library/src/latest-posts/edit.js b/packages/block-library/src/latest-posts/edit.js index e75cc7adb95767..5c5a39033246f7 100644 --- a/packages/block-library/src/latest-posts/edit.js +++ b/packages/block-library/src/latest-posts/edit.js @@ -360,36 +360,40 @@ export default function LatestPostsEdit( { attributes, setAttributes } ) { /> { displayFeaturedImage && ( <> - { - const newAttrs = {}; - if ( value.hasOwnProperty( 'width' ) ) { - newAttrs.featuredImageSizeWidth = - value.width; - } - if ( value.hasOwnProperty( 'height' ) ) { - newAttrs.featuredImageSizeHeight = - value.height; +
+ { + const newAttrs = {}; + if ( value.hasOwnProperty( 'width' ) ) { + newAttrs.featuredImageSizeWidth = + value.width; + } + if ( + value.hasOwnProperty( 'height' ) + ) { + newAttrs.featuredImageSizeHeight = + value.height; + } + setAttributes( newAttrs ); + } } + slug={ featuredImageSizeSlug } + width={ featuredImageSizeWidth } + height={ featuredImageSizeHeight } + imageWidth={ defaultImageWidth } + imageHeight={ defaultImageHeight } + imageSizeOptions={ imageSizeOptions } + imageSizeHelp={ __( + 'Select the size of the source image.' + ) } + onChangeImage={ ( value ) => + setAttributes( { + featuredImageSizeSlug: value, + featuredImageSizeWidth: undefined, + featuredImageSizeHeight: undefined, + } ) } - setAttributes( newAttrs ); - } } - slug={ featuredImageSizeSlug } - width={ featuredImageSizeWidth } - height={ featuredImageSizeHeight } - imageWidth={ defaultImageWidth } - imageHeight={ defaultImageHeight } - imageSizeOptions={ imageSizeOptions } - imageSizeHelp={ __( - 'Select the size of the source image.' - ) } - onChangeImage={ ( value ) => - setAttributes( { - featuredImageSizeSlug: value, - featuredImageSizeWidth: undefined, - featuredImageSizeHeight: undefined, - } ) - } - /> + /> +
* { + margin-bottom: 20px; /* Optional: Ensures consistent spacing */ + margin-top: 8px; +} + +.latest-posts-image-size-control-wrapper .block-editor-image-size-control { + display: grid; + gap: 15px; +}