bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/actions-bar/reactions-button/container.jsx

40 lines
1.5 KiB
React
Raw Normal View History

2023-04-28 05:31:11 +08:00
import React from 'react';
import { withTracker } from 'meteor/react-meteor-data';
2023-04-28 05:31:11 +08:00
import { layoutSelectInput, layoutDispatch } from '/imports/ui/components/layout/context';
import { injectIntl } from 'react-intl';
2023-07-18 19:54:36 +08:00
import ReactionsButton from './component';
import actionsBarService from '../service';
2023-07-19 22:36:34 +08:00
import UserReactionService from '/imports/ui/components/user-reaction/service';
2023-06-27 22:08:49 +08:00
import { SMALL_VIEWPORT_BREAKPOINT } from '/imports/ui/components/layout/enums';
2023-08-11 03:28:21 +08:00
import SettingsService from '/imports/ui/services/settings';
2023-07-18 19:54:36 +08:00
const ReactionsButtonContainer = ({ ...props }) => {
2023-04-28 05:31:11 +08:00
const layoutContextDispatch = layoutDispatch();
const sidebarContent = layoutSelectInput((i) => i.sidebarContent);
const { sidebarContentPanel } = sidebarContent;
2023-06-27 22:08:49 +08:00
const { width: browserWidth } = layoutSelectInput((i) => i.browser);
const isMobile = browserWidth <= SMALL_VIEWPORT_BREAKPOINT;
return (
2023-07-18 19:54:36 +08:00
<ReactionsButton {...{
2023-06-27 22:08:49 +08:00
layoutContextDispatch, sidebarContentPanel, isMobile, ...props,
}}
/>
);
};
2023-04-28 05:31:11 +08:00
export default injectIntl(withTracker(() => {
const currentUser = actionsBarService.currentUser();
2023-07-19 22:36:34 +08:00
const currentUserReaction = UserReactionService.getUserReaction(currentUser.userId);
return {
userId: currentUser.userId,
emoji: currentUser.emoji,
2023-07-19 22:36:34 +08:00
currentUserReaction: currentUserReaction.reaction,
raiseHand: currentUser.raiseHand,
2023-08-11 03:28:21 +08:00
autoCloseReactionsBar: SettingsService?.application?.autoCloseReactionsBar,
};
2023-07-18 19:54:36 +08:00
})(ReactionsButtonContainer));
2023-04-28 05:31:11 +08:00