lbry-desktop/ui/component/rewardLink/index.js
2019-11-11 13:27:29 -05:00

17 lines
530 B
JavaScript

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