lbry-desktop/ui/js/component/fileCardStream/index.js

51 lines
1.3 KiB
JavaScript
Raw Normal View History

2017-04-23 16:01:00 +02:00
import React from 'react'
import {
connect
} from 'react-redux'
import {
doNavigate,
} from 'actions/app'
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'
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()
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),
})
return select
}
const perform = (dispatch) => ({
navigate: (path) => dispatch(doNavigate(path)),
})
export default connect(makeSelect, perform)(FileCardStream)