2020-01-14 21:44:07 +01:00
|
|
|
import { connect } from 'react-redux';
|
|
|
|
import { doHideModal } from 'redux/actions/app';
|
2020-06-15 22:33:03 +02:00
|
|
|
import { selectSetReferrerError, selectSetReferrerPending } from 'redux/selectors/user';
|
|
|
|
import { doUserSetReferrer, doUserSetReferrerReset } from 'redux/actions/user';
|
2020-01-14 21:44:07 +01:00
|
|
|
import ModalSetReferrer from './view';
|
|
|
|
|
|
|
|
const select = state => ({
|
|
|
|
referrerSetPending: selectSetReferrerPending(state),
|
|
|
|
referrerSetError: selectSetReferrerError(state),
|
|
|
|
});
|
|
|
|
|
|
|
|
const perform = dispatch => ({
|
|
|
|
closeModal: () => dispatch(doHideModal()),
|
|
|
|
setReferrer: (referrer, doClaim) => dispatch(doUserSetReferrer(referrer, doClaim)),
|
2020-01-17 03:14:07 +01:00
|
|
|
resetReferrerError: () => dispatch(doUserSetReferrerReset()),
|
2020-01-14 21:44:07 +01:00
|
|
|
});
|
|
|
|
|
2020-06-15 22:33:03 +02:00
|
|
|
export default connect(select, perform)(ModalSetReferrer);
|