-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
47 lines (43 loc) · 1.14 KB
/
Copy pathApp.js
File metadata and controls
47 lines (43 loc) · 1.14 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
import React, { Component } from "react";
import { Router } from "react-router-dom";
import Routes from "./Routes";
import { createBrowserHistory } from "history";
import { MuiThemeProvider, createMuiTheme } from "@material-ui/core/styles";
import ReactGA from "react-ga";
import ttiPolyfill from "tti-polyfill";
const browserHistory = createBrowserHistory();
const theme = createMuiTheme({
palette: {
primary: {
main: "#669933",
},
secondary: {
main: "#d32769",
},
},
});
ReactGA.initialize("UA-172920641-1");
ttiPolyfill.getFirstConsistentlyInteractive().then((tti) => {
// console.log("reactga:timing:", tti);
ReactGA.timing({
category: "Load Performance",
variable: "Time to Interactive",
value: tti,
});
});
browserHistory.listen((location) => {
// console.log("reactga:history:", location);
ReactGA.set({ page: location.pathname });
ReactGA.pageview(location.pathname);
});
export default class App extends Component {
render() {
return (
<MuiThemeProvider theme={theme}>
<Router history={browserHistory}>
<Routes />
</Router>
</MuiThemeProvider>
);
}
}