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

30 lines
868 B
JavaScript
Raw Normal View History

2017-08-18 05:31:44 +02:00
import React from "react";
import { connect } from "react-redux";
import InviteNew from "./view";
import {
selectUserInvitesRemaining,
selectUserInviteNewIsPending,
selectUserInviteNewErrorMessage,
} from "selectors/user";
2017-08-26 05:21:26 +02:00
import rewards from "rewards";
import { makeSelectRewardAmountByType } from "selectors/rewards";
2017-08-18 05:31:44 +02:00
import { doUserInviteNew } from "actions/user";
2017-08-26 05:21:26 +02:00
const select = state => {
const selectReward = makeSelectRewardAmountByType();
return {
errorMessage: selectUserInviteNewErrorMessage(state),
invitesRemaining: selectUserInvitesRemaining(state),
isPending: selectUserInviteNewIsPending(state),
rewardAmount: selectReward(state, { reward_type: rewards.TYPE_REFERRAL }),
};
};
2017-08-18 05:31:44 +02:00
const perform = dispatch => ({
inviteNew: email => dispatch(doUserInviteNew(email)),
});
export default connect(select, perform)(InviteNew);