2017-12-21 22:08:54 +01:00
|
|
|
import { connect } from 'react-redux';
|
2017-08-18 05:31:44 +02:00
|
|
|
import {
|
|
|
|
selectUserInvitesRemaining,
|
|
|
|
selectUserInviteNewIsPending,
|
|
|
|
selectUserInviteNewErrorMessage,
|
2019-02-20 17:18:59 +01:00
|
|
|
selectUserInviteReferralLink,
|
2020-01-08 23:33:47 +01:00
|
|
|
selectUserInviteReferralCode,
|
2018-09-24 05:44:42 +02:00
|
|
|
doUserInviteNew,
|
|
|
|
} from 'lbryinc';
|
2020-01-10 04:50:47 +01:00
|
|
|
import {
|
|
|
|
selectMyChannelClaims,
|
|
|
|
selectFetchingMyChannels,
|
|
|
|
doFetchChannelListMine,
|
|
|
|
doResolveUris,
|
|
|
|
selectResolvingUris,
|
|
|
|
} from 'lbry-redux';
|
2018-05-30 19:51:20 +02:00
|
|
|
import InviteNew from './view';
|
2017-08-18 05:31:44 +02:00
|
|
|
|
2018-05-30 19:51:20 +02:00
|
|
|
const select = state => ({
|
|
|
|
errorMessage: selectUserInviteNewErrorMessage(state),
|
|
|
|
invitesRemaining: selectUserInvitesRemaining(state),
|
2019-02-20 17:18:59 +01:00
|
|
|
referralLink: selectUserInviteReferralLink(state),
|
2020-01-08 23:33:47 +01:00
|
|
|
referralCode: selectUserInviteReferralCode(state),
|
2018-05-30 19:51:20 +02:00
|
|
|
isPending: selectUserInviteNewIsPending(state),
|
2020-01-08 23:33:47 +01:00
|
|
|
channels: selectMyChannelClaims(state),
|
|
|
|
fetchingChannels: selectFetchingMyChannels(state),
|
2020-01-10 04:50:47 +01:00
|
|
|
resolvingUris: selectResolvingUris(state),
|
2018-05-30 19:51:20 +02:00
|
|
|
});
|
2017-08-18 05:31:44 +02:00
|
|
|
|
|
|
|
const perform = dispatch => ({
|
|
|
|
inviteNew: email => dispatch(doUserInviteNew(email)),
|
2020-01-08 23:33:47 +01:00
|
|
|
fetchChannelListMine: () => dispatch(doFetchChannelListMine()),
|
2020-01-10 04:50:47 +01:00
|
|
|
resolveUris: uris => dispatch(doResolveUris(uris)),
|
2017-08-18 05:31:44 +02:00
|
|
|
});
|
|
|
|
|
2018-09-24 05:44:42 +02:00
|
|
|
export default connect(
|
|
|
|
select,
|
|
|
|
perform
|
|
|
|
)(InviteNew);
|