-
Notifications
You must be signed in to change notification settings - Fork 143
Expand file tree
/
Copy pathApplication.jsx
More file actions
54 lines (45 loc) · 1.23 KB
/
Application.jsx
File metadata and controls
54 lines (45 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import React from 'react';
import {Provider} from 'react-redux';
import bowser from 'bowser';
import createApplicationStore from '../createApplicationStore';
import {ErrorBoundary, includeStoreInBugReports} from '../util/bugsnag';
import supportedBrowsers from '../../config/browsers.json';
import Workspace from '../containers/Workspace';
import BrowserError from './BrowserError';
import IEBrowserError from './IEBrowserError';
class Application extends React.Component {
constructor() {
super();
const store = createApplicationStore();
this.state = {store};
includeStoreInBugReports(store);
}
_isIEOrEdge() {
return (bowser.msie || bowser.msedge);
}
_isUnsupportedBrowser() {
return bowser.isUnsupportedBrowser(
supportedBrowsers,
true,
window.navigator.userAgent,
);
}
render() {
if (this._isIEOrEdge()) {
return <IEBrowserError />;
}
if (this._isUnsupportedBrowser()) {
return <BrowserError browser={bowser} />;
}
return (
<React.StrictMode>
<ErrorBoundary>
<Provider store={this.state.store}>
<Workspace />
</Provider>
</ErrorBoundary>
</React.StrictMode>
);
}
}
export default Application;