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

30 lines
814 B
JavaScript
Raw Normal View History

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';
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 => ({
resendVerificationEmail: email => dispatch(doUserResendVerificationEmail(email)),
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
2018-09-23 23:44:42 -04:00
export default connect(
select,
perform
)(UserEmailVerify);