Skip to content

Commit

Permalink
Merge pull request #3872 from rushatgabhane/noemoji-message
Browse files Browse the repository at this point in the history
Display a message when no emojis are found in search
  • Loading branch information
thienlnam authored Jul 2, 2021
2 parents bfc14ce + 84eb6fd commit b9b7ec4
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 11 deletions.
1 change: 1 addition & 0 deletions src/languages/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export default {
dateFormat: 'YYYY-MM-DD',
send: 'Send',
notifications: 'Notifications',
noResultsFound: 'No results found',
},
attachmentPicker: {
cameraPermissionRequired: 'Camera Permission Required',
Expand Down
1 change: 1 addition & 0 deletions src/languages/es.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export default {
dateFormat: 'AAAA-MM-DD',
send: 'Enviar',
notifications: 'Notificaciones',
noResultsFound: 'No se han encontrado resultados',
},
attachmentPicker: {
cameraPermissionRequired: 'Se necesita permiso para usar la cámara',
Expand Down
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 b9b7ec4

Please sign in to comment.