emoji resouce CDN format override

This commit is contained in:
waltcow 2023-04-05 15:29:25 +08:00 committed by GitHub
parent 4542c18385
commit 91322f33eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,6 @@
import { useState, useEffect, useMemo, HTMLProps } from "react"; 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"; import styles from "./settings.module.scss";
@ -181,6 +181,9 @@ export function Settings(props: { closeSettings: () => void }) {
<EmojiPicker <EmojiPicker
lazyLoadEmojis lazyLoadEmojis
theme={EmojiTheme.AUTO} 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) => { onEmojiClick={(e) => {
updateConfig((config) => (config.avatar = e.unified)); updateConfig((config) => (config.avatar = e.unified));
setShowEmojiPicker(false); setShowEmojiPicker(false);