2023-04-28 05:31:11 +08:00
|
|
|
import React from 'react';
|
2021-10-14 22:11:37 +08:00
|
|
|
import { withTracker } from 'meteor/react-meteor-data';
|
2023-04-28 05:31:11 +08:00
|
|
|
import { layoutSelectInput, layoutDispatch } from '/imports/ui/components/layout/context';
|
2021-10-14 22:11:37 +08:00
|
|
|
import { injectIntl } from 'react-intl';
|
|
|
|
import InteractionsButton from './component';
|
|
|
|
import actionsBarService from '../service';
|
2023-06-27 22:08:49 +08:00
|
|
|
import { SMALL_VIEWPORT_BREAKPOINT } from '/imports/ui/components/layout/enums';
|
2021-10-14 22:11:37 +08:00
|
|
|
|
|
|
|
const InteractionsButtonContainer = ({ ...props }) => {
|
2023-04-28 05:31:11 +08:00
|
|
|
const layoutContextDispatch = layoutDispatch();
|
|
|
|
const sidebarContent = layoutSelectInput((i) => i.sidebarContent);
|
2021-10-14 22:11:37 +08:00
|
|
|
const { sidebarContentPanel } = sidebarContent;
|
2023-06-27 22:08:49 +08:00
|
|
|
|
|
|
|
const { width: browserWidth } = layoutSelectInput((i) => i.browser);
|
|
|
|
const isMobile = browserWidth <= SMALL_VIEWPORT_BREAKPOINT;
|
|
|
|
|
2021-10-14 22:11:37 +08:00
|
|
|
return (
|
2022-09-27 02:38:45 +08:00
|
|
|
<InteractionsButton {...{
|
2023-06-27 22:08:49 +08:00
|
|
|
layoutContextDispatch, sidebarContentPanel, isMobile, ...props,
|
2022-09-27 02:38:45 +08:00
|
|
|
}}
|
|
|
|
/>
|
2021-10-14 22:11:37 +08:00
|
|
|
);
|
|
|
|
};
|
|
|
|
|
2023-04-28 05:31:11 +08:00
|
|
|
export default injectIntl(withTracker(() => {
|
2021-10-14 22:11:37 +08:00
|
|
|
const currentUser = actionsBarService.currentUser();
|
|
|
|
|
|
|
|
return {
|
|
|
|
userId: currentUser.userId,
|
|
|
|
emoji: currentUser.emoji,
|
2023-06-08 09:10:07 +08:00
|
|
|
raiseHand: currentUser.raiseHand,
|
2021-10-14 22:11:37 +08:00
|
|
|
};
|
2023-04-28 05:31:11 +08:00
|
|
|
})(InteractionsButtonContainer));
|
|
|
|
|