2021-10-17 10:36:14 +02:00
|
|
|
import * as SETTINGS from 'constants/settings';
|
2017-12-21 22:08:54 +01:00
|
|
|
import { connect } from 'react-redux';
|
2020-01-22 18:46:18 +01:00
|
|
|
import {
|
|
|
|
selectUserInviteStatusFailed,
|
|
|
|
selectUserInviteStatusIsPending,
|
|
|
|
selectUserVerifiedEmail,
|
2020-06-15 22:33:03 +02:00
|
|
|
} from 'redux/selectors/user';
|
|
|
|
import { doFetchInviteStatus } from 'redux/actions/user';
|
2021-11-23 05:29:04 +01:00
|
|
|
import { selectClientSetting } from 'redux/selectors/settings';
|
2019-01-27 01:23:47 +01:00
|
|
|
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
|
|
|
|
2021-10-17 10:36:14 +02:00
|
|
|
const select = (state) => ({
|
2017-08-18 05:31:44 +02:00
|
|
|
isFailed: selectUserInviteStatusFailed(state),
|
|
|
|
isPending: selectUserInviteStatusIsPending(state),
|
2021-11-23 05:29:04 +01:00
|
|
|
inviteAcknowledged: selectClientSetting(state, SETTINGS.INVITE_ACKNOWLEDGED),
|
2020-01-22 18:46:18 +01:00
|
|
|
authenticated: selectUserVerifiedEmail(state),
|
2017-08-18 05:31:44 +02:00
|
|
|
});
|
|
|
|
|
2021-10-17 10:36:14 +02:00
|
|
|
const perform = (dispatch) => ({
|
2017-08-18 05:31:44 +02:00
|
|
|
fetchInviteStatus: () => dispatch(doFetchInviteStatus()),
|
2019-01-27 01:23:47 +01:00
|
|
|
acknowledgeInivte: () => dispatch(doSetClientSetting(SETTINGS.INVITE_ACKNOWLEDGED, true)),
|
2017-08-18 05:31:44 +02:00
|
|
|
});
|
|
|
|
|
2020-06-15 22:33:03 +02:00
|
|
|
export default connect(select, perform)(InvitePage);
|