Fix empty cart inner blocks disabled (https://github.com/woocommerce/woocommerce-blocks/pull/1447)
This commit is contained in:
parent
57a8f0303d
commit
892a56364c
|
@ -3,7 +3,7 @@
|
||||||
*/
|
*/
|
||||||
import { __ } from '@wordpress/i18n';
|
import { __ } from '@wordpress/i18n';
|
||||||
import { BlockControls } from '@wordpress/block-editor';
|
import { BlockControls } from '@wordpress/block-editor';
|
||||||
import { Toolbar } from '@wordpress/components';
|
import { Disabled, Toolbar } from '@wordpress/components';
|
||||||
import { useState } from '@wordpress/element';
|
import { useState } from '@wordpress/element';
|
||||||
import TextToolbarButton from '@woocommerce/block-components/text-toolbar-button';
|
import TextToolbarButton from '@woocommerce/block-components/text-toolbar-button';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
@ -49,7 +49,11 @@ const CartEditor = ( { className } ) => {
|
||||||
return (
|
return (
|
||||||
<div className={ className }>
|
<div className={ className }>
|
||||||
{ getBlockControls() }
|
{ getBlockControls() }
|
||||||
{ isFullCartMode && <FullCart /> }
|
{ isFullCartMode && (
|
||||||
|
<Disabled>
|
||||||
|
<FullCart />
|
||||||
|
</Disabled>
|
||||||
|
) }
|
||||||
<EmptyCart hidden={ isFullCartMode } />
|
<EmptyCart hidden={ isFullCartMode } />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
*/
|
*/
|
||||||
import { __ } from '@wordpress/i18n';
|
import { __ } from '@wordpress/i18n';
|
||||||
import { InnerBlocks } from '@wordpress/block-editor';
|
import { InnerBlocks } from '@wordpress/block-editor';
|
||||||
import { Disabled } from '@wordpress/components';
|
|
||||||
import { registerBlockType } from '@wordpress/blocks';
|
import { registerBlockType } from '@wordpress/blocks';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -39,11 +38,7 @@ registerBlockType( 'woocommerce/cart', {
|
||||||
* @param {Object} props Props to pass to block.
|
* @param {Object} props Props to pass to block.
|
||||||
*/
|
*/
|
||||||
edit( props ) {
|
edit( props ) {
|
||||||
return (
|
return <Editor { ...props } />;
|
||||||
<Disabled>
|
|
||||||
<Editor { ...props } />
|
|
||||||
</Disabled>
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue