bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/captions/writer-menu/container.jsx

23 lines
810 B
React
Raw Normal View History

import React from 'react';
import { withTracker } from 'meteor/react-meteor-data';
import Service from '/imports/ui/components/captions/service';
import WriterMenu from './component';
2021-09-11 04:48:52 +08:00
import { layoutDispatch } from '../../layout/context';
import useCurrentUser from '/imports/ui/core/hooks/useCurrentUser';
2021-05-18 04:25:07 +08:00
const WriterMenuContainer = (props) => {
2021-09-11 04:48:52 +08:00
const layoutContextDispatch = layoutDispatch();
const { data: currentUserData } = useCurrentUser((user) => ({
isModerator: user.isModerator,
}));
const amIModerator = currentUserData?.isModerator;
return amIModerator && <WriterMenu {...{ layoutContextDispatch, ...props }} />;
2021-05-18 04:25:07 +08:00
};
2023-06-22 06:59:17 +08:00
export default withTracker(({ setIsOpen }) => ({
closeModal: () => setIsOpen(false),
availableLocales: Service.getAvailableLocales(),
2023-06-22 06:59:17 +08:00
}))(WriterMenuContainer);