lbry-desktop/src/renderer/component/userEmailVerify/index.js

27 lines
837 B
JavaScript
Raw Normal View History

import { connect } from 'react-redux';
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,
} 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)),
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);