This commit is contained in:
Mike Fitzpatrick
2019-08-07 17:49:34 -04:00
parent aea9bbda96
commit dfc4daf696
14 changed files with 522 additions and 172 deletions

View File

@@ -1,26 +1,87 @@
import React, { Component } from 'react';
import { StyleSheet, Text, View } from 'react-native';
import { Text, View } from 'react-native';
import ProfileUtility from '../components/Profile/Profile.container.js';
import styles from './Profile.styles.js';
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}>
<Text style={styles.title}>Profile</Text>
{!isVerified && (
<View style={styles.alertBar}>
<Text style={styles.alert}>
{`Your acount has not been verified, please check your email.`}
</Text>
</View>
)}
<ProfileUtility
cancelEditAction={() => false}
saveProfileAction={updateProfile}
saveProfileLabel="Update profile"
/>
{!isAllowedToBid ? (
/* ADD PAYMENT METHOD */
) : (
/* SHOW/EDIT PAYMENT METHOD */
)}
{!hasLocalAccount && (
/* CREATE LOCAL ACCOUNT PASSWORD CTA */
)}
{hasLinkedApple && (
/* APPLE LINK/UNLINK */
)}
{hasLinkedFacebook && (
/* FACEBOOK LINK/UNLINK */
)}
{hasLinkedGoogle && (
/* GOOGLE LINK/UNLINK */
)}
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
title: {
fontSize: 20,
textAlign: 'center',
margin: 10,
},
});