responsively-app/desktop-app/app/index.js

38 lines
1 KiB
JavaScript
Raw Normal View History

2019-09-08 14:13:18 +00:00
require('dotenv').config();
2019-08-10 02:47:13 +00:00
import React from 'react';
2019-09-05 17:29:33 +00:00
import {remote} from 'electron';
2019-08-27 16:58:05 +00:00
import {render} from 'react-dom';
import {AppContainer} from 'react-hot-loader';
2019-08-10 02:47:13 +00:00
import Root from './containers/Root';
2019-08-27 16:58:05 +00:00
import {configureStore, history} from './store/configureStore';
2019-08-10 02:47:13 +00:00
import './app.global.css';
2019-09-05 17:29:33 +00:00
import * as Sentry from '@sentry/electron';
2019-08-10 02:47:13 +00:00
if (remote.getGlobal('process').env.NODE_ENV !== 'development') {
2020-03-14 08:05:02 +00:00
Sentry.init({
dsn: 'https://f2cdbc6a88aa4a068a738d4e4cfd3e12@sentry.io/1553155',
environment: remote.getGlobal('process').env.NODE_ENV,
});
}
2019-08-10 02:47:13 +00:00
const store = configureStore();
render(
2020-03-14 08:05:02 +00:00
<AppContainer>
<Root store={store} history={history} />
</AppContainer>,
document.getElementById('root')
2019-08-10 02:47:13 +00:00
);
if (module.hot) {
2020-03-14 08:05:02 +00:00
module.hot.accept('./containers/Root', () => {
// eslint-disable-next-line global-require
const NextRoot = require('./containers/Root').default;
render(
<AppContainer>
<NextRoot store={store} history={history} />
</AppContainer>,
document.getElementById('root')
);
});
2019-08-10 02:47:13 +00:00
}