2020-03-27 20:42:58 +00:00
|
|
|
/**
|
|
|
|
* External dependencies
|
|
|
|
*/
|
|
|
|
import { render } from '@wordpress/element';
|
2020-04-16 23:58:36 +00:00
|
|
|
import { withPluginsHydration } from '@woocommerce/data';
|
|
|
|
|
2020-03-27 20:42:58 +00:00
|
|
|
/**
|
|
|
|
* Internal dependencies
|
|
|
|
*/
|
|
|
|
import ShippingBanner from './shipping-banner';
|
|
|
|
|
|
|
|
const metaBox = document.getElementById( 'wc-admin-shipping-banner-root' );
|
|
|
|
const args =
|
|
|
|
( metaBox.dataset.args && JSON.parse( metaBox.dataset.args ) ) || {};
|
|
|
|
|
|
|
|
// Render the header.
|
2020-07-28 02:32:58 +00:00
|
|
|
const HydratedShippingBanner = withPluginsHydration( {
|
|
|
|
...window.wcSettings.plugins,
|
|
|
|
jetpackStatus: window.wcSettings.dataEndpoints.jetpackStatus,
|
|
|
|
} )( ShippingBanner );
|
2020-08-31 15:13:14 +00:00
|
|
|
render( <HydratedShippingBanner itemsCount={ args.items } />, metaBox );
|