Related Products: Move Notice block to the Inspector Control section (https://github.com/woocommerce/woocommerce-blocks/pull/8843)
* Add Notice component to the Inspector Controls section of the Related Products block * Change margin css attribute to use the short syntax Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com> --------- Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
This commit is contained in:
parent
91eb482e17
commit
22a9a479ae
|
@ -5,9 +5,13 @@ import {
|
||||||
BLOCK_ATTRIBUTES,
|
BLOCK_ATTRIBUTES,
|
||||||
INNER_BLOCKS_TEMPLATE,
|
INNER_BLOCKS_TEMPLATE,
|
||||||
} from '@woocommerce/blocks/product-query/variations';
|
} from '@woocommerce/blocks/product-query/variations';
|
||||||
import { InnerBlocks, useBlockProps } from '@wordpress/block-editor';
|
import {
|
||||||
|
InnerBlocks,
|
||||||
|
InspectorControls,
|
||||||
|
useBlockProps,
|
||||||
|
} from '@wordpress/block-editor';
|
||||||
import { InnerBlockTemplate } from '@wordpress/blocks';
|
import { InnerBlockTemplate } from '@wordpress/blocks';
|
||||||
import { Disabled, Notice } from '@wordpress/components';
|
import { Notice } from '@wordpress/components';
|
||||||
import { __ } from '@wordpress/i18n';
|
import { __ } from '@wordpress/i18n';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -23,7 +27,7 @@ const Edit = () => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div { ...blockProps }>
|
<div { ...blockProps }>
|
||||||
<Disabled>
|
<InspectorControls>
|
||||||
<Notice
|
<Notice
|
||||||
className={ 'wc-block-editor-related-products__notice' }
|
className={ 'wc-block-editor-related-products__notice' }
|
||||||
status={ 'warning' }
|
status={ 'warning' }
|
||||||
|
@ -36,7 +40,7 @@ const Edit = () => {
|
||||||
) }
|
) }
|
||||||
</p>
|
</p>
|
||||||
</Notice>
|
</Notice>
|
||||||
</Disabled>
|
</InspectorControls>
|
||||||
<InnerBlocks template={ TEMPLATE } />
|
<InnerBlocks template={ TEMPLATE } />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
.wc-block-editor-related-products__notice {
|
.wc-block-editor-related-products__notice {
|
||||||
margin: 10px auto;
|
margin: auto $gap $gap;
|
||||||
max-width: max-content;
|
max-width: max-content;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue