2018-10-29 13:23:53 -04:00
|
|
|
import * as MODALS from 'constants/modal_types';
|
2017-12-21 18:08:54 -03:00
|
|
|
import { connect } from 'react-redux';
|
2018-10-29 13:23:53 -04:00
|
|
|
import { doOpenModal } from 'redux/actions/app';
|
2017-06-02 19:09:52 -04:00
|
|
|
import {
|
2018-09-23 23:44:42 -04:00
|
|
|
doUserIdentityVerify,
|
2019-10-14 15:54:06 -04:00
|
|
|
doUserFetch,
|
2018-09-23 23:44:42 -04:00
|
|
|
rewards,
|
|
|
|
makeSelectRewardByType,
|
2017-07-18 19:00:13 -04:00
|
|
|
selectIdentityVerifyIsPending,
|
|
|
|
selectIdentityVerifyErrorMessage,
|
2018-09-23 23:44:42 -04:00
|
|
|
} from 'lbryinc';
|
2017-12-21 18:08:54 -03:00
|
|
|
import UserVerify from './view';
|
2017-06-02 19:09:52 -04:00
|
|
|
|
2018-05-17 16:31:49 -04:00
|
|
|
const select = state => {
|
2017-07-18 19:00:13 -04:00
|
|
|
const selectReward = makeSelectRewardByType();
|
|
|
|
|
|
|
|
return {
|
|
|
|
isPending: selectIdentityVerifyIsPending(state),
|
|
|
|
errorMessage: selectIdentityVerifyErrorMessage(state),
|
2018-05-17 16:31:49 -04:00
|
|
|
reward: selectReward(state, rewards.TYPE_NEW_USER),
|
2017-07-18 19:00:13 -04:00
|
|
|
};
|
|
|
|
};
|
2017-06-02 19:09:52 -04:00
|
|
|
|
2017-06-07 20:56:52 -04:00
|
|
|
const perform = dispatch => ({
|
2017-07-18 19:00:13 -04:00
|
|
|
verifyUserIdentity: token => dispatch(doUserIdentityVerify(token)),
|
2018-10-29 13:23:53 -04:00
|
|
|
verifyPhone: () => dispatch(doOpenModal(MODALS.PHONE_COLLECTION)),
|
2019-10-14 15:54:06 -04:00
|
|
|
fetchUser: () => dispatch(doUserFetch()),
|
2017-06-07 20:56:52 -04:00
|
|
|
});
|
2017-06-02 19:09:52 -04:00
|
|
|
|
2018-09-23 23:44:42 -04:00
|
|
|
export default connect(
|
|
|
|
select,
|
|
|
|
perform
|
|
|
|
)(UserVerify);
|