summaryrefslogtreecommitdiffstats
path: root/ui/src/utils.ts
diff options
context:
space:
mode:
authorDessalines <tyhou13@gmx.com>2020-04-12 12:47:48 -0400
committerDessalines <tyhou13@gmx.com>2020-04-12 12:47:48 -0400
commitd6d040f5da2317af19b3df426556914d1b2a14fe (patch)
tree2a728cae456eef538b7e6c1df4a515ce6396e95e /ui/src/utils.ts
parented264aba3c12243352f68c2de6a5f21f23778bd0 (diff)
Add Emoji squashed commit.
Diffstat (limited to 'ui/src/utils.ts')
-rw-r--r--ui/src/utils.ts14
1 files changed, 12 insertions, 2 deletions
diff --git a/ui/src/utils.ts b/ui/src/utils.ts
index ceb05764..fd23bf9e 100644
--- a/ui/src/utils.ts
+++ b/ui/src/utils.ts
@@ -43,6 +43,7 @@ import twemoji from 'twemoji';
import emojiShortName from 'emoji-short-name';
import Toastify from 'toastify-js';
import tippy from 'tippy.js';
+import EmojiButton from '@joeattardi/emoji-button';
export const repoUrl = 'https://github.com/LemmyNet/lemmy';
export const helpGuideUrl = '/docs/about_guide.html';
@@ -88,6 +89,14 @@ export const themes = [
'i386',
];
+export const emojiPicker = new EmojiButton({
+ // Use the emojiShortName from native
+ // style: 'twemoji',
+ theme: 'dark',
+ position: 'auto-start',
+ // TODO i18n
+});
+
export function randomStr() {
return Math.random()
.toString(36)
@@ -473,8 +482,9 @@ export function setupTribute(): Tribute {
{
trigger: ':',
menuItemTemplate: (item: any) => {
- let emoji = `:${item.original.key}:`;
- return `${item.original.val} ${emoji}`;
+ let shortName = `:${item.original.key}:`;
+ let twemojiIcon = twemoji.parse(item.original.val);
+ return `${twemojiIcon} ${shortName}`;
},
selectTemplate: (item: any) => {
return `:${item.original.key}:`;