-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.jsx
62 lines (47 loc) · 1.65 KB
/
index.jsx
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
59
60
61
62
import React from 'react';
import { render } from 'react-dom';
import { Router, Route, IndexRoute, browserHistory } from 'react-router';
import 'current-input';
import ReactGA from 'react-ga';
import Config from 'Config';
/*
Pages
*/
import App from 'App';
import Home from 'pages/Home';
import Competition from 'pages/Competition';
import Schedule from 'pages/Schedule';
import Done from 'pages/Done';
import PageNotFound from 'pages/PageNotFound';
import ExampleComponent from 'pages/ExampleComponent';
import ExampleTwoDeepComponent from 'pages/ExampleTwoDeepComponent';
import 'file-loader?name=page.js!page.js';
import 'file-loader?name=404.html!404.html';
import 'file-loader?name=CNAME!CNAME';
import 'styles/styles.less';
import 'font/hackicon.font';
ReactGA.initialize(Config.tracking_id);
const routes = (
<Route path="/" mapMenuTitle="Home" component={App}>
<IndexRoute component={Home} />
<Route path="competition" mapMenuTitle="Competition" component={Competition} />
<Route path="schedule" mapMenuTitle="Schedule" component={Schedule} />
<Route path="done" mapMenuTitle="Done" component={Done} />
<Route path="example" mapMenuTitle="Example" component={ExampleComponent}>
<Route path="two-deep" mapMenuTitle="Two Deep" component={ExampleTwoDeepComponent} />
</Route>
<Route path="*" mapMenuTitle="Page Not Found" component={PageNotFound} />
</Route>
);
function logPageView() {
ReactGA.set({ page: window.location.pathname });
ReactGA.pageview(window.location.pathname);
}
render(
<Router
history={browserHistory}
routes={routes}
onUpdate={logPageView}
/>,
document.getElementById('root')
);