woocommerce/plugins/woocommerce-blocks/assets/js/blocks/cart-checkout/cart/index.js

59 lines
1.1 KiB
JavaScript
Raw Normal View History

/**
* External dependencies
*/
import { __ } from '@wordpress/i18n';
import { InnerBlocks } from '@wordpress/block-editor';
import { Disabled } from '@wordpress/components';
import { registerBlockType } from '@wordpress/blocks';
/**
* Internal dependencies
*/
import Editor from './edit';
import { example } from './example';
import './style.scss';
/**
* Register and run the Cart block.
*/
registerBlockType( 'woocommerce/cart', {
title: __( 'Cart', 'woo-gutenberg-products-block' ),
icon: {
src: 'cart',
foreground: '#96588a',
},
category: 'woocommerce',
keywords: [ __( 'WooCommerce', 'woo-gutenberg-products-block' ) ],
description: __( 'Shopping cart.', 'woo-gutenberg-products-block' ),
supports: {
align: [ 'wide', 'full' ],
html: false,
},
example,
attributes: {},
/**
* Renders the edit view for a block.
*
* @param {Object} props Props to pass to block.
*/
edit( props ) {
return (
<Disabled>
<Editor { ...props } />
</Disabled>
);
},
/**
* Block content is rendered in PHP, not via save function.
*/
save() {
return (
<div className="is-loading">
<InnerBlocks.Content />
</div>
);
},
} );