2020-07-10 17:04:36 -04:00
|
|
|
import { SETTINGS } from 'lbry-redux';
|
2017-12-21 18:08:54 -03:00
|
|
|
import { connect } from 'react-redux';
|
2020-01-22 12:46:18 -05:00
|
|
|
import {
|
|
|
|
selectUserInviteStatusFailed,
|
|
|
|
selectUserInviteStatusIsPending,
|
|
|
|
selectUserVerifiedEmail,
|
2020-06-15 16:33:03 -04:00
|
|
|
} from 'redux/selectors/user';
|
|
|
|
import { doFetchInviteStatus } from 'redux/actions/user';
|
2019-01-26 19:23:47 -05:00
|
|
|
import { makeSelectClientSetting } from 'redux/selectors/settings';
|
|
|
|
import { doSetClientSetting } from 'redux/actions/settings';
|
2018-09-23 23:44:42 -04:00
|
|
|
import InvitePage from './view';
|
2017-08-17 23:31:44 -04:00
|
|
|
|
|
|
|
const select = state => ({
|
|
|
|
isFailed: selectUserInviteStatusFailed(state),
|
|
|
|
isPending: selectUserInviteStatusIsPending(state),
|
2019-01-26 19:23:47 -05:00
|
|
|
inviteAcknowledged: makeSelectClientSetting(state)(SETTINGS.INVITE_ACKNOWLEDGED),
|
2020-01-22 12:46:18 -05:00
|
|
|
authenticated: selectUserVerifiedEmail(state),
|
2017-08-17 23:31:44 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
const perform = dispatch => ({
|
|
|
|
fetchInviteStatus: () => dispatch(doFetchInviteStatus()),
|
2019-01-26 19:23:47 -05:00
|
|
|
acknowledgeInivte: () => dispatch(doSetClientSetting(SETTINGS.INVITE_ACKNOWLEDGED, true)),
|
2017-08-17 23:31:44 -04:00
|
|
|
});
|
|
|
|
|
2020-06-15 16:33:03 -04:00
|
|
|
export default connect(select, perform)(InvitePage);
|