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);