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

18 lines
530 B
JavaScript
Raw Normal View History

import { connect } from 'react-redux';
import { makeSelectRewardByType, makeSelectIsRewardClaimPending, doClaimRewardType } from 'lbryinc';
import RewardLink from './view';
2017-05-26 10:53:32 +02:00
const select = (state, props) => ({
isPending: makeSelectIsRewardClaimPending()(state, props),
reward: makeSelectRewardByType()(state, props.reward_type),
});
2017-05-26 10:53:32 +02:00
2017-06-08 02:56:52 +02:00
const perform = dispatch => ({
claimReward: reward => dispatch(doClaimRewardType(reward.reward_type, { notifyError: true })),
2017-06-08 02:56:52 +02:00
});
2017-05-26 10:53:32 +02:00
2018-09-24 05:44:42 +02:00
export default connect(
select,
2018-09-24 05:44:42 +02:00
perform
)(RewardLink);