bigbuffet-rw/app/soapbox/features/emoji/emoji_picker.tsx
ewwwwwwww 3725db9789 oops
2022-07-09 15:36:24 -07:00

30 lines
600 B
TypeScript

import { Picker as EmojiPicker, PickerProps } from 'emoji-mart';
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/emoji/${name}.svg`;
}
function Picker(props: PickerProps) {
const ref = useRef(null);
useEffect(() => {
const input = { ...props, data, ref, getImageURL, getSpritesheetURL };
new EmojiPicker(input);
}, []);
return <div ref={ref} />;
}
export {
Picker,
};