- Stuff
This commit is contained in:
@@ -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,
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user