forked from parisjs/parisjs-website
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
59 lines (44 loc) · 1.91 KB
/
App.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
import React from 'react'
import { Router, Route, browserHistory } from 'react-router'
import { createApp, renderApp } from '@phenomic/preset-react-app/lib/client'
import PageError from './components/PageError'
import FAQContainer from './components/FAQContainer'
import HomeContainer from './components/HomeContainer'
import MeetupContainer from './components/MeetupContainer'
import SearchContainer from './components/SearchContainer'
import SponsorsContainer from './components/SponsorsContainer'
import TalkSubmissionContainer from './components/TalkSubmissionContainer'
import './styles.css'
function hashLinkScroll() {
const { hash } = window.location
if (hash !== '') {
setTimeout(() => {
const id = hash.replace('#', '')
const element = document.getElementById(id)
if (element) element.scrollIntoView()
}, 0)
}
}
const routes = () => (
<Router history={browserHistory} onUpdate={hashLinkScroll}>
<Route path="/" component={HomeContainer} />
<Route path="/en" component={HomeContainer} />
<Route path="/faq" component={FAQContainer} />
<Route path="/en/faq" component={FAQContainer} />
<Route path="/depois-de/:after" component={HomeContainer} />
<Route path="/en/after/:after" component={HomeContainer} />
<Route path="/meetup/*" component={MeetupContainer} />
<Route path="/en/meetup/*" component={MeetupContainer} />
<Route path="/apoiadores" component={SponsorsContainer} />
<Route path="/en/sponsors" component={SponsorsContainer} />
<Route path="/proposta/talk" component={TalkSubmissionContainer} />
<Route path="/en/submission/talk" component={TalkSubmissionContainer} />
<Route path="/busca" component={SearchContainer} />
<Route path="/en/search" component={SearchContainer} />
<Route path="*" component={PageError} />
</Router>
)
export default createApp(routes)
if (module.hot) {
module.hot.accept(() => renderApp(routes))
}