2019-12-03 14:12:46 +00:00
|
|
|
/**
|
|
|
|
* External dependencies
|
|
|
|
*/
|
|
|
|
import { withRestApiHydration } from '@woocommerce/block-hocs';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Internal dependencies
|
|
|
|
*/
|
|
|
|
import Block from './block.js';
|
|
|
|
import renderFrontend from '../../../utils/render-frontend.js';
|
|
|
|
|
2020-03-04 15:13:38 +00:00
|
|
|
const getProps = ( el ) => {
|
2019-12-03 14:12:46 +00:00
|
|
|
return {
|
2019-12-16 22:13:41 +00:00
|
|
|
attributes: {
|
2020-03-04 15:13:38 +00:00
|
|
|
useShippingAsBilling: el.dataset.useShippingAsBilling !== 'false',
|
2019-12-16 22:13:41 +00:00
|
|
|
},
|
2019-12-03 14:12:46 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
renderFrontend(
|
|
|
|
'.wp-block-woocommerce-checkout',
|
|
|
|
withRestApiHydration( Block ),
|
|
|
|
getProps
|
|
|
|
);
|