This commit is contained in:
Albert Juhé Lluveras 2020-01-03 15:22:50 +01:00 committed by GitHub
parent 57a8f0303d
commit 892a56364c
2 changed files with 7 additions and 8 deletions

View File

@ -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>
); );

View File

@ -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>
);
}, },
/** /**