This commit is contained in:
Guilherme Gazzo 2017-11-19 01:41:58 -02:00
parent cfd90b14f9
commit bb5978444c
1 changed files with 1 additions and 12 deletions

View File

@ -120,24 +120,13 @@ export default class RoomItem extends React.PureComponent {
render() { render() {
const { unread, name, _updatedAt } = this.props; const { unread, name, _updatedAt } = this.props;
if (_updatedAt) {
return (
<TouchableOpacity onPress={this.props.onPress} style={styles.container}>
{this.icon}
<View style={styles.roomNameView}>
<Text style={styles.roomName} ellipsizeMode='tail' numberOfLines={1}>{ name }</Text>
<Text style={styles.update} ellipsizeMode='tail' numberOfLines={1}>{ moment(_updatedAt).format(this.props.dateFormat) }</Text>
</View>
{this.renderNumber(unread)}
</TouchableOpacity>
);
}
return ( return (
<TouchableOpacity onPress={this.props.onPress} style={styles.container}> <TouchableOpacity onPress={this.props.onPress} style={styles.container}>
{this.icon} {this.icon}
<View style={styles.roomNameView}> <View style={styles.roomNameView}>
<Text style={styles.roomName} ellipsizeMode='tail' numberOfLines={1}>{ name }</Text> <Text style={styles.roomName} ellipsizeMode='tail' numberOfLines={1}>{ name }</Text>
{_updatedAt ? <Text style={styles.update} ellipsizeMode='tail' numberOfLines={1}>{ moment(_updatedAt).format(this.props.dateFormat) }</Text> : null}
</View> </View>
{this.renderNumber(unread)} {this.renderNumber(unread)}
</TouchableOpacity> </TouchableOpacity>