lbry-desktop/ui/modal/modalRewardCode/index.js

27 lines
762 B
JavaScript
Raw Normal View History

2018-09-26 02:12:07 +02:00
import { connect } from 'react-redux';
import { doHideModal } from 'redux/actions/app';
2018-09-26 02:12:07 +02:00
import {
makeSelectClaimRewardError,
doClaimRewardType,
makeSelectIsRewardClaimPending,
rewards as REWARD_TYPES,
} from 'lbryinc';
import ModalRewardCode from './view';
2019-03-18 06:09:50 +01:00
const select = state => ({
2018-09-26 02:12:07 +02:00
rewardIsPending: makeSelectIsRewardClaimPending()(state, {
reward_type: REWARD_TYPES.TYPE_REWARD_CODE,
}),
error: makeSelectClaimRewardError()(state, { reward_type: REWARD_TYPES.TYPE_REWARD_CODE }),
});
const perform = dispatch => ({
closeModal: () => dispatch(doHideModal()),
2019-05-07 23:38:29 +02:00
submitRewardCode: code => dispatch(doClaimRewardType(REWARD_TYPES.TYPE_REWARD_CODE, { params: { code } })),
2018-09-26 02:12:07 +02:00
});
export default connect(
select,
perform
)(ModalRewardCode);