lbry-desktop/ui/component/userEmailVerify/index.js

26 lines
871 B
JavaScript
Raw Normal View History

import { connect } from 'react-redux';
import { doUserResendVerificationEmail, doUserCheckEmailVerified } from 'redux/actions/user';
2019-10-28 15:04:37 +01:00
import {
selectEmailToVerify,
selectEmailAlreadyExists,
2019-10-28 15:04:37 +01:00
selectUser,
selectResendingVerificationEmail,
} from 'redux/selectors/user';
import { doToast } from 'redux/actions/notifications';
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-08 23:15:34 +02:00
email: selectEmailToVerify(state),
2019-10-28 15:04:37 +01:00
isReturningUser: selectEmailAlreadyExists(state),
2019-01-08 03:46:33 +01:00
user: selectUser(state),
2019-10-28 15:04:37 +01:00
resendingEmail: selectResendingVerificationEmail(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 => ({
resendVerificationEmail: email => dispatch(doUserResendVerificationEmail(email)),
checkEmailVerified: () => dispatch(doUserCheckEmailVerified()),
2019-10-28 15:04:37 +01:00
toast: message => dispatch(doToast({ message })),
2017-06-08 02:56:52 +02:00
});
2017-06-03 01:09:52 +02:00
export default connect(select, perform)(UserEmailVerify);