-
Notifications
You must be signed in to change notification settings - Fork 29
/
Download.js
48 lines (40 loc) · 1.11 KB
/
Download.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
import React from 'react'
import PropTypes from 'prop-types'
import { connect } from 'redux-bundler-react'
import { Helmet } from 'react-helmet'
// Components
import Box from '../../components/box/Box'
import Info from '../../components/info/Info'
class Download extends React.Component {
static propTypes = {
routeInfo: PropTypes.object.isRequired,
isLoading: PropTypes.bool.isRequired,
files: PropTypes.object.isRequired,
doFetchFileTree: PropTypes.func.isRequired
}
componentDidMount () {
const { routeInfo: { params }, doFetchFileTree } = this.props
doFetchFileTree(params.hash)
}
render () {
const { files, isLoading } = this.props
return (
<div data-id='Download'>
<Helmet>
<title>IPFS - Download Files</title>
</Helmet>
<div className='flex flex-column flex-row-l justify-center items-center'>
<Box files={files} isDownload isLoading={isLoading} />
<Info />
</div>
</div>
)
}
}
export default connect(
'selectRouteInfo',
'selectIsLoading',
'selectFiles',
'doFetchFileTree',
Download
)