Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
} = attributes;
const isGradientAvailable = !! getGradientClass;
const textColorClass = getColorClassName( 'color', textColor );
const fontSizeClass = getFontSizeClass( fontSize );
const borderClass = getColorClassName( 'border-color', borderColor );
const buttonBackgroundClass = getColorClassName( 'background-color', buttonBackgroundColor );
const buttonGradientClass = isGradientAvailable ? getGradientClass( buttonGradient ) : undefined;
const emailFieldBackgroundClass = getColorClassName(
'background-color',
emailFieldBackgroundColor
);
const emailFieldGradientClass = isGradientAvailable
? getGradientClass( emailFieldGradient )
: undefined;
const sharedClasses = classnames(
borderRadius === 0 ? 'no-border-radius' : undefined,
fontSizeClass,
borderClass
);
const submitButtonClasses = classnames(
sharedClasses,
textColor ? 'has-text-color' : undefined,
textColorClass,
buttonBackgroundColor || buttonGradient ? 'has-background' : undefined,
buttonBackgroundClass,
buttonGradientClass
);
customFontSize,
borderRadius,
borderWeight,
borderColor,
customBorderColor,
padding,
spacing,
} = attributes;
const isGradientAvailable = !! getGradientClass;
const textColorClass = getColorClassName( 'color', textColor );
const fontSizeClass = getFontSizeClass( fontSize );
const borderClass = getColorClassName( 'border-color', borderColor );
const buttonBackgroundClass = getColorClassName( 'background-color', buttonBackgroundColor );
const buttonGradientClass = isGradientAvailable ? getGradientClass( buttonGradient ) : undefined;
const emailFieldBackgroundClass = getColorClassName(
'background-color',
emailFieldBackgroundColor
);
const emailFieldGradientClass = isGradientAvailable
? getGradientClass( emailFieldGradient )
: undefined;
const sharedClasses = classnames(
borderRadius === 0 ? 'no-border-radius' : undefined,
fontSizeClass,
borderClass
);
const submitButtonClasses = classnames(
save( { attributes } ) {
const {
backgroundType,
gradient,
customGradient,
customOverlayColor,
dimRatio,
focalPoint,
hasParallax,
overlayColor,
url,
minHeight,
} = attributes;
const overlayColorClass = getColorClassName( 'background-color', overlayColor );
const gradientClass = __experimentalGetGradientClass( gradient );
const style = backgroundType === IMAGE_BACKGROUND_TYPE ?
backgroundImageStyles( url ) :
{};
if ( ! overlayColorClass ) {
style.backgroundColor = customOverlayColor;
}
if ( focalPoint && ! hasParallax ) {
style.backgroundPosition = `${ focalPoint.x * 100 }% ${ focalPoint.y * 100 }%`;
}
if ( customGradient && ! url ) {
style.background = customGradient;
}
style.minHeight = minHeight || undefined;
const classes = classnames(