Chats: Don't show group header if none of the filters is selected (#560)
This commit is contained in:
parent
a2821af95b
commit
17da7ac09c
|
@ -502,7 +502,19 @@ export default class RoomsListView extends LoggedView {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
renderSeparator = () => <View style={styles.separator} />;
|
renderSeparator = () => <View style={styles.separator} />
|
||||||
|
|
||||||
|
renderSectionHeader = (header) => {
|
||||||
|
const { showUnread, showFavorites, groupByType } = this.props;
|
||||||
|
if (!(showUnread || showFavorites || groupByType)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return (
|
||||||
|
<View style={styles.groupTitleContainer}>
|
||||||
|
<Text style={styles.groupTitle}>{I18n.t(header)}</Text>
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
renderSection = (data, header) => {
|
renderSection = (data, header) => {
|
||||||
const { showUnread, showFavorites, groupByType } = this.props;
|
const { showUnread, showFavorites, groupByType } = this.props;
|
||||||
|
@ -525,11 +537,7 @@ export default class RoomsListView extends LoggedView {
|
||||||
style={styles.list}
|
style={styles.list}
|
||||||
renderItem={this.renderItem}
|
renderItem={this.renderItem}
|
||||||
ItemSeparatorComponent={this.renderSeparator}
|
ItemSeparatorComponent={this.renderSeparator}
|
||||||
ListHeaderComponent={() => (
|
ListHeaderComponent={() => this.renderSectionHeader(header)}
|
||||||
<View style={styles.groupTitleContainer}>
|
|
||||||
<Text style={styles.groupTitle}>{I18n.t(header)}</Text>
|
|
||||||
</View>
|
|
||||||
)}
|
|
||||||
getItemLayout={getItemLayout}
|
getItemLayout={getItemLayout}
|
||||||
enableEmptySections
|
enableEmptySections
|
||||||
removeClippedSubviews
|
removeClippedSubviews
|
||||||
|
|
Loading…
Reference in New Issue