-
Notifications
You must be signed in to change notification settings - Fork 29
/
App.js
49 lines (42 loc) · 1.04 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
import React, { Component } from 'react'
import PropTypes from 'prop-types'
import { connect } from 'redux-bundler-react'
import navHelper from 'internal-nav-helper'
// Components
import Header from './components/header/Header'
import Footer from './components/footer/Footer'
// Styles
import './App.css'
export class App extends Component {
static propTypes = {
doInitIpfs: PropTypes.func.isRequired,
doUpdateUrl: PropTypes.func.isRequired,
route: PropTypes.oneOfType([
PropTypes.func,
PropTypes.element
]).isRequired
}
componentWillMount () {
this.props.doInitIpfs()
}
render () {
const Page = this.props.route
return (
<div className='App sans-serif' onClick={navHelper(this.props.doUpdateUrl)}>
<div className='flex flex-column min-vh-100'>
<Header />
<main className='flex-auto pa4'>
<Page />
</main>
<Footer />
</div>
</div>
)
}
}
export default connect(
'selectRoute',
'doUpdateUrl',
'doInitIpfs',
App
)