Simplify logic

This commit is contained in:
Gerzon Z 2021-09-17 16:22:02 -04:00
parent cc07128eb1
commit ec665e0bdb
3 changed files with 15 additions and 18 deletions

View File

@ -93,21 +93,12 @@ const ThreadDetails = ({ item, user, badgeColor, toggleFollowThread, thread, tim
</Text> </Text>
</View> </View>
{thread ? ( <View style={styles.detailContainer}>
<View style={styles.detailContainer}> <CustomIcon name={thread ? 'user' : 'clock'} size={24} color={themes[theme].auxiliaryText} />
<CustomIcon name='user' size={24} color={themes[theme].auxiliaryText} /> <Text style={[styles.detailText, { color: themes[theme].auxiliaryText }]} numberOfLines={1}>
<Text style={[styles.detailText, { color: themes[theme].auxiliaryText }]} numberOfLines={1}> {thread ? replies : time}
{replies} </Text>
</Text> </View>
</View>
) : (
<View style={styles.detailContainer}>
<CustomIcon name='clock' size={24} color={themes[theme].auxiliaryText} />
<Text style={[styles.detailText, { color: themes[theme].auxiliaryText }]} numberOfLines={1}>
{time}
</Text>
</View>
)}
</View> </View>
{thread ? ( {thread ? (

View File

@ -74,7 +74,6 @@ class RoomActionsView extends React.Component {
const member = props.route.params?.member; const member = props.route.params?.member;
this.rid = props.route.params?.rid; this.rid = props.route.params?.rid;
this.t = props.route.params?.t; this.t = props.route.params?.t;
this.navToRoomInfo = props.route.params?.navToRoomInfo;
this.state = { this.state = {
room: room || { rid: this.rid, t: this.t }, room: room || { rid: this.rid, t: this.t },
membersCount: 0, membersCount: 0,

View File

@ -439,12 +439,19 @@ class RoomView extends React.Component {
navigation.navigate('ModalStackNavigator', { navigation.navigate('ModalStackNavigator', {
screen: screen ?? 'RoomActionsView', screen: screen ?? 'RoomActionsView',
params: { params: {
rid: this.rid, t: this.t, room, member, showCloseModal: !!screen, navToRoomInfo: navParam => this.navToRoomInfo(navParam) rid: this.rid,
t: this.t,
room,
member,
showCloseModal: !!screen
} }
}); });
} else { } else {
navigation.push('RoomActionsView', { navigation.push('RoomActionsView', {
rid: this.rid, t: this.t, room, member, navToRoomInfo: navParam => this.navToRoomInfo(navParam) rid: this.rid,
t: this.t,
room,
member
}); });
} }
}; };