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

32 lines
991 B
JavaScript
Raw Normal View History

import { connect } from 'react-redux';
2017-08-17 23:31:44 -04:00
import {
selectUserInvitesRemaining,
selectUserInviteNewIsPending,
selectUserInviteNewErrorMessage,
2019-02-20 11:18:59 -05:00
selectUserInviteReferralLink,
2020-01-14 15:44:07 -05:00
selectUserInviteReferralCode,
2018-09-23 23:44:42 -04:00
doUserInviteNew,
} from 'lbryinc';
import { selectMyChannelClaims, selectFetchingMyChannels, doFetchChannelListMine } from 'lbry-redux';
import InviteNew from './view';
2017-08-17 23:31:44 -04:00
const select = state => ({
errorMessage: selectUserInviteNewErrorMessage(state),
invitesRemaining: selectUserInvitesRemaining(state),
2019-02-20 11:18:59 -05:00
referralLink: selectUserInviteReferralLink(state),
2020-01-14 15:44:07 -05:00
referralCode: selectUserInviteReferralCode(state),
isPending: selectUserInviteNewIsPending(state),
2020-01-14 15:44:07 -05:00
channels: selectMyChannelClaims(state),
fetchingChannels: selectFetchingMyChannels(state),
});
2017-08-17 23:31:44 -04:00
const perform = dispatch => ({
inviteNew: email => dispatch(doUserInviteNew(email)),
2020-01-14 15:44:07 -05:00
fetchChannelListMine: () => dispatch(doFetchChannelListMine()),
2017-08-17 23:31:44 -04:00
});
2018-09-23 23:44:42 -04:00
export default connect(
select,
perform
)(InviteNew);