summaryrefslogtreecommitdiffstats
path: root/ui/src/components/comment-form.tsx
diff options
context:
space:
mode:
authorDessalines <tyhou13@gmx.com>2020-04-12 14:55:52 -0400
committerDessalines <tyhou13@gmx.com>2020-04-12 14:55:52 -0400
commit676690097f0e781dfca2704b1ee88e5a7dfeb91c (patch)
treed0908103048d6cc026d433b23943b63bb1137088 /ui/src/components/comment-form.tsx
parenta26bff69212ba48bd8a89d7985ccf82d223597d5 (diff)
Use twemoji style for emoji picker.
Diffstat (limited to 'ui/src/components/comment-form.tsx')
-rw-r--r--ui/src/components/comment-form.tsx7
1 files changed, 5 insertions, 2 deletions
diff --git a/ui/src/components/comment-form.tsx b/ui/src/components/comment-form.tsx
index 6898ebc7..5239eb2c 100644
--- a/ui/src/components/comment-form.tsx
+++ b/ui/src/components/comment-form.tsx
@@ -230,11 +230,14 @@ export class CommentForm extends Component<CommentFormProps, CommentFormState> {
}
setupEmojiPicker() {
- emojiPicker.on('emoji', emoji => {
+ emojiPicker.on('emoji', twemojiHtmlStr => {
if (this.state.commentForm.content == null) {
this.state.commentForm.content = '';
}
- let shortName = `:${emojiShortName[emoji]}:`;
+ var el = document.createElement('div');
+ el.innerHTML = twemojiHtmlStr;
+ let nativeUnicode = (el.childNodes[0] as HTMLElement).getAttribute('alt');
+ let shortName = `:${emojiShortName[nativeUnicode]}:`;
this.state.commentForm.content += shortName;
this.setState(this.state);
});