-
Notifications
You must be signed in to change notification settings - Fork 68
/
Copy pathindex.tsx
58 lines (52 loc) · 1.73 KB
/
index.tsx
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
55
56
57
58
import { MuiThemeProvider } from "@material-ui/core";
import "@renproject/fonts/fonts.esm.css";
import React from "react";
import ReactDOM from "react-dom";
import { Provider } from "react-redux";
import "./index.css";
import { NotificationsProvider } from "./providers/Notifications";
import { TitleProviders } from "./providers/TitleProviders";
import * as serviceWorker from "./serviceWorker";
import store from "./store/store";
import { lightTheme } from "./theme/theme";
import "./i18n/i18n";
import * as Sentry from "@sentry/react";
// clean history state after page reaload
window.history.replaceState({}, document.title);
if (process.env.NODE_ENV !== "development") {
if (process.env.REACT_APP_SENTRY_DSN) {
Sentry.init({
dsn: process.env.REACT_APP_SENTRY_DSN,
environment: window.location.origin.includes("bridge.renproject.io")
? "prod"
: "staging",
release: process.env.REACT_APP_VERSION,
});
}
}
const render = () => {
const App = require("./App").default;
ReactDOM.render(
<>
<Provider store={store}>
<MuiThemeProvider theme={lightTheme}>
<TitleProviders>
<NotificationsProvider>
<App />
</NotificationsProvider>
</TitleProviders>
</MuiThemeProvider>
</Provider>
</>,
document.getElementById("root")
);
};
render();
// tslint:disable-next-line: no-any
if (process.env.NODE_ENV === "development" && (module as any).hot) {
(module as any).hot.accept("./App", render);
}
// If you want your app to work offline and load faster, you can change
// unregister() to register() below. Note this comes with some pitfalls.
// Learn more about service workers: https://bit.ly/CRA-PWA
serviceWorker.unregister();