2018-06-26 14:49:42 +00:00
|
|
|
/** @format */
|
|
|
|
/**
|
|
|
|
* External dependencies
|
|
|
|
*/
|
|
|
|
import { render } from '@wordpress/element';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Internal dependencies
|
|
|
|
*/
|
2018-08-06 15:30:43 +00:00
|
|
|
import './stylesheets/_embedded.scss';
|
2019-05-22 17:53:30 +00:00
|
|
|
import { EmbedLayout, PrimaryLayout as NoticeArea } from './layout';
|
2019-07-10 16:58:51 +00:00
|
|
|
import 'store';
|
2018-12-06 22:08:40 +00:00
|
|
|
import 'wc-api/wp-data-store';
|
2018-06-26 14:49:42 +00:00
|
|
|
|
2019-05-23 09:29:14 +00:00
|
|
|
const embeddedRoot = document.getElementById( 'woocommerce-embedded-root' );
|
|
|
|
|
2019-05-22 17:53:30 +00:00
|
|
|
// Render the header.
|
2019-07-05 08:15:49 +00:00
|
|
|
render( <EmbedLayout />, embeddedRoot );
|
2019-05-22 17:53:30 +00:00
|
|
|
|
2019-05-23 09:29:14 +00:00
|
|
|
embeddedRoot.classList.remove( 'is-embed-loading' );
|
|
|
|
|
2019-05-22 17:53:30 +00:00
|
|
|
// Render notices just above the WP content div.
|
|
|
|
const wpBody = document.getElementById( 'wpbody-content' );
|
|
|
|
const wrap = wpBody.querySelector( '.wrap' );
|
|
|
|
const noticeContainer = document.createElement( 'div' );
|
|
|
|
|
|
|
|
render(
|
|
|
|
<div className="woocommerce-layout">
|
|
|
|
<NoticeArea />
|
|
|
|
</div>,
|
|
|
|
wpBody.insertBefore( noticeContainer, wrap )
|
|
|
|
);
|