bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/chat/chat-dropdown/container.jsx
2021-10-13 15:00:52 -03:00

26 lines
869 B
JavaScript

import React, { useContext } from 'react';
import { withTracker } from 'meteor/react-meteor-data';
import Auth from '/imports/ui/services/auth';
import Meetings from '/imports/ui/local-collections/meetings-collection/meetings';
import { UsersContext } from '/imports/ui/components/components-data/users-context/context';
import ChatDropdown from './component';
const ChatDropdownContainer = ({ ...props }) => {
const usingUsersContext = useContext(UsersContext);
const { users } = usingUsersContext;
return <ChatDropdown {...props} users={users[Auth.meetingID]} />;
};
export default withTracker(() => {
const getMeetingName = () => {
const m = Meetings.findOne({ meetingId: Auth.meetingID },
{ fields: { 'meetingProp.name': 1 } });
return m.meetingProp.name;
};
return {
meetingName: getMeetingName(),
};
})(ChatDropdownContainer);