lbry-desktop/ui/js/component/userVerify/index.js
2017-11-13 16:02:23 -05:00

28 lines
915 B
JavaScript

import React from "react";
import { connect } from "react-redux";
import { doNavigate } from "redux/actions/navigation";
import { doUserIdentityVerify } from "redux/actions/user";
import rewards from "rewards";
import { makeSelectRewardByType } from "redux/selectors/rewards";
import {
selectIdentityVerifyIsPending,
selectIdentityVerifyErrorMessage,
} from "redux/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);