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

29 lines
886 B
JavaScript
Raw Normal View History

2017-06-07 20:56:52 -04:00
import React from "react";
import { connect } from "react-redux";
2017-08-02 19:37:38 -04:00
import { doNavigate } from "actions/app";
2017-07-18 19:00:13 -04:00
import { doUserIdentityVerify } from "actions/user";
import rewards from "rewards";
import { makeSelectRewardByType } from "selectors/rewards";
2017-06-02 19:09:52 -04:00
import {
2017-07-18 19:00:13 -04:00
selectIdentityVerifyIsPending,
selectIdentityVerifyErrorMessage,
2017-06-07 20:56:52 -04:00
} from "selectors/user";
2017-07-16 12:29:46 -04:00
import UserVerify from "./view";
2017-06-02 19:09:52 -04:00
2017-07-18 19:00:13 -04: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-02 19:09:52 -04:00
2017-06-07 20:56:52 -04:00
const perform = dispatch => ({
2017-08-02 19:37:38 -04:00
navigate: (uri) => dispatch(doNavigate(uri)),
2017-07-18 19:00:13 -04:00
verifyUserIdentity: token => dispatch(doUserIdentityVerify(token)),
2017-06-07 20:56:52 -04:00
});
2017-06-02 19:09:52 -04:00
2017-07-16 12:29:46 -04:00
export default connect(select, perform)(UserVerify);