This repository has been archived on 2024-10-29. You can view files and clone it, but cannot push or open issues or pull requests.
website/components/Emoji/EmojiPicker.tsx
2021-10-24 05:19:39 +02:00

29 lines
618 B
TypeScript

import 'emoji-mart/css/emoji-mart.css'
import { EmojiData, Picker } from 'emoji-mart'
import { useTheme } from 'contexts/Theme'
import { emojiSet } from './emojiPlugin'
export type EmojiPickerOnClick = (
emoji: EmojiData,
event: React.MouseEvent<HTMLElement, MouseEvent>
) => void
export interface EmojiPickerProps {
onClick: EmojiPickerOnClick
}
export const EmojiPicker: React.FC<EmojiPickerProps> = (props) => {
const { theme } = useTheme()
return (
<Picker
set={emojiSet}
theme={theme}
onClick={props.onClick}
showPreview={false}
showSkinTones={false}
/>
)
}