2017-12-21 22:08:54 +01:00
|
|
|
import { connect } from 'react-redux';
|
2019-10-28 15:04:37 +01:00
|
|
|
import {
|
|
|
|
selectEmailAlreadyExists,
|
|
|
|
selectEmailToVerify,
|
|
|
|
doUserResendVerificationEmail,
|
|
|
|
doUserCheckEmailVerified,
|
|
|
|
selectUser,
|
|
|
|
selectResendingVerificationEmail,
|
|
|
|
} from 'lbryinc';
|
2020-06-12 22:44:25 +02:00
|
|
|
import { doToast } from 'redux/actions/notifications';
|
2017-12-21 22:08:54 +01:00
|
|
|
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 => ({
|
2018-06-07 03:47:49 +02:00
|
|
|
resendVerificationEmail: email => dispatch(doUserResendVerificationEmail(email)),
|
2019-01-09 06:01:45 +01:00
|
|
|
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
|
|
|
|
2020-04-13 21:16:07 +02:00
|
|
|
export default connect(select, perform)(UserEmailVerify);
|