Simplify logic
This commit is contained in:
parent
cc07128eb1
commit
ec665e0bdb
|
@ -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 ? (
|
||||||
|
|
|
@ -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,
|
||||||
|
|
|
@ -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
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue