2019-09-17 21:49:48 -04:00
|
|
|
const React = require('react');
|
2019-09-28 10:19:06 -04:00
|
|
|
const ErrorBoundary = require('../../components/errorboundary/errorboundary.jsx');
|
2019-09-17 21:49:48 -04:00
|
|
|
const render = require('../../lib/render.jsx');
|
|
|
|
|
2019-10-01 18:21:14 -04:00
|
|
|
// Require this even though we don't use it because, without it, webpack runs out of memory...
|
|
|
|
const Page = require('../../components/page/www/page.jsx'); // eslint-disable-line no-unused-vars
|
|
|
|
|
2019-09-17 21:49:48 -04:00
|
|
|
const previewActions = require('../../redux/preview.js');
|
|
|
|
|
|
|
|
const isSupportedBrowser = require('../../lib/supported-browser').default;
|
|
|
|
const UnsupportedBrowser = require('./unsupported-browser.jsx');
|
|
|
|
|
|
|
|
if (isSupportedBrowser()) {
|
|
|
|
const EmbedView = require('./embed-view.jsx');
|
|
|
|
render(
|
2019-10-11 16:25:19 -04:00
|
|
|
<ErrorBoundary componentName="EmbedView">
|
2019-10-10 13:15:35 -04:00
|
|
|
<EmbedView.View />
|
|
|
|
</ErrorBoundary>,
|
2019-09-17 21:49:48 -04:00
|
|
|
document.getElementById('app'),
|
|
|
|
{
|
|
|
|
preview: previewActions.previewReducer,
|
|
|
|
...EmbedView.guiReducers
|
|
|
|
},
|
|
|
|
{
|
|
|
|
locales: EmbedView.initLocale(EmbedView.localesInitialState, window._locale),
|
|
|
|
scratchGui: EmbedView.initGuiState(EmbedView.guiInitialState)
|
|
|
|
},
|
|
|
|
EmbedView.guiMiddleware
|
|
|
|
);
|
|
|
|
} else {
|
2019-10-09 22:30:59 -04:00
|
|
|
render(
|
2019-10-11 16:25:19 -04:00
|
|
|
<ErrorBoundary componentName="UnsupportedBrowser"><UnsupportedBrowser /></ErrorBoundary>,
|
2019-10-09 22:30:59 -04:00
|
|
|
document.getElementById('app')
|
|
|
|
);
|
2019-09-17 21:49:48 -04:00
|
|
|
}
|