Skip to content

Commit

Permalink
display message when no emojis found
Browse files Browse the repository at this point in the history
  • Loading branch information
rushatgabhane committed Jul 2, 2021
1 parent 2aa5e8b commit 84eb6fd
Showing 1 changed file with 28 additions and 11 deletions.
39 changes: 28 additions & 11 deletions src/pages/home/report/EmojiPickerMenu/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -326,17 +326,34 @@ class EmojiPickerMenu extends Component {
/>
</View>
)}
<FlatList
ref={el => this.emojiList = el}
data={this.state.filteredEmojis}
renderItem={this.renderItem}
keyExtractor={item => `emoji_picker_${item.code}`}
numColumns={this.numColumns}
style={styles.emojiPickerList}
extraData={[this.state.filteredEmojis, this.state.highlightedIndex]}
stickyHeaderIndices={this.state.headerIndices}
onScroll={e => this.currentScrollOffset = e.nativeEvent.contentOffset.y}
/>
{this.state.filteredEmojis.length === 0
? (
<Text
style={[
styles.textP,
styles.disabledText,
styles.emojiPickerList,
styles.dFlex,
styles.alignItemsCenter,
styles.justifyContentCenter,
]}
>
{this.props.translate('common.noResultsFound')}
</Text>
)
: (
<FlatList
ref={el => this.emojiList = el}
data={this.state.filteredEmojis}
renderItem={this.renderItem}
keyExtractor={item => `emoji_picker_${item.code}`}
numColumns={this.numColumns}
style={styles.emojiPickerList}
extraData={[this.state.filteredEmojis, this.state.highlightedIndex]}
stickyHeaderIndices={this.state.headerIndices}
onScroll={e => this.currentScrollOffset = e.nativeEvent.contentOffset.y}
/>
)}
</View>
);
}
Expand Down

0 comments on commit 84eb6fd

Please sign in to comment.