about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/util
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2019-06-28 15:54:10 +0200
committerThibaut Girka <thib@sitedethib.com>2019-06-28 21:42:37 +0200
commit662252c8f77e8dd8fd015bc6ece0943f068b1710 (patch)
tree4b3301453fc3f8bcfe412a5e1bb967ec5c3414c6 /app/javascript/flavours/glitch/util
parent4d964398dede71a0512430d904951cff2c7f58c5 (diff)
[Glitch] Add categories for custom emojis
Port front-end changes from e64e6a03dd1e0978fee48f0596dcfbc7fd29958f to glitch-soc

Signed-off-by: Thibaut Girka <thib@sitedethib.com>
Diffstat (limited to 'app/javascript/flavours/glitch/util')
-rw-r--r--app/javascript/flavours/glitch/util/emoji/index.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/app/javascript/flavours/glitch/util/emoji/index.js b/app/javascript/flavours/glitch/util/emoji/index.js
index 82a1ef89c..e6fcaf0dc 100644
--- a/app/javascript/flavours/glitch/util/emoji/index.js
+++ b/app/javascript/flavours/glitch/util/emoji/index.js
@@ -93,8 +93,11 @@ export const buildCustomEmojis = (customEmojis) => {
       keywords: [name],
       imageUrl: url,
       custom: true,
+      customCategory: emoji.get('category'),
     });
   });
 
   return emojis;
 };
+
+export const categoriesFromEmojis = customEmojis => customEmojis.reduce((set, emoji) => set.add(emoji.get('category') ? `custom-${emoji.get('category')}` : 'custom'), new Set());