forked from OperationCode/operationcode_frontend
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathApp.js
More file actions
32 lines (28 loc) · 845 Bytes
/
App.js
File metadata and controls
32 lines (28 loc) · 845 Bytes
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
import React, { Component } from 'react';
import { Route, Router } from 'react-router';
import ReactGA from 'react-ga';
import createHistory from 'history/createBrowserHistory';
import Scene from './scenes/home/home';
class App extends Component {
constructor(props) {
super(props);
this.history = createHistory();
}
componentDidMount() {
if (process.env.NODE_ENV === 'production') {
ReactGA.initialize('UA-75642413-1', { debug: false });
this.history.listen((location) => {
ReactGA.set({ page: location.pathname });
ReactGA.pageview(location.pathname);
});
}
}
render() {
return (
<Router navBar = {MainNavBar} history={this.history} >
<Scene key="home" component={Home} title ="Operation Code" initial={true} />
</Router>
);
}
}
export default App;