/** * External dependencies */ import { __ } from '@wordpress/i18n'; import { InspectorControls } from '@wordpress/block-editor'; import { Disabled, PanelBody, ToggleControl } from '@wordpress/components'; import PropTypes from 'prop-types'; import { withFeedbackPrompt } from '@woocommerce/block-hocs'; import ViewSwitcher from '@woocommerce/block-components/view-switcher'; import { SHIPPING_ENABLED } from '@woocommerce/block-settings'; import BlockErrorBoundary from '@woocommerce/base-components/block-error-boundary'; import { EditorProvider } from '@woocommerce/base-context'; /** * Internal dependencies */ import FullCart from './full-cart'; import EmptyCart from './empty-cart'; const BlockSettings = ( { attributes, setAttributes } ) => { const { isShippingCalculatorEnabled, isShippingCostHidden } = attributes; return ( setAttributes( { isShippingCalculatorEnabled: ! isShippingCalculatorEnabled, } ) } /> ); }; /** * Component to handle edit mode of "Cart Block". */ const CartEditor = ( { className, attributes, setAttributes } ) => { const { isShippingCalculatorEnabled, isShippingCostHidden } = attributes; return (
( <> { currentView === 'full' && ( <> { SHIPPING_ENABLED && ( ) } ) } ) } />
); }; CartEditor.propTypes = { className: PropTypes.string, }; export default withFeedbackPrompt( __( 'We are currently working on improving our cart and checkout blocks, providing merchants with the tools and customization options they need.', 'woo-gutenberg-products-block' ) )( CartEditor );