2017-05-05 08:13:06 +02:00
|
|
|
import React from 'react'
|
|
|
|
import {
|
|
|
|
connect
|
|
|
|
} from 'react-redux'
|
2017-05-10 05:06:48 +02:00
|
|
|
import {
|
|
|
|
doResolveUri,
|
|
|
|
} from 'actions/content'
|
2017-05-05 08:13:06 +02:00
|
|
|
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'
|
2017-05-05 08:13:06 +02:00
|
|
|
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
|
|
|
|
}
|
2017-05-05 08:13:06 +02:00
|
|
|
|
|
|
|
const perform = (dispatch) => ({
|
2017-05-10 05:06:48 +02:00
|
|
|
navigate: (path, params) => dispatch(doNavigate(path, params)),
|
2017-05-11 02:59:47 +02:00
|
|
|
resolveUri: (uri) => dispatch(doResolveUri(uri))
|
2017-05-05 08:13:06 +02:00
|
|
|
})
|
|
|
|
|
2017-05-10 05:06:48 +02:00
|
|
|
export default connect(makeSelect, perform)(ShowPage)
|