bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/emoji-rain/container.jsx
Tainan Felipe 3bc40df230
Add: useDeduplicatedSubscription hook (#20376)
* Add: useDeduplicatedSubscription hook

* Fix: TS error

* Add: components using useDeduplicatedSubscription

* Change: Move to useDeduplicatedSubscription

* Change: unsubscribe logic to own useEffect

* Change: remove file import over package

* Fix: TS errors

* Fix: private chat not loading

* Change: revert changes on queries

* Fix: eslint error

* Remove: html-webpack-plugin package

* Fix: external video

* Add: comment about the stringToHash function

* Fix: video player showing tools over presentation
2024-06-04 10:40:54 -03:00

28 lines
800 B
JavaScript

import React, { useRef } from 'react';
import EmojiRain from './component';
import { getEmojisToRain } from './queries';
import useDeduplicatedSubscription from '../../core/hooks/useDeduplicatedSubscription';
const EmojiRainContainer = () => {
const nowDate = useRef(new Date().toUTCString());
const {
data: emojisToRainData,
} = useDeduplicatedSubscription(getEmojisToRain, {
variables: {
initialCursor: nowDate.current,
},
});
const emojisArray = emojisToRainData?.user_reaction_stream || [];
const reactions = emojisArray.length === 0 ? []
: emojisArray.map((reaction) => ({
reaction: reaction.reactionEmoji,
creationDate: new Date(reaction.createdAt),
}));
return <EmojiRain reactions={reactions} />;
};
export default EmojiRainContainer;