2018-06-16 18:19:31 -04:00
|
|
|
// preview view can show either project page or editor page;
|
|
|
|
// idea is that we shouldn't require a page reload to switch back and forth
|
2018-02-20 17:04:45 -05:00
|
|
|
const React = require('react');
|
2018-03-08 15:57:19 -05:00
|
|
|
const Page = require('../../components/page/www/page.jsx');
|
2018-02-20 17:04:45 -05:00
|
|
|
const render = require('../../lib/render.jsx');
|
2018-03-08 15:57:19 -05:00
|
|
|
|
2018-03-14 15:50:27 -04:00
|
|
|
const previewActions = require('../../redux/preview.js');
|
2018-05-24 16:23:07 -04:00
|
|
|
|
2018-11-21 17:34:10 -05:00
|
|
|
const isSupportedBrowser = require('../../lib/supported-browser').default;
|
|
|
|
const UnsupportedBrowser = require('./unsupported-browser.jsx');
|
|
|
|
|
|
|
|
if (isSupportedBrowser()) {
|
|
|
|
const ProjectView = require('./project-view.jsx');
|
|
|
|
render(
|
|
|
|
<ProjectView.View />,
|
|
|
|
document.getElementById('app'),
|
|
|
|
{
|
|
|
|
preview: previewActions.previewReducer,
|
|
|
|
...ProjectView.guiReducers
|
|
|
|
},
|
|
|
|
{
|
|
|
|
locales: ProjectView.initLocale(ProjectView.localesInitialState, window._locale),
|
|
|
|
scratchGui: ProjectView.initGuiState(ProjectView.guiInitialState)
|
|
|
|
},
|
|
|
|
ProjectView.guiMiddleware
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
render(<Page><UnsupportedBrowser /></Page>, document.getElementById('app'));
|
2018-11-17 23:59:41 -05:00
|
|
|
}
|