2016-08-28 18:55:56 +05:30
|
|
|
import 'babel-polyfill';
|
|
|
|
|
|
|
|
import React from 'react';
|
|
|
|
import ReactDOM from 'react-dom';
|
2016-08-30 12:32:00 +05:30
|
|
|
import ReactDOMServer from 'react-dom/server';
|
2016-08-28 18:55:56 +05:30
|
|
|
|
|
|
|
import { IntlProvider } from 'react-intl';
|
|
|
|
|
2016-08-30 12:32:00 +05:30
|
|
|
import Register from 'emails/register';
|
|
|
|
|
|
|
|
const isCli = typeof window === 'undefined';
|
|
|
|
|
|
|
|
const App = ({type, payload = {}}) => (
|
2016-08-28 18:55:56 +05:30
|
|
|
<IntlProvider locale="en" messages={{}}>
|
2016-08-30 12:32:00 +05:30
|
|
|
{isCli
|
|
|
|
? (
|
|
|
|
<Register {...payload} />
|
|
|
|
) : (
|
|
|
|
<div>
|
|
|
|
Hello world
|
|
|
|
<Register {...payload} />
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
</IntlProvider>
|
2016-08-28 18:55:56 +05:30
|
|
|
);
|
2016-08-30 12:32:00 +05:30
|
|
|
|
|
|
|
if (isCli) {
|
|
|
|
module.exports = {
|
|
|
|
default: (props) =>
|
|
|
|
ReactDOMServer.renderToStaticMarkup(<App {...props} />)
|
|
|
|
};
|
|
|
|
} else {
|
|
|
|
ReactDOM.render(<App />, document.getElementById('app'));
|
|
|
|
}
|