Skip to content
This repository was archived by the owner on Feb 23, 2024. It is now read-only.

Commit d488d35

Browse files
Related Products: Move Notice block to the Inspector Control section (#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 <[email protected]> --------- Co-authored-by: Albert Juhé Lluveras <[email protected]>
1 parent 4205ba1 commit d488d35

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

assets/js/atomic/blocks/product-elements/related-products/edit.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,13 @@ import {
55
BLOCK_ATTRIBUTES,
66
INNER_BLOCKS_TEMPLATE,
77
} from '@woocommerce/blocks/product-query/variations';
8-
import { InnerBlocks, useBlockProps } from '@wordpress/block-editor';
8+
import {
9+
InnerBlocks,
10+
InspectorControls,
11+
useBlockProps,
12+
} from '@wordpress/block-editor';
913
import { InnerBlockTemplate } from '@wordpress/blocks';
10-
import { Disabled, Notice } from '@wordpress/components';
14+
import { Notice } from '@wordpress/components';
1115
import { __ } from '@wordpress/i18n';
1216

1317
/**
@@ -23,7 +27,7 @@ const Edit = () => {
2327

2428
return (
2529
<div { ...blockProps }>
26-
<Disabled>
30+
<InspectorControls>
2731
<Notice
2832
className={ 'wc-block-editor-related-products__notice' }
2933
status={ 'warning' }
@@ -36,7 +40,7 @@ const Edit = () => {
3640
) }
3741
</p>
3842
</Notice>
39-
</Disabled>
43+
</InspectorControls>
4044
<InnerBlocks template={ TEMPLATE } />
4145
</div>
4246
);
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
.wc-block-editor-related-products__notice {
2-
margin: 10px auto;
2+
margin: auto $gap $gap;
33
max-width: max-content;
44
}

0 commit comments

Comments
 (0)