feat: Emoji
parent
43c28618a6
commit
d516a2af65
@ -0,0 +1,31 @@
|
||||
import { useState } from 'react';
|
||||
import { Popover, Button } from 'antd';
|
||||
import EmojiPicker from 'emoji-picker-react';
|
||||
|
||||
const InputTemplate = ({ disabled = false, inputEmoji }) => {
|
||||
const [openPopup, setOpenPopup] = useState(false);
|
||||
|
||||
const handlePickEmoji = (emojiData) => {
|
||||
inputEmoji(emojiData.emoji);
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<Popover
|
||||
overlayClassName='p-0'
|
||||
placement={'right'}
|
||||
overlayInnerStyle={{ padding: 0, borderRadius: '8px' }}
|
||||
fresh
|
||||
content={<EmojiPicker skinTonesDisabled={true} emojiStyle='facebook' onEmojiClick={handlePickEmoji} />}
|
||||
// title='😀'
|
||||
trigger='click'
|
||||
open={openPopup}
|
||||
onOpenChange={setOpenPopup}>
|
||||
<Button type='text' className=' px-1' size={'middle'} disabled={disabled}>
|
||||
😀
|
||||
</Button>
|
||||
</Popover>
|
||||
</>
|
||||
);
|
||||
};
|
||||
export default InputTemplate;
|
Loading…
Reference in New Issue