Files
Eventment/app/screens/Profile.container.js
Mike Fitzpatrick dfc4daf696 - Stuff
2019-08-07 17:49:34 -04:00

31 lines
945 B
JavaScript

import { connect } from 'react-redux';
import { fetchProfile, updateProfile } from '../actions/profile.js';
import { getProfile, isAllowedToBid } from '../selectors/profile.js';
import Profile from './Profile.js';
const matchStateToProps = (state) => {
const profile = getProfile(state);
return {
hasLinkedApple: profile.get('hasLinkedApple'),
hasLinkedFacebook: profile.get('hasLinkedFacebook'),
hasLinkedGoogle: profile.get('hasLinkedGoogle'),
hasLocalAccount: profile.get('hasLocalAccount'),
isAllowedToBid: isAllowedToBid(state),
isVerified: profile.get('isVerified'),
paymentToken: profile.get('paymentToken'),
};
};
const mapDispatchToProps = (dispatch) => ({
fetchProfile: () => dispatch(fetchProfile(dispatch)),
updateProfile: () => dispatch(updateProfile(dispatch)),
});
export default connect(
matchStateToProps,
mapDispatchToProps,
)(Profile);