props.onPick(emoji.aliases[0])}
+ />
+ )}
>
);
};
const Emoji = (props) => {
const emoji = props.emoji;
+ const search = props.search;
+ const matches = search === ""
+ || emoji.description.toLowerCase().indexOf(search) !== -1
+ || matchInArray(emoji.aliases, search)
+ || matchInArray(emoji.tags, search);
+ if (!matches) {
+ return null;
+ }
return (
{
);
};
+const matchInArray = (arr, search) => {
+ if (!arr || !search) {
+ return false;
+ }
+ return arr.filter(s => s.indexOf(search) !== -1).length > 0;
+}
+
export default EmojiPicker;
diff --git a/web/src/components/SendDialog.js b/web/src/components/SendDialog.js
index 0607c9a3..1a55d127 100644
--- a/web/src/components/SendDialog.js
+++ b/web/src/components/SendDialog.js
@@ -213,11 +213,11 @@ const SendDialog = (props) => {
onDragLeave={handleAttachFileDragLeave}/>
}