Improvements to the media editor
This commit is contained in:
parent
e8eb7638c4
commit
d0296ececa
61 changed files with 1124 additions and 969 deletions
|
@ -25,6 +25,7 @@ export type OwnProps = Readonly<{
|
|||
emoji?: string;
|
||||
i18n: LocalizerType;
|
||||
onClose?: () => unknown;
|
||||
onOpen?: () => unknown;
|
||||
emojiButtonApi?: MutableRefObject<EmojiButtonAPI | undefined>;
|
||||
variant?: EmojiButtonVariant;
|
||||
}>;
|
||||
|
@ -47,6 +48,7 @@ export const EmojiButton = React.memo(function EmojiButtonInner({
|
|||
i18n,
|
||||
doSend,
|
||||
onClose,
|
||||
onOpen,
|
||||
onPickEmoji,
|
||||
skinTone,
|
||||
onSetSkinTone,
|
||||
|
@ -58,6 +60,13 @@ export const EmojiButton = React.memo(function EmojiButtonInner({
|
|||
const popperRef = React.useRef<HTMLDivElement | null>(null);
|
||||
const refMerger = useRefMerger();
|
||||
|
||||
React.useEffect(() => {
|
||||
if (!open) {
|
||||
return;
|
||||
}
|
||||
onOpen?.();
|
||||
}, [open, onOpen]);
|
||||
|
||||
const handleClickButton = React.useCallback(() => {
|
||||
if (open) {
|
||||
setOpen(false);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue