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

27 lines
980 B
JavaScript
Raw Permalink Normal View History

import * as MODALS from 'constants/modal_types';
import { connect } from 'react-redux';
import { doOpenModal } from 'redux/actions/app';
import { doUserIdentityVerify, doUserFetch } from 'redux/actions/user';
import { makeSelectRewardByType } from 'redux/selectors/rewards';
import rewards from 'rewards';
import { selectIdentityVerifyIsPending, selectIdentityVerifyErrorMessage } from 'redux/selectors/user';
import UserVerify from './view';
2017-06-03 01:09:52 +02:00
const select = state => {
2017-07-19 01:00:13 +02:00
const selectReward = makeSelectRewardByType();
return {
isPending: selectIdentityVerifyIsPending(state),
errorMessage: selectIdentityVerifyErrorMessage(state),
reward: selectReward(state, rewards.TYPE_NEW_USER),
2017-07-19 01:00:13 +02:00
};
};
2017-06-03 01:09:52 +02:00
2017-06-08 02:56:52 +02:00
const perform = dispatch => ({
2017-07-19 01:00:13 +02:00
verifyUserIdentity: token => dispatch(doUserIdentityVerify(token)),
verifyPhone: () => dispatch(doOpenModal(MODALS.PHONE_COLLECTION)),
fetchUser: () => dispatch(doUserFetch()),
2017-06-08 02:56:52 +02:00
});
2017-06-03 01:09:52 +02:00
export default connect(select, perform)(UserVerify);