96 lines
2.7 KiB
JavaScript
96 lines
2.7 KiB
JavaScript
import React, { Component } from 'react';
|
|
import PropTypes from 'prop-types';
|
|
import { Text, View } from 'react-native';
|
|
|
|
import ProfileUtility from '../components/Profile/Profile.container.js';
|
|
|
|
import styles from './Profile.styles.js';
|
|
|
|
const STRINGS = {
|
|
EMAIL_NEEDS_VERIFICATION: 'Your acount has not been verified, please check your email.',
|
|
};
|
|
|
|
export default class Profile extends Component {
|
|
static get propTypes() {
|
|
return {
|
|
hasLinkedApple: PropTypes.bool,
|
|
hasLinkedFacebook: PropTypes.bool,
|
|
hasLinkedGoogle: PropTypes.bool,
|
|
hasLocalAccount: PropTypes.bool,
|
|
isAllowedToBid: PropTypes.bool,
|
|
isVerified: PropTypes.bool,
|
|
paymentToken: PropTypes.string,
|
|
updateProfile: PropTypes.func.isRequired,
|
|
};
|
|
}
|
|
|
|
static get defaultProps() {
|
|
return {
|
|
hasLinkedApple: false,
|
|
hasLinkedFacebook: false,
|
|
hasLinkedGoogle: false,
|
|
hasLocalAccount: false,
|
|
isAllowedToBid: false,
|
|
isVerified: false,
|
|
paymentToken: null,
|
|
};
|
|
}
|
|
|
|
render() {
|
|
const {
|
|
hasLinkedApple,
|
|
hasLinkedFacebook,
|
|
hasLinkedGoogle,
|
|
hasLocalAccount,
|
|
isAllowedToBid,
|
|
isVerified,
|
|
paymentToken,
|
|
updateProfile,
|
|
} = this.props;
|
|
|
|
return (
|
|
<View style={styles.container}>
|
|
{!isVerified && (
|
|
<View style={styles.alertBar}>
|
|
<Text style={styles.alert}>{STRINGS.EMAIL_NEEDS_VERIFICATION}</Text>
|
|
</View>
|
|
)}
|
|
|
|
<ProfileUtility
|
|
cancelEditAction={() => false}
|
|
saveProfileAction={updateProfile}
|
|
saveProfileLabel="Update profile"
|
|
/>
|
|
|
|
{!isAllowedToBid ? (
|
|
/* ADD PAYMENT METHOD */
|
|
<View />
|
|
) : (
|
|
/* SHOW/EDIT PAYMENT METHOD */
|
|
<View />
|
|
)}
|
|
|
|
{!hasLocalAccount && (
|
|
/* CREATE LOCAL ACCOUNT PASSWORD CTA */
|
|
<View />
|
|
)}
|
|
|
|
{hasLinkedApple && (
|
|
/* APPLE LINK/UNLINK */
|
|
<View />
|
|
)}
|
|
|
|
{hasLinkedFacebook && (
|
|
/* FACEBOOK LINK/UNLINK */
|
|
<View />
|
|
)}
|
|
|
|
{hasLinkedGoogle && (
|
|
/* GOOGLE LINK/UNLINK */
|
|
<View />
|
|
)}
|
|
</View>
|
|
);
|
|
}
|
|
}
|