-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
72 lines (68 loc) · 2.23 KB
/
index.js
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
63
64
65
66
67
68
69
70
71
72
import React from 'react';
import ReactDOM from 'react-dom';
import {Router, Route, IndexRoute, browserHistory} from 'react-router';
import App from 'App';
import About from 'screens/About';
import Conduct from 'screens/Conduct';
import Home from 'screens/Home';
import Schedule from 'screens/Schedule';
import Speakers from 'screens/Speakers';
import Sponsors from 'screens/Sponsors';
import Stream from 'screens/Stream';
import Venue from 'screens/Venue';
import Workshop from 'screens/Workshop';
import ga from 'helpers/googleAnalytics';
import './assets/css/styles.css';
import './assets/css/responsive.css';
const NotFound = () => {
return (
<div className="NotFound">
<img src="assets/dist/img/icons/t-rex.svg" />
<h1>Sorry, you're looking for something that no longer exists.</h1>
<section className="highlight">
<p>
But since you're here, why not{' '}
<a href="https://youtu.be/dQw4w9WgXcQ" target="_blank">
watch a video
</a>{' '}
of our favorite talk from last year?
</p>
</section>
</div>
);
};
// Fix history
(function() {
const hash = location.hash;
const redirect = sessionStorage.redirect;
delete sessionStorage.redirect;
// Fix history for redirect coming from gh-pages 404.html
if (redirect && redirect !== location.href) {
history.replaceState(null, null, redirect);
}
// Fix history for legacy hash history URLs
else if (hash.trim().length !== 0) {
history.replaceState(null, null, hash.replace('#', ''));
}
})();
ReactDOM.render(
<Router
history={browserHistory}
onUpdate={() => {
window.scrollTo(0, 0);
}}>
<Route path="/" component={App}>
<IndexRoute component={Home} />
<Route path="/about" component={About} />
<Route path="/conduct" component={Conduct} />
<Route path="/schedule" component={Schedule} />
<Route path="/speakers" component={Speakers} />
<Route path="/sponsors" component={Sponsors} />
<Route path="/stream" component={Stream} />
<Route path="/venue" component={Venue} />
<Route path="/workshop" component={Workshop} />
<Route path="*" component={NotFound} />
</Route>
</Router>,
document.getElementById('container'),
);