2019-12-03 14:12:46 +00:00
|
|
|
/**
|
|
|
|
* External dependencies
|
|
|
|
*/
|
|
|
|
import { __ } from '@wordpress/i18n';
|
|
|
|
import { registerBlockType } from '@wordpress/blocks';
|
2020-01-31 18:20:33 +00:00
|
|
|
import { Icon, card } from '@woocommerce/icons';
|
2020-03-19 10:39:04 +00:00
|
|
|
import classnames from 'classnames';
|
2019-12-03 14:12:46 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Internal dependencies
|
|
|
|
*/
|
|
|
|
import edit from './edit';
|
2020-03-05 13:06:47 +00:00
|
|
|
import blockAttributes from './attributes';
|
2019-12-06 13:18:55 +00:00
|
|
|
import './editor.scss';
|
2019-12-03 14:12:46 +00:00
|
|
|
|
2020-01-31 20:04:37 +00:00
|
|
|
const settings = {
|
2019-12-03 14:12:46 +00:00
|
|
|
title: __( 'Checkout', 'woo-gutenberg-products-block' ),
|
|
|
|
icon: {
|
2020-01-31 18:20:33 +00:00
|
|
|
src: <Icon srcElement={ card } />,
|
|
|
|
foreground: '#96588a',
|
2019-12-03 14:12:46 +00:00
|
|
|
},
|
|
|
|
category: 'woocommerce',
|
|
|
|
keywords: [ __( 'WooCommerce', 'woo-gutenberg-products-block' ) ],
|
|
|
|
description: __(
|
|
|
|
'Display the checkout experience for customers.',
|
|
|
|
'woo-gutenberg-products-block'
|
|
|
|
),
|
2019-12-16 13:27:17 +00:00
|
|
|
supports: {
|
|
|
|
align: [ 'wide', 'full' ],
|
|
|
|
html: false,
|
|
|
|
multiple: false,
|
|
|
|
},
|
2020-03-26 13:31:09 +00:00
|
|
|
example: {
|
2020-04-08 15:03:39 +00:00
|
|
|
attributes: {
|
|
|
|
isPreview: true,
|
|
|
|
},
|
2020-03-26 13:31:09 +00:00
|
|
|
},
|
2020-03-05 13:06:47 +00:00
|
|
|
attributes: blockAttributes,
|
2019-12-03 14:12:46 +00:00
|
|
|
edit,
|
|
|
|
/**
|
|
|
|
* Save the props to post content.
|
|
|
|
*/
|
|
|
|
save( { attributes } ) {
|
|
|
|
return (
|
2020-03-19 10:39:04 +00:00
|
|
|
<div
|
|
|
|
className={ classnames( 'is-loading', attributes.className ) }
|
|
|
|
/>
|
2019-12-03 14:12:46 +00:00
|
|
|
);
|
|
|
|
},
|
2020-01-31 20:04:37 +00:00
|
|
|
};
|
|
|
|
|
2020-04-20 14:55:59 +00:00
|
|
|
registerBlockType( 'woocommerce/checkout', settings );
|