diff --git a/web/app/themes/badegg/resources/js/blocks/components/BlockSettings.jsx b/web/app/themes/badegg/resources/js/blocks/components/BlockSettings.jsx index fa7b3d9e..919f6bdf 100644 --- a/web/app/themes/badegg/resources/js/blocks/components/BlockSettings.jsx +++ b/web/app/themes/badegg/resources/js/blocks/components/BlockSettings.jsx @@ -150,33 +150,38 @@ export default function BlockSettings({ attributes, setAttributes }) { slug = selected.slug; } - setAttributes( { + let colourAttributes = { background_colour: slug, background_hex: hex, - }); + }; + + if(!slug || [0, '0', 'white', 'black'].includes(slug)) { + colourAttributes.background_tint = '0'; + } + + setAttributes( colourAttributes ); } } /> { 'background_colour' in attributes && attributes.background_colour && ![0, '0', 'white', 'black'].includes(attributes.background_colour) ? ( - <> - setAttributes({ background_tint: value }) } - __next40pxDefaultSize={ true } - __nextHasNoMarginBottom={ true } - /> - setAttributes({ background_contrast: value }) } - __nextHasNoMarginBottom - /> - + setAttributes({ background_tint: value }) } + __next40pxDefaultSize={ true } + __nextHasNoMarginBottom={ true } + /> ) : null } + setAttributes({ background_contrast: value }) } + __nextHasNoMarginBottom + /> + { background_image != 0 && ( <>