2021-10-14 22:11:37 +08:00
|
|
|
import React, { useContext } from 'react';
|
|
|
|
import { withTracker } from 'meteor/react-meteor-data';
|
|
|
|
import { withModalMounter } from '/imports/ui/components/modal/service';
|
|
|
|
import LayoutContext from '/imports/ui/components/layout/context';
|
|
|
|
import { injectIntl } from 'react-intl';
|
|
|
|
import InteractionsButton from './component';
|
|
|
|
import actionsBarService from '../service';
|
2022-09-27 02:38:45 +08:00
|
|
|
import { layoutSelect } from '../../layout/context';
|
2021-10-14 22:11:37 +08:00
|
|
|
|
|
|
|
const InteractionsButtonContainer = ({ ...props }) => {
|
|
|
|
const layoutContext = useContext(LayoutContext);
|
|
|
|
const { layoutContextState, layoutContextDispatch } = layoutContext;
|
|
|
|
const { input } = layoutContextState;
|
|
|
|
const { sidebarContent } = input;
|
|
|
|
const { sidebarContentPanel } = sidebarContent;
|
2022-09-27 02:38:45 +08:00
|
|
|
const { isMobile } = deviceInfo;
|
|
|
|
const isRTL = layoutSelect((i) => i.isRTL);
|
2021-10-14 22:11:37 +08:00
|
|
|
return (
|
2022-09-27 02:38:45 +08:00
|
|
|
<InteractionsButton {...{
|
|
|
|
layoutContextDispatch, sidebarContentPanel, isMobile, isRTL, ...props,
|
|
|
|
}}
|
|
|
|
/>
|
2021-10-14 22:11:37 +08:00
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default injectIntl(withModalMounter(withTracker(() => {
|
|
|
|
const currentUser = actionsBarService.currentUser();
|
|
|
|
|
|
|
|
return {
|
|
|
|
userId: currentUser.userId,
|
|
|
|
emoji: currentUser.emoji,
|
|
|
|
};
|
|
|
|
})(InteractionsButtonContainer)));
|