lbry-desktop/ui/js/page/filePage/index.js
2017-05-12 13:14:06 -04:00

35 lines
832 B
JavaScript

import React from 'react'
import {
connect
} from 'react-redux'
import {
doFetchCurrentUriFileInfo
} from 'actions/file_info'
import {
selectCurrentUri,
} from 'selectors/app'
import {
selectCurrentUriFileInfo,
selectCurrentUriIsDownloaded,
} from 'selectors/file_info'
import {
selectCurrentUriClaim,
} from 'selectors/claims'
import {
selectCurrentUriCostInfo,
} from 'selectors/cost_info'
import FilePage from './view'
const select = (state) => ({
claim: selectCurrentUriClaim(state),
uri: selectCurrentUri(state),
isDownloaded: selectCurrentUriIsDownloaded(state),
fileInfo: selectCurrentUriFileInfo(state),
costInfo: selectCurrentUriCostInfo(state),
})
const perform = (dispatch) => ({
fetchFileInfo: () => dispatch(doFetchCurrentUriFileInfo())
})
export default connect(select, perform)(FilePage)