Просмотр исходного кода

faet: fix emoji preview

https://youtrack.weseek.co.jp/issue/GW-7732
- Change emoji preview as native instead of colons
- Update Emoji picker set as default
I Komang Mudana 4 лет назад
Родитель
Сommit
2066ec3650

+ 1 - 1
packages/app/src/components/PageEditor/EmojiPicker.tsx

@@ -56,7 +56,7 @@ const EmojiPicker: FC<Props> = (props: Props) => {
   return (
     <div className="overlay">
       <div ref={emojiPickerContainer}>
-        <Picker set="apple" autoFocus onSelect={selectEmoji} i18n={translation} title={translation.title} />
+        <Picker autoFocus onSelect={selectEmoji} i18n={translation} title={translation.title} />
       </div>
     </div>
   );

+ 2 - 2
packages/app/src/components/PageEditor/EmojiPickerHelper.ts

@@ -23,7 +23,7 @@ addEmojiOnSearch = (emoji) => {
   const currentPos = this.editor.getCursor();
   const sc = this.getSearchCursor();
   if (sc.findPrevious()) {
-    sc.replace(emoji.colons, this.editor.getTokenAt(currentPos).string);
+    sc.replace(emoji.native, this.editor.getTokenAt(currentPos).string);
     this.editor.focus();
     this.editor.refresh();
   }
@@ -34,7 +34,7 @@ addEmojiOnSearch = (emoji) => {
 addEmoji = (emoji) => {
   const currentPos = this.editor.getCursor();
   const doc = this.editor.getDoc();
-  doc.replaceRange(emoji.colons, currentPos);
+  doc.replaceRange(emoji.native, currentPos);
   this.editor.focus();
   this.editor.refresh();
 }