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

34 lines
885 B
JavaScript
Raw Normal View History

import * as MODALS from 'constants/modal_types';
import { connect } from 'react-redux';
import { doOpenModal } from 'redux/actions/app';
2017-06-03 01:09:52 +02:00
import {
2018-09-24 05:44:42 +02:00
doUserIdentityVerify,
doUserFetch,
2018-09-24 05:44:42 +02:00
rewards,
makeSelectRewardByType,
2017-07-19 01:00:13 +02:00
selectIdentityVerifyIsPending,
selectIdentityVerifyErrorMessage,
2018-09-24 05:44:42 +02:00
} from 'lbryinc';
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
2018-09-24 05:44:42 +02:00
export default connect(
select,
perform
)(UserVerify);