2020-03-25 04:15:05 +01:00
|
|
|
import { connect } from 'react-redux';
|
|
|
|
import {
|
2021-12-31 18:52:26 +01:00
|
|
|
selectClaimForUri,
|
2020-03-25 04:15:05 +01:00
|
|
|
makeSelectContentTypeForUri,
|
|
|
|
makeSelectMetadataForUri,
|
2021-12-31 18:52:26 +01:00
|
|
|
selectClaimIsMine,
|
2021-10-08 05:47:39 +02:00
|
|
|
} from 'redux/selectors/claims';
|
|
|
|
import { makeSelectPendingAmountByUri } from 'redux/selectors/wallet';
|
|
|
|
import { makeSelectFileInfoForUri } from 'redux/selectors/file_info';
|
2020-06-15 22:33:03 +02:00
|
|
|
import { selectUser } from 'redux/selectors/user';
|
2020-03-25 04:15:05 +01:00
|
|
|
import { doOpenModal } from 'redux/actions/app';
|
|
|
|
|
|
|
|
import FileValues from './view';
|
|
|
|
|
2021-12-31 18:52:26 +01:00
|
|
|
const select = (state, props) => {
|
|
|
|
const claim = selectClaimForUri(state, props.uri);
|
|
|
|
|
|
|
|
return {
|
|
|
|
claim,
|
|
|
|
contentType: makeSelectContentTypeForUri(props.uri)(state),
|
|
|
|
fileInfo: makeSelectFileInfoForUri(props.uri)(state),
|
|
|
|
metadata: makeSelectMetadataForUri(props.uri)(state),
|
|
|
|
user: selectUser(state),
|
|
|
|
pendingAmount: makeSelectPendingAmountByUri(props.uri)(state),
|
|
|
|
claimIsMine: selectClaimIsMine(state, claim),
|
|
|
|
};
|
|
|
|
};
|
2020-03-25 04:15:05 +01:00
|
|
|
|
2021-10-08 05:47:39 +02:00
|
|
|
const perform = (dispatch) => ({
|
2020-03-25 04:15:05 +01:00
|
|
|
openModal: (modal, props) => dispatch(doOpenModal(modal, props)),
|
|
|
|
});
|
|
|
|
|
|
|
|
export default connect(select, perform)(FileValues);
|