2017-04-23 16:01:00 +02:00
|
|
|
import React from 'react'
|
|
|
|
import {
|
|
|
|
connect
|
|
|
|
} from 'react-redux'
|
2017-04-24 09:25:27 +02:00
|
|
|
import {
|
|
|
|
doNavigate,
|
|
|
|
} from 'actions/app'
|
2017-04-29 11:50:29 +02:00
|
|
|
import {
|
|
|
|
selectHidePrice,
|
|
|
|
selectObscureNsfw,
|
|
|
|
} from 'selectors/app'
|
|
|
|
import {
|
|
|
|
makeSelectClaimForUri,
|
|
|
|
makeSelectSourceForUri,
|
|
|
|
makeSelectMetadataForUri,
|
|
|
|
} from 'selectors/claims'
|
|
|
|
import {
|
|
|
|
makeSelectFileInfoForUri,
|
|
|
|
} from 'selectors/file_info'
|
2017-05-02 06:48:16 +02:00
|
|
|
import {
|
|
|
|
makeSelectResolvingUri,
|
|
|
|
} from 'selectors/content'
|
2017-04-23 16:01:00 +02:00
|
|
|
import FileCardStream from './view'
|
|
|
|
|
2017-04-29 11:50:29 +02:00
|
|
|
const makeSelect = () => {
|
|
|
|
const selectClaimForUri = makeSelectClaimForUri()
|
|
|
|
const selectFileInfoForUri = makeSelectFileInfoForUri()
|
|
|
|
const selectMetadataForUri = makeSelectMetadataForUri()
|
|
|
|
const selectSourceForUri = makeSelectSourceForUri()
|
2017-05-02 06:48:16 +02:00
|
|
|
const selectResolvingUri = makeSelectResolvingUri()
|
|
|
|
|
2017-04-29 11:50:29 +02:00
|
|
|
const select = (state, props) => ({
|
|
|
|
claim: selectClaimForUri(state, props),
|
|
|
|
fileInfo: selectFileInfoForUri(state, props),
|
|
|
|
hidePrice: selectHidePrice(state),
|
|
|
|
obscureNsfw: selectObscureNsfw(state),
|
|
|
|
hasSignature: false,
|
|
|
|
metadata: selectMetadataForUri(state, props),
|
|
|
|
source: selectSourceForUri(state, props),
|
2017-05-02 06:48:16 +02:00
|
|
|
isResolvingUri: selectResolvingUri(state, props),
|
2017-04-29 11:50:29 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
return select
|
|
|
|
}
|
2017-04-24 09:25:27 +02:00
|
|
|
|
|
|
|
const perform = (dispatch) => ({
|
|
|
|
navigate: (path) => dispatch(doNavigate(path)),
|
|
|
|
})
|
|
|
|
|
2017-04-29 11:50:29 +02:00
|
|
|
export default connect(makeSelect, perform)(FileCardStream)
|