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

27 lines
808 B
JavaScript
Raw Normal View History

import { connect } from 'react-redux';
2019-10-28 15:04:37 +01:00
import {
selectEmailAlreadyExists,
selectEmailToVerify,
doUserResendVerificationEmail,
doUserCheckEmailVerified,
selectUser,
selectResendingVerificationEmail,
} from 'lbryinc';
import { doToast } from 'lbry-redux';
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);