mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-17 10:21:33 +03:00
fixed reblog title after upvode
This commit is contained in:
parent
0521505910
commit
20666fd131
@ -18,10 +18,19 @@ const DEFAULT_IMAGE = require('../../../../assets/esteem.png');
|
|||||||
class PostHeaderDescription extends PureComponent {
|
class PostHeaderDescription extends PureComponent {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
this.state = {};
|
this.state = {
|
||||||
|
reblogedBy: props.reblogedBy || null,
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
// Component Life Cycles
|
// Component Life Cycles
|
||||||
|
componentWillReceiveProps(nextProps) {
|
||||||
|
const { reblogedBy } = this.props;
|
||||||
|
|
||||||
|
if (reblogedBy !== nextProps.reblogedBy && !nextProps.reblogedBy) {
|
||||||
|
this.setState({ reblogedBy });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Component Functions
|
// Component Functions
|
||||||
_handleOnUserPress = (username) => {
|
_handleOnUserPress = (username) => {
|
||||||
@ -43,16 +52,9 @@ class PostHeaderDescription extends PureComponent {
|
|||||||
|
|
||||||
render() {
|
render() {
|
||||||
const {
|
const {
|
||||||
avatar,
|
avatar, date, isHideImage, name, reputation, size, tag, tagOnPress,
|
||||||
date,
|
|
||||||
isHideImage,
|
|
||||||
name,
|
|
||||||
reblogedBy,
|
|
||||||
reputation,
|
|
||||||
size,
|
|
||||||
tag,
|
|
||||||
tagOnPress,
|
|
||||||
} = this.props;
|
} = this.props;
|
||||||
|
const { reblogedBy } = this.state;
|
||||||
|
|
||||||
const _reputationText = `(${reputation})`;
|
const _reputationText = `(${reputation})`;
|
||||||
let _avatar;
|
let _avatar;
|
||||||
@ -85,7 +87,9 @@ class PostHeaderDescription extends PureComponent {
|
|||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
)}
|
)}
|
||||||
<Text style={styles.date}>{date}</Text>
|
<Text style={styles.date}>{date}</Text>
|
||||||
{!!reblogedBy && <TextWithIcon text={reblogedBy} iconType="MaterialIcons" iconName="repeat" />}
|
{!!reblogedBy && (
|
||||||
|
<TextWithIcon text={reblogedBy} iconType="MaterialIcons" iconName="repeat" />
|
||||||
|
)}
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user