mirror of
https://github.com/ecency/ecency-mobile.git
synced 2025-01-04 12:05:54 +03:00
Added user avatar to pin code screen
This commit is contained in:
parent
486a286108
commit
200da3eedc
@ -12,6 +12,8 @@ import { default as INITIAL } from '../../../constants/initial';
|
|||||||
|
|
||||||
import { PinCodeScreen } from '..';
|
import { PinCodeScreen } from '..';
|
||||||
|
|
||||||
|
const DEFAULT_IMAGE = require('../../../assets/esteem.png');
|
||||||
|
|
||||||
class PinCodeContainer extends Component {
|
class PinCodeContainer extends Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
@ -117,6 +119,16 @@ class PinCodeContainer extends Component {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
_getUserAvatar = () => {
|
||||||
|
const { currentAccount } = this.props;
|
||||||
|
if (Object.keys(currentAccount).length === 0) return DEFAULT_IMAGE;
|
||||||
|
if (Object.keys(currentAccount.about).length === 0) return DEFAULT_IMAGE;
|
||||||
|
if (Object.keys(currentAccount.about.profile).length !== 0) {
|
||||||
|
return { uri: currentAccount.about.profile.profile_image };
|
||||||
|
}
|
||||||
|
return DEFAULT_IMAGE;
|
||||||
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { currentAccount } = this.props;
|
const { currentAccount } = this.props;
|
||||||
const { informationText, isExistUser } = this.state;
|
const { informationText, isExistUser } = this.state;
|
||||||
@ -126,6 +138,7 @@ class PinCodeContainer extends Component {
|
|||||||
setPinCode={this._setPinCode}
|
setPinCode={this._setPinCode}
|
||||||
showForgotButton={isExistUser}
|
showForgotButton={isExistUser}
|
||||||
username={currentAccount ? currentAccount.name : 'unknow'}
|
username={currentAccount ? currentAccount.name : 'unknow'}
|
||||||
|
avatar={this._getUserAvatar()}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import { Text, TouchableOpacity, View } from 'react-native';
|
import { Text, TouchableOpacity, View } from 'react-native';
|
||||||
import { Container } from 'native-base';
|
import { Container, Thumbnail } from 'native-base';
|
||||||
|
|
||||||
import { Logo, NumericKeyboard, PinAnimatedInput } from '../../../components';
|
import { NumericKeyboard, PinAnimatedInput } from '../../../components';
|
||||||
|
|
||||||
import styles from './pinCodeStyles';
|
import styles from './pinCodeStyles';
|
||||||
|
|
||||||
@ -46,13 +46,15 @@ class PinCodeScreen extends Component {
|
|||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { informationText, showForgotButton, username } = this.props;
|
const {
|
||||||
|
informationText, showForgotButton, username, avatar,
|
||||||
|
} = this.props;
|
||||||
const { pin } = this.state;
|
const { pin } = this.state;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Container style={styles.container}>
|
<Container style={styles.container}>
|
||||||
<View style={styles.logoView}>
|
<View style={styles.logoView}>
|
||||||
<Logo style={styles.logo} />
|
<Thumbnail source={avatar} />
|
||||||
</View>
|
</View>
|
||||||
<View style={styles.titleView}>
|
<View style={styles.titleView}>
|
||||||
<Text style={styles.title}>{`@${username}`}</Text>
|
<Text style={styles.title}>{`@${username}`}</Text>
|
||||||
|
@ -7,6 +7,8 @@ export default EStyleSheet.create({
|
|||||||
},
|
},
|
||||||
logoView: {
|
logoView: {
|
||||||
flex: 2,
|
flex: 2,
|
||||||
|
justifyContent: 'center',
|
||||||
|
alignItems: 'center',
|
||||||
},
|
},
|
||||||
logo: {
|
logo: {
|
||||||
width: '$deviceWidth / 7',
|
width: '$deviceWidth / 7',
|
||||||
|
Loading…
Reference in New Issue
Block a user