2017-12-21 22:08:54 +01:00
|
|
|
import { connect } from 'react-redux';
|
2018-06-07 03:47:49 +02:00
|
|
|
import {
|
|
|
|
doUserEmailVerify,
|
|
|
|
doUserEmailVerifyFailure,
|
|
|
|
doUserResendVerificationEmail,
|
|
|
|
} from 'redux/actions/user';
|
2017-06-03 01:09:52 +02:00
|
|
|
import {
|
|
|
|
selectEmailVerifyIsPending,
|
2017-06-08 02:56:52 +02:00
|
|
|
selectEmailToVerify,
|
2017-06-03 01:09:52 +02:00
|
|
|
selectEmailVerifyErrorMessage,
|
2017-12-21 22:08:54 +01:00
|
|
|
} from 'redux/selectors/user';
|
|
|
|
import UserEmailVerify from './view';
|
2017-06-03 01:09:52 +02:00
|
|
|
|
2017-06-08 02:56:52 +02:00
|
|
|
const select = state => ({
|
2017-06-03 01:09:52 +02:00
|
|
|
isPending: selectEmailVerifyIsPending(state),
|
2017-06-08 23:15:34 +02:00
|
|
|
email: selectEmailToVerify(state),
|
2017-06-03 01:09:52 +02:00
|
|
|
errorMessage: selectEmailVerifyErrorMessage(state),
|
2017-06-08 02:56:52 +02:00
|
|
|
});
|
2017-06-03 01:09:52 +02:00
|
|
|
|
2017-06-08 02:56:52 +02:00
|
|
|
const perform = dispatch => ({
|
2017-12-26 14:25:26 +01:00
|
|
|
verifyUserEmail: (code, recaptcha) => dispatch(doUserEmailVerify(code, recaptcha)),
|
2017-12-23 03:09:06 +01:00
|
|
|
verifyUserEmailFailure: error => dispatch(doUserEmailVerifyFailure(error)),
|
2018-06-07 03:47:49 +02:00
|
|
|
resendVerificationEmail: email => dispatch(doUserResendVerificationEmail(email)),
|
2017-06-08 02:56:52 +02:00
|
|
|
});
|
2017-06-03 01:09:52 +02:00
|
|
|
|
2017-06-08 02:56:52 +02:00
|
|
|
export default connect(select, perform)(UserEmailVerify);
|