lbry-desktop/ui/component/rewardLink/index.js
Thomas Zarebczan 0c042376a4
fix: actually pass claim code (#3909)
Required lbryinc changes that I pushed to master.
2020-03-27 21:54:59 -04:00

15 lines
580 B
JavaScript

import { connect } from 'react-redux';
import { makeSelectRewardByClaimCode, makeSelectIsRewardClaimPending, doClaimRewardType } from 'lbryinc';
import RewardLink from './view';
const select = (state, props) => ({
isPending: makeSelectIsRewardClaimPending()(state, props),
reward: makeSelectRewardByClaimCode()(state, props.claim_code),
});
const perform = dispatch => ({
claimReward: reward =>
dispatch(doClaimRewardType(reward.reward_type, { notifyError: true, params: { claim_code: reward.claim_code } })),
});
export default connect(select, perform)(RewardLink);