diff --git a/app/soapbox/features/emoji/emoji_picker.tsx b/app/soapbox/features/emoji/emoji_picker.tsx index 871b0f53f..b02ff9e08 100644 --- a/app/soapbox/features/emoji/emoji_picker.tsx +++ b/app/soapbox/features/emoji/emoji_picker.tsx @@ -3,11 +3,21 @@ import React, { useRef, useEffect } from 'react'; import data from './data'; +const getSpritesheetURL = (set: string) => { + return '/packs/images/32.png'; +} + +const getImageURL = (set: string, name: string) => { + console.log(set, name); + + return `/packs/images/${name}.svg`; +} + function Picker(props: PickerProps) { const ref = useRef(null); useEffect(() => { - const input = { ...props, data, ref }; + const input = { ...props, data, ref, getImageURL, getSpritesheetURL }; new EmojiPicker(input); }, []); diff --git a/package.json b/package.json index 4505ba32f..a4b6e7d97 100644 --- a/package.json +++ b/package.json @@ -112,7 +112,7 @@ "cssnano": "^5.1.10", "detect-passive-events": "^2.0.0", "dotenv": "^8.0.0", - "emoji-datasource": "5.0.0", + "emoji-datasource": "14.0.0", "emoji-mart": "^5.1.0", "es6-symbol": "^3.1.1", "escape-html": "^1.0.3", diff --git a/types/emoji-mart/index.d.ts b/types/emoji-mart/index.d.ts index 19743c939..5726c54f5 100644 --- a/types/emoji-mart/index.d.ts +++ b/types/emoji-mart/index.d.ts @@ -44,6 +44,8 @@ declare module 'emoji-mart' { navPosition?: string, autoFocus?: boolean, i18n?: any, + getImageURL: (set: string, name: string) => string, + getSpritesheetURL: (set: string) => string, } export class Picker { diff --git a/yarn.lock b/yarn.lock index c3edb73ce..2cbda7491 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4993,10 +4993,10 @@ emittery@^0.10.2: resolved "https://registry.yarnpkg.com/emittery/-/emittery-0.10.2.tgz#902eec8aedb8c41938c46e9385e9db7e03182933" integrity sha512-aITqOwnLanpHLNXZJENbOgjUBeHocD+xsSJmNrjovKBW5HbSpW3d1pEls7GFQPUWXiwG9+0P4GtHfEqC/4M0Iw== -emoji-datasource@5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/emoji-datasource/-/emoji-datasource-5.0.0.tgz#1522fdba3c52223a1cf5a1c1fc282935400eaa06" - integrity sha512-LuvLWFnxznTH++GytEzpzOPUo1SB+6CUFqIlVETJJ3x9fpyMCKFfyqberbhMLOpT1qcNe+km+zoyBeUSC3u5Rw== +emoji-datasource@14.0.0: + version "14.0.0" + resolved "https://registry.yarnpkg.com/emoji-datasource/-/emoji-datasource-14.0.0.tgz#99529a62f3a86546fc670c09b672ddc9f24f3d44" + integrity sha512-SoOv0lSa+9/2X9ulSRDhu2u1zAOaOv5vtMY3OYUDcQCoReEh0/3eQAMuBM9LyD7Hy3G4K7mDPDqVeHUWvy7cow== emoji-mart@^5.1.0: version "5.1.0"