lbry-desktop/ui/js/page/showPage/index.js

47 lines
1 KiB
JavaScript
Raw Normal View History

import React from 'react'
import {
connect
} from 'react-redux'
2017-05-10 05:06:48 +02:00
import {
doResolveUri,
} from 'actions/content'
import {
selectCurrentUri,
} from 'selectors/app'
import {
selectCurrentUriIsDownloaded,
} from 'selectors/file_info'
import {
selectCurrentUriClaim,
} from 'selectors/claims'
import {
selectCurrentUriFileInfo,
} from 'selectors/file_info'
import {
selectCurrentUriCostInfo,
} from 'selectors/cost_info'
2017-05-10 05:06:48 +02:00
import {
makeSelectResolvingUri,
} from 'selectors/content'
import ShowPage from './view'
2017-05-10 05:06:48 +02:00
const makeSelect = () => {
const selectResolvingUri = makeSelectResolvingUri()
const select = (state, props) => ({
claim: selectCurrentUriClaim(state),
uri: selectCurrentUri(state),
isResolvingUri: selectResolvingUri(state, props),
claimType: 'file',
})
return select
}
const perform = (dispatch) => ({
2017-05-10 05:06:48 +02:00
navigate: (path, params) => dispatch(doNavigate(path, params)),
resolveUri: (uri) => dispatch(doResolveUri(uri))
})
2017-05-10 05:06:48 +02:00
export default connect(makeSelect, perform)(ShowPage)