2017-12-21 18:08:54 -03:00
|
|
|
import { connect } from 'react-redux';
|
2019-10-28 10:04:37 -04:00
|
|
|
import {
|
|
|
|
selectEmailAlreadyExists,
|
|
|
|
selectEmailToVerify,
|
|
|
|
doUserResendVerificationEmail,
|
|
|
|
doUserCheckEmailVerified,
|
|
|
|
selectUser,
|
|
|
|
selectResendingVerificationEmail,
|
|
|
|
} from 'lbryinc';
|
|
|
|
import { doToast } from 'lbry-redux';
|
2017-12-21 18:08:54 -03:00
|
|
|
import UserEmailVerify from './view';
|
2017-06-02 19:09:52 -04:00
|
|
|
|
2017-06-07 20:56:52 -04:00
|
|
|
const select = state => ({
|
2017-06-08 17:15:34 -04:00
|
|
|
email: selectEmailToVerify(state),
|
2019-10-28 10:04:37 -04:00
|
|
|
isReturningUser: selectEmailAlreadyExists(state),
|
2019-01-07 21:46:33 -05:00
|
|
|
user: selectUser(state),
|
2019-10-28 10:04:37 -04:00
|
|
|
resendingEmail: selectResendingVerificationEmail(state),
|
2017-06-07 20:56:52 -04:00
|
|
|
});
|
2017-06-02 19:09:52 -04:00
|
|
|
|
2017-06-07 20:56:52 -04:00
|
|
|
const perform = dispatch => ({
|
2018-06-06 20:47:49 -05:00
|
|
|
resendVerificationEmail: email => dispatch(doUserResendVerificationEmail(email)),
|
2019-01-09 00:01:45 -05:00
|
|
|
checkEmailVerified: () => dispatch(doUserCheckEmailVerified()),
|
2019-10-28 10:04:37 -04:00
|
|
|
toast: message => dispatch(doToast({ message })),
|
2017-06-07 20:56:52 -04:00
|
|
|
});
|
2017-06-02 19:09:52 -04:00
|
|
|
|
2020-04-13 15:16:07 -04:00
|
|
|
export default connect(select, perform)(UserEmailVerify);
|