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

40 lines
1.1 KiB
JavaScript
Raw Normal View History

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,
selectUserInviteReferralCode,
2018-09-24 05:44:42 +02:00
doUserInviteNew,
} from 'lbryinc';
import {
selectMyChannelClaims,
selectFetchingMyChannels,
doFetchChannelListMine,
doResolveUris,
selectResolvingUris,
} from 'lbry-redux';
import InviteNew from './view';
2017-08-18 05:31:44 +02:00
const select = state => ({
errorMessage: selectUserInviteNewErrorMessage(state),
invitesRemaining: selectUserInvitesRemaining(state),
2019-02-20 17:18:59 +01:00
referralLink: selectUserInviteReferralLink(state),
referralCode: selectUserInviteReferralCode(state),
isPending: selectUserInviteNewIsPending(state),
channels: selectMyChannelClaims(state),
fetchingChannels: selectFetchingMyChannels(state),
resolvingUris: selectResolvingUris(state),
});
2017-08-18 05:31:44 +02:00
const perform = dispatch => ({
inviteNew: email => dispatch(doUserInviteNew(email)),
fetchChannelListMine: () => dispatch(doFetchChannelListMine()),
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);