pinafore/src/routes/_utils/convertCustomEmojiToEmojiPickerFormat.js
Nolan Lawson 1371175bce
feat: use emoji-picker-element, add emoji autocompletions/tooltips (#1804)
* feat: use emoji-picker-element, add emoji autocompletions/tooltips

* fix: fix lint bug

* test: fix emoji in chrome on linux in travis

* test: try bionic in travis

* chore: try to fix travis

* chore: try to fix travis

* fix: filter unsupported emoji

* chore: try to fix travis

* chore: try to fix travis

* chore: try to fix travis

* chore: try to fix travis

* Revert "chore: try to fix travis"

This reverts commit 3cd2d94469b2f1a20c847c2a69e088d7c8d1efdd.

* fix: fix emoji autosuggest

* test: fix test
2020-06-28 23:12:14 -07:00

12 lines
355 B
JavaScript

export function convertCustomEmojiToEmojiPickerFormat (customEmoji, autoplayGifs) {
if (!customEmoji) {
return []
}
return customEmoji.filter(emoji => emoji.visible_in_picker).map(emoji => ({
name: emoji.shortcode,
shortcodes: [emoji.shortcode],
url: autoplayGifs ? emoji.url : emoji.static_url,
category: emoji.category
}))
}