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 { doNavigate } from "redux/actions/navigation";
|
|
|
|
import { doUserIdentityVerify } from "redux/actions/user";
|
2017-07-19 01:00:13 +02:00
|
|
|
import rewards from "rewards";
|
2017-11-13 22:02:23 +01:00
|
|
|
import { makeSelectRewardByType } from "redux/selectors/rewards";
|
2017-06-03 01:09:52 +02:00
|
|
|
import {
|
2017-07-19 01:00:13 +02:00
|
|
|
selectIdentityVerifyIsPending,
|
|
|
|
selectIdentityVerifyErrorMessage,
|
2017-11-13 22:02:23 +01:00
|
|
|
} from "redux/selectors/user";
|
2017-07-16 18:29:46 +02:00
|
|
|
import UserVerify from "./view";
|
2017-06-03 01:09:52 +02:00
|
|
|
|
2017-07-19 01:00:13 +02:00
|
|
|
const select = (state, props) => {
|
|
|
|
const selectReward = makeSelectRewardByType();
|
|
|
|
|
|
|
|
return {
|
|
|
|
isPending: selectIdentityVerifyIsPending(state),
|
|
|
|
errorMessage: selectIdentityVerifyErrorMessage(state),
|
|
|
|
reward: selectReward(state, { reward_type: rewards.TYPE_NEW_USER }),
|
|
|
|
};
|
|
|
|
};
|
2017-06-03 01:09:52 +02:00
|
|
|
|
2017-06-08 02:56:52 +02:00
|
|
|
const perform = dispatch => ({
|
2017-08-08 11:36:14 +02:00
|
|
|
navigate: uri => dispatch(doNavigate(uri)),
|
2017-07-19 01:00:13 +02:00
|
|
|
verifyUserIdentity: token => dispatch(doUserIdentityVerify(token)),
|
2017-06-08 02:56:52 +02:00
|
|
|
});
|
2017-06-03 01:09:52 +02:00
|
|
|
|
2017-07-16 18:29:46 +02:00
|
|
|
export default connect(select, perform)(UserVerify);
|