339945018d
and refactor history
28 lines
891 B
JavaScript
28 lines
891 B
JavaScript
import React from "react";
|
|
import { connect } from "react-redux";
|
|
import { doNavigate } from "actions/navigation";
|
|
import { doUserIdentityVerify } from "actions/user";
|
|
import rewards from "rewards";
|
|
import { makeSelectRewardByType } from "selectors/rewards";
|
|
import {
|
|
selectIdentityVerifyIsPending,
|
|
selectIdentityVerifyErrorMessage,
|
|
} from "selectors/user";
|
|
import UserVerify from "./view";
|
|
|
|
const select = (state, props) => {
|
|
const selectReward = makeSelectRewardByType();
|
|
|
|
return {
|
|
isPending: selectIdentityVerifyIsPending(state),
|
|
errorMessage: selectIdentityVerifyErrorMessage(state),
|
|
reward: selectReward(state, { reward_type: rewards.TYPE_NEW_USER }),
|
|
};
|
|
};
|
|
|
|
const perform = dispatch => ({
|
|
navigate: uri => dispatch(doNavigate(uri)),
|
|
verifyUserIdentity: token => dispatch(doUserIdentityVerify(token)),
|
|
});
|
|
|
|
export default connect(select, perform)(UserVerify);
|