From 2aa5e8b33b40a05958dd3fc414aaa56e8e165ad0 Mon Sep 17 00:00:00 2001 From: Rushat Gabhane Date: Fri, 2 Jul 2021 23:42:51 +0300 Subject: [PATCH 1/2] add noResultsFound to language --- src/languages/en.js | 1 + src/languages/es.js | 1 + 2 files changed, 2 insertions(+) diff --git a/src/languages/en.js b/src/languages/en.js index af61f6eaaa0c..0b316443e336 100755 --- a/src/languages/en.js +++ b/src/languages/en.js @@ -55,6 +55,7 @@ export default { dateFormat: 'YYYY-MM-DD', send: 'Send', notifications: 'Notifications', + noResultsFound: 'No results found', }, attachmentPicker: { cameraPermissionRequired: 'Camera Permission Required', diff --git a/src/languages/es.js b/src/languages/es.js index 2d160b5fd3d7..4f12de92ede9 100644 --- a/src/languages/es.js +++ b/src/languages/es.js @@ -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', From 84eb6fd776db2149c4c0b71de4315ee6bd3c4e7e Mon Sep 17 00:00:00 2001 From: Rushat Gabhane Date: Fri, 2 Jul 2021 23:44:09 +0300 Subject: [PATCH 2/2] display message when no emojis found --- .../home/report/EmojiPickerMenu/index.js | 39 +++++++++++++------ 1 file changed, 28 insertions(+), 11 deletions(-) diff --git a/src/pages/home/report/EmojiPickerMenu/index.js b/src/pages/home/report/EmojiPickerMenu/index.js index d7d19762a1b6..cdf8a5905e02 100755 --- a/src/pages/home/report/EmojiPickerMenu/index.js +++ b/src/pages/home/report/EmojiPickerMenu/index.js @@ -326,17 +326,34 @@ class EmojiPickerMenu extends Component { /> )} - 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 + ? ( + + {this.props.translate('common.noResultsFound')} + + ) + : ( + 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} + /> + )} ); }