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

16 lines
580 B
JavaScript
Raw Normal View History

import { connect } from 'react-redux';
2020-03-26 15:14:22 -04:00
import { makeSelectRewardByClaimCode, makeSelectIsRewardClaimPending, doClaimRewardType } from 'lbryinc';
import RewardLink from './view';
2017-05-26 12:53:32 +04:00
const select = (state, props) => ({
isPending: makeSelectIsRewardClaimPending()(state, props),
2020-03-26 15:14:22 -04:00
reward: makeSelectRewardByClaimCode()(state, props.claim_code),
});
2017-05-26 12:53:32 +04:00
2017-06-07 20:56:52 -04:00
const perform = dispatch => ({
claimReward: reward =>
dispatch(doClaimRewardType(reward.reward_type, { notifyError: true, params: { claim_code: reward.claim_code } })),
2017-06-07 20:56:52 -04:00
});
2017-05-26 12:53:32 +04:00
2020-03-26 15:14:22 -04:00
export default connect(select, perform)(RewardLink);