-
Notifications
You must be signed in to change notification settings - Fork 3k
/
Copy pathReactionList.js
33 lines (27 loc) · 993 Bytes
/
ReactionList.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import React from 'react';
const reactionListRef = React.createRef();
/**
* Show the ReactionList popover modal popover.
*
* @param {Object} [event] - a press event.
* @param {Element} reactionListPopoverAnchor - popoverAnchor
* @param {String} emojiName - the emoji codes to display near the bubble.
* @param {String} reportActionID
*/
function showReactionList(event, reactionListPopoverAnchor, emojiName, reportActionID) {
if (!reactionListRef.current) {
return;
}
reactionListRef.current.showReactionList(event, reactionListPopoverAnchor, emojiName, reportActionID);
}
/**
* Hide the ReactionList popover.
* @param {Function} [onHideCallback=() => {}] - Callback to be called after popover is completely hidden
*/
function hideReactionList(onHideCallback = () => {}) {
if (!reactionListRef.current) {
return;
}
reactionListRef.current.hideReactionList(onHideCallback);
}
export {reactionListRef, showReactionList, hideReactionList};