scratch-www/src/views/preview/preview.jsx

30 lines
1.1 KiB
React
Raw Normal View History

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');
const Page = require('../../components/page/www/page.jsx');
2018-02-20 17:04:45 -05:00
const render = require('../../lib/render.jsx');
const previewActions = require('../../redux/preview.js');
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
}