2017-12-21 18:08:54 -03:00
|
|
|
import { connect } from 'react-redux';
|
2019-01-17 01:34:31 -05:00
|
|
|
import { makeSelectRewardByType, makeSelectIsRewardClaimPending, doClaimRewardType } from 'lbryinc';
|
2017-12-21 18:08:54 -03:00
|
|
|
import RewardLink from './view';
|
2017-05-26 12:53:32 +04:00
|
|
|
|
2019-01-17 01:34:31 -05:00
|
|
|
const select = (state, props) => ({
|
|
|
|
isPending: makeSelectIsRewardClaimPending()(state, props),
|
|
|
|
reward: makeSelectRewardByType()(state, props.reward_type),
|
|
|
|
});
|
2017-05-26 12:53:32 +04:00
|
|
|
|
2017-06-07 20:56:52 -04:00
|
|
|
const perform = dispatch => ({
|
2019-01-17 01:34:31 -05:00
|
|
|
claimReward: reward => dispatch(doClaimRewardType(reward.reward_type, { notifyError: true })),
|
2017-06-07 20:56:52 -04:00
|
|
|
});
|
2017-05-26 12:53:32 +04:00
|
|
|
|
2018-09-23 23:44:42 -04:00
|
|
|
export default connect(
|
2019-01-17 01:34:31 -05:00
|
|
|
select,
|
2018-09-23 23:44:42 -04:00
|
|
|
perform
|
|
|
|
)(RewardLink);
|