From 56a6ac3382cebb025a7905903d6286fc92aaf6a5 Mon Sep 17 00:00:00 2001 From: Staci Cooper Date: Mon, 18 Oct 2021 14:32:24 -0700 Subject: [PATCH] Linting --- .../components/global-styles/border-panel.js | 31 +++++++++---------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/packages/edit-site/src/components/global-styles/border-panel.js b/packages/edit-site/src/components/global-styles/border-panel.js index f765488766860..23cdaa88b7b0e 100644 --- a/packages/edit-site/src/components/global-styles/border-panel.js +++ b/packages/edit-site/src/components/global-styles/border-panel.js @@ -72,11 +72,10 @@ export default function BorderPanel( { name } ) { // To better reflect if the user has customized a value we need to // ensure the style value being checked is from the `user` origin. const [ userBorderStyles ] = useStyle( 'border', name, 'user' ); - const createHasValueCallback = ( feature ) => () => + const createHasValueCallback = ( feature ) => () => !! userBorderStyles?.[ feature ]; - const createResetCallback = ( setStyle ) => () => - setStyle( undefined ); + const createResetCallback = ( setStyle ) => () => setStyle( undefined ); const handleOnChange = ( setStyle ) => ( value ) => { setStyle( value || undefined ); @@ -115,19 +114,19 @@ export default function BorderPanel( { name } ) { name ); const hasBorderRadius = () => { - const borderValues = userBorderStyles?.[ 'radius' ]; + const borderValues = userBorderStyles?.radius; if ( typeof borderValues === 'object' ) { return Object.entries( borderValues ).some( Boolean ); } return !! borderValues; - } + }; const resetAll = () => { setBorderColor( undefined ); setBorderRadius( undefined ); setBorderStyle( undefined ); setBorderWidth( undefined ); - } + }; return ( @@ -138,16 +137,16 @@ export default function BorderPanel( { name } ) { label={ __( 'Width' ) } onDeselect={ createResetCallback( setBorderWidth ) } isShownByDefault={ true } - > - - - )} + > + + + ) } { showBorderStyle && (