2017-06-08 02:56:52 +02:00
|
|
|
import React from "react";
|
|
|
|
import { connect } from "react-redux";
|
2017-11-13 22:02:23 +01:00
|
|
|
import { doUserEmailVerify } from "redux/actions/user";
|
2017-06-03 01:09:52 +02:00
|
|
|
import {
|
|
|
|
selectEmailVerifyIsPending,
|
2017-06-08 02:56:52 +02:00
|
|
|
selectEmailToVerify,
|
2017-06-03 01:09:52 +02:00
|
|
|
selectEmailVerifyErrorMessage,
|
2017-11-13 22:02:23 +01:00
|
|
|
} from "redux/selectors/user";
|
2017-06-08 02:56:52 +02:00
|
|
|
import UserEmailVerify from "./view";
|
2017-12-07 19:07:30 +01:00
|
|
|
import rewards from "rewards";
|
|
|
|
import { makeSelectRewardAmountByType } from "redux/selectors/rewards";
|
2017-06-03 01:09:52 +02:00
|
|
|
|
2017-06-08 02:56:52 +02:00
|
|
|
const select = state => ({
|
2017-06-03 01:09:52 +02:00
|
|
|
isPending: selectEmailVerifyIsPending(state),
|
2017-06-08 23:15:34 +02:00
|
|
|
email: selectEmailToVerify(state),
|
2017-06-03 01:09:52 +02:00
|
|
|
errorMessage: selectEmailVerifyErrorMessage(state),
|
2017-12-07 19:07:30 +01:00
|
|
|
rewardAmount: makeSelectRewardAmountByType()(state, {
|
|
|
|
reward_type: rewards.TYPE_CONFIRM_EMAIL,
|
|
|
|
}),
|
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 => ({
|
|
|
|
verifyUserEmail: code => dispatch(doUserEmailVerify(code)),
|
|
|
|
});
|
2017-06-03 01:09:52 +02:00
|
|
|
|
2017-06-08 02:56:52 +02:00
|
|
|
export default connect(select, perform)(UserEmailVerify);
|