bigbuffet-rw/app/soapbox/features/emoji/emoji_picker.tsx

35 lines
553 B
TypeScript
Raw Normal View History

2022-06-25 20:55:17 -07:00
import { Picker as EmojiPicker, PickerProps } from 'emoji-mart';
2022-06-23 19:41:48 -07:00
import React, { useRef, useEffect } from 'react';
2020-03-27 13:59:38 -07:00
2022-07-09 10:02:21 -07:00
import data from './data';
2022-06-23 19:41:48 -07:00
// const categories = [
// 'recent',
// 'custom',
// 'people',
// 'nature',
// 'foods',
// 'activity',
// 'places',
// 'objects',
// 'symbols',
// 'flags',
// ];
2022-06-25 20:55:17 -07:00
//
2022-06-23 19:41:48 -07:00
2022-06-25 20:55:17 -07:00
function Picker(props: PickerProps) {
const ref = useRef(null);
2022-06-23 19:41:48 -07:00
useEffect(() => {
const input = { ...props, data, ref };
new EmojiPicker(input);
}, []);
return <div ref={ref} />;
}
2022-06-25 20:55:17 -07:00
export {
2022-06-29 01:25:57 -07:00
Picker,
};