sforkowany z mirror/soapbox
initial changes for fixing image locations
rodzic
b7b0ad06dc
commit
317672e6ec
|
@ -3,11 +3,21 @@ import React, { useRef, useEffect } from 'react';
|
||||||
|
|
||||||
import data from './data';
|
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) {
|
function Picker(props: PickerProps) {
|
||||||
const ref = useRef(null);
|
const ref = useRef(null);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const input = { ...props, data, ref };
|
const input = { ...props, data, ref, getImageURL, getSpritesheetURL };
|
||||||
|
|
||||||
new EmojiPicker(input);
|
new EmojiPicker(input);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
|
@ -112,7 +112,7 @@
|
||||||
"cssnano": "^5.1.10",
|
"cssnano": "^5.1.10",
|
||||||
"detect-passive-events": "^2.0.0",
|
"detect-passive-events": "^2.0.0",
|
||||||
"dotenv": "^8.0.0",
|
"dotenv": "^8.0.0",
|
||||||
"emoji-datasource": "5.0.0",
|
"emoji-datasource": "14.0.0",
|
||||||
"emoji-mart": "^5.1.0",
|
"emoji-mart": "^5.1.0",
|
||||||
"es6-symbol": "^3.1.1",
|
"es6-symbol": "^3.1.1",
|
||||||
"escape-html": "^1.0.3",
|
"escape-html": "^1.0.3",
|
||||||
|
|
|
@ -44,6 +44,8 @@ declare module 'emoji-mart' {
|
||||||
navPosition?: string,
|
navPosition?: string,
|
||||||
autoFocus?: boolean,
|
autoFocus?: boolean,
|
||||||
i18n?: any,
|
i18n?: any,
|
||||||
|
getImageURL: (set: string, name: string) => string,
|
||||||
|
getSpritesheetURL: (set: string) => string,
|
||||||
}
|
}
|
||||||
|
|
||||||
export class Picker {
|
export class Picker {
|
||||||
|
|
|
@ -4993,10 +4993,10 @@ emittery@^0.10.2:
|
||||||
resolved "https://registry.yarnpkg.com/emittery/-/emittery-0.10.2.tgz#902eec8aedb8c41938c46e9385e9db7e03182933"
|
resolved "https://registry.yarnpkg.com/emittery/-/emittery-0.10.2.tgz#902eec8aedb8c41938c46e9385e9db7e03182933"
|
||||||
integrity sha512-aITqOwnLanpHLNXZJENbOgjUBeHocD+xsSJmNrjovKBW5HbSpW3d1pEls7GFQPUWXiwG9+0P4GtHfEqC/4M0Iw==
|
integrity sha512-aITqOwnLanpHLNXZJENbOgjUBeHocD+xsSJmNrjovKBW5HbSpW3d1pEls7GFQPUWXiwG9+0P4GtHfEqC/4M0Iw==
|
||||||
|
|
||||||
emoji-datasource@5.0.0:
|
emoji-datasource@14.0.0:
|
||||||
version "5.0.0"
|
version "14.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/emoji-datasource/-/emoji-datasource-5.0.0.tgz#1522fdba3c52223a1cf5a1c1fc282935400eaa06"
|
resolved "https://registry.yarnpkg.com/emoji-datasource/-/emoji-datasource-14.0.0.tgz#99529a62f3a86546fc670c09b672ddc9f24f3d44"
|
||||||
integrity sha512-LuvLWFnxznTH++GytEzpzOPUo1SB+6CUFqIlVETJJ3x9fpyMCKFfyqberbhMLOpT1qcNe+km+zoyBeUSC3u5Rw==
|
integrity sha512-SoOv0lSa+9/2X9ulSRDhu2u1zAOaOv5vtMY3OYUDcQCoReEh0/3eQAMuBM9LyD7Hy3G4K7mDPDqVeHUWvy7cow==
|
||||||
|
|
||||||
emoji-mart@^5.1.0:
|
emoji-mart@^5.1.0:
|
||||||
version "5.1.0"
|
version "5.1.0"
|
||||||
|
|
Ładowanie…
Reference in New Issue