lbry-desktop/ui/page/invite/index.js

26 lines
955 B
JavaScript
Raw Normal View History

import * as SETTINGS from 'constants/settings';
import { connect } from 'react-redux';
import {
selectUserInviteStatusFailed,
selectUserInviteStatusIsPending,
selectUserVerifiedEmail,
} from 'redux/selectors/user';
import { doFetchInviteStatus } from 'redux/actions/user';
import { makeSelectClientSetting } from 'redux/selectors/settings';
import { doSetClientSetting } from 'redux/actions/settings';
2018-09-24 05:44:42 +02:00
import InvitePage from './view';
2017-08-18 05:31:44 +02:00
const select = (state) => ({
2017-08-18 05:31:44 +02:00
isFailed: selectUserInviteStatusFailed(state),
isPending: selectUserInviteStatusIsPending(state),
2021-11-29 16:35:51 +01:00
inviteAcknowledged: makeSelectClientSetting(SETTINGS.INVITE_ACKNOWLEDGED)(state),
authenticated: selectUserVerifiedEmail(state),
2017-08-18 05:31:44 +02:00
});
const perform = (dispatch) => ({
2017-08-18 05:31:44 +02:00
fetchInviteStatus: () => dispatch(doFetchInviteStatus()),
acknowledgeInivte: () => dispatch(doSetClientSetting(SETTINGS.INVITE_ACKNOWLEDGED, true)),
2017-08-18 05:31:44 +02:00
});
export default connect(select, perform)(InvitePage);