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

Commit 740cedf

Browse files
authored
Fix "Product Price" block margin on the "All products" block (#8518)
* Only use margin for the feature plugin * Return empty style if no support for spacing styling
1 parent fc88c49 commit 740cedf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

assets/js/base/hooks/use-spacing-props.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
* External dependencies
44
*/
55
import { __experimentalGetSpacingClassesAndStyles } from '@wordpress/block-editor';
6-
import { isFeaturePluginBuild } from '@woocommerce/block-settings';
76
import { isObject } from '@woocommerce/types';
87
import { parseStyle } from '@woocommerce/base-utils';
98

@@ -14,11 +13,12 @@ type WithStyle = {
1413
// @todo The @wordpress/block-editor dependency should never be used on the frontend of the store due to excessive side and its dependency on @wordpress/components
1514
// @see https://github.com/woocommerce/woocommerce-blocks/issues/8071
1615
export const useSpacingProps = ( attributes: unknown ): WithStyle => {
17-
if ( ! isFeaturePluginBuild() ) {
16+
if ( typeof __experimentalGetSpacingClassesAndStyles !== 'function' ) {
1817
return {
1918
style: {},
2019
};
2120
}
21+
2222
const attributesObject = isObject( attributes ) ? attributes : {};
2323
const style = parseStyle( attributesObject.style );
2424

0 commit comments

Comments
 (0)