From 6a20f2180cb75441c596b0ac49347c6dec2170a0 Mon Sep 17 00:00:00 2001
From: Rinkal Pagdar <92097119+rinkalpagdar@users.noreply.github.com>
Date: Fri, 14 Feb 2025 11:49:39 +0530
Subject: [PATCH 1/2] Enable fix background image for use featured image
---
packages/block-library/src/cover/edit/inspector-controls.js | 2 --
1 file changed, 2 deletions(-)
diff --git a/packages/block-library/src/cover/edit/inspector-controls.js b/packages/block-library/src/cover/edit/inspector-controls.js
index bca844a9b4cedc..0019bc778330a8 100644
--- a/packages/block-library/src/cover/edit/inspector-controls.js
+++ b/packages/block-library/src/cover/edit/inspector-controls.js
@@ -189,7 +189,6 @@ export default function CoverInspectorControls( {
return (
<>
- { !! url && (
{
@@ -317,7 +316,6 @@ export default function CoverInspectorControls( {
/>
) }
- ) }
{ colorGradientSettings.hasColorsOrGradients && (
From f4751b38d5e59e0f1bf689f2829fee0b9688fb14 Mon Sep 17 00:00:00 2001
From: Rinkal Pagdar <92097119+rinkalpagdar@users.noreply.github.com>
Date: Fri, 14 Feb 2025 12:51:57 +0530
Subject: [PATCH 2/2] Linting Fixed
---
.../src/cover/edit/inspector-controls.js | 210 +++++++++---------
1 file changed, 103 insertions(+), 107 deletions(-)
diff --git a/packages/block-library/src/cover/edit/inspector-controls.js b/packages/block-library/src/cover/edit/inspector-controls.js
index 0019bc778330a8..f34d506415da02 100644
--- a/packages/block-library/src/cover/edit/inspector-controls.js
+++ b/packages/block-library/src/cover/edit/inspector-controls.js
@@ -189,133 +189,129 @@ export default function CoverInspectorControls( {
return (
<>
- {
- setAttributes( {
- hasParallax: false,
- focalPoint: undefined,
- isRepeated: false,
- alt: '',
- sizeSlug: undefined,
- } );
- } }
- dropdownMenuProps={ dropdownMenuProps }
- >
- { isImageBackground && (
- <>
- hasParallax }
- onDeselect={ () =>
- setAttributes( {
- hasParallax: false,
- focalPoint: undefined,
- } )
- }
- >
-
-
-
- isRepeated }
- onDeselect={ () =>
- setAttributes( {
- isRepeated: false,
- } )
- }
- >
-
-
- >
- ) }
- { showFocalPointPicker && (
+ {
+ setAttributes( {
+ hasParallax: false,
+ focalPoint: undefined,
+ isRepeated: false,
+ alt: '',
+ sizeSlug: undefined,
+ } );
+ } }
+ dropdownMenuProps={ dropdownMenuProps }
+ >
+ { isImageBackground && (
+ <>
!! focalPoint }
+ hasValue={ () => hasParallax }
onDeselect={ () =>
setAttributes( {
+ hasParallax: false,
focalPoint: undefined,
} )
}
>
-
- setAttributes( {
- focalPoint: newFocalPoint,
- } )
- }
+ label={ __( 'Fixed background' ) }
+ checked={ hasParallax }
+ onChange={ toggleParallax }
/>
- ) }
- { ! useFeaturedImage && url && ! isVideoBackground && (
+
!! alt }
+ hasValue={ () => isRepeated }
onDeselect={ () =>
- setAttributes( { alt: '' } )
+ setAttributes( {
+ isRepeated: false,
+ } )
}
>
-
- setAttributes( { alt: newAlt } )
- }
- help={
- <>
-
- { __(
- 'Describe the purpose of the image.'
- ) }
-
-
- { __(
- 'Leave empty if decorative.'
- ) }
- >
- }
+ label={ __( 'Repeated background' ) }
+ checked={ isRepeated }
+ onChange={ toggleIsRepeated }
/>
- ) }
- { !! imageSizeOptions?.length && (
-
+ ) }
+ { showFocalPointPicker && (
+ !! focalPoint }
+ onDeselect={ () =>
+ setAttributes( {
+ focalPoint: undefined,
+ } )
+ }
+ >
+
+ setAttributes( {
+ focalPoint: newFocalPoint,
+ } )
+ }
/>
- ) }
-
+
+ ) }
+ { ! useFeaturedImage && url && ! isVideoBackground && (
+ !! alt }
+ onDeselect={ () => setAttributes( { alt: '' } ) }
+ >
+
+ setAttributes( { alt: newAlt } )
+ }
+ help={
+ <>
+
+ { __(
+ 'Describe the purpose of the image.'
+ ) }
+
+
+ { __( 'Leave empty if decorative.' ) }
+ >
+ }
+ />
+
+ ) }
+ { !! imageSizeOptions?.length && (
+
+ ) }
+
{ colorGradientSettings.hasColorsOrGradients && (