소스 검색

emoji resouce CDN format override

waltcow 1 년 전
부모
커밋
91322f33eb
1개의 변경된 파일4개의 추가작업 그리고 1개의 파일을 삭제
  1. 4 1
      app/components/settings.tsx

+ 4 - 1
app/components/settings.tsx

@@ -1,6 +1,6 @@
 import { useState, useEffect, useMemo, HTMLProps } from "react";
 
-import EmojiPicker, { Theme as EmojiTheme } from "emoji-picker-react";
+import EmojiPicker, { Theme as EmojiTheme, EmojiStyle, } from "emoji-picker-react";
 
 import styles from "./settings.module.scss";
 
@@ -181,6 +181,9 @@ export function Settings(props: { closeSettings: () => void }) {
                 <EmojiPicker
                   lazyLoadEmojis
                   theme={EmojiTheme.AUTO}
+                  getEmojiUrl={(unified: string, style: EmojiStyle) => {
+                    return `https://cdn.staticfile.org/emoji-datasource-apple/14.0.0/img/${style}/64/${unified}.png`;
+                  }}
                   onEmojiClick={(e) => {
                     updateConfig((config) => (config.avatar = e.unified));
                     setShowEmojiPicker(false);