bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/chat/chat-dropdown/container.jsx

26 lines
816 B
React
Raw Normal View History

2021-03-25 04:20:33 +08:00
import React, { useContext } from 'react';
import { withTracker } from 'meteor/react-meteor-data';
import Auth from '/imports/ui/services/auth';
import Meetings from '/imports/api/meetings';
2021-03-25 04:20:33 +08:00
import { UsersContext } from '/imports/ui/components/components-data/users-context/context';
import ChatDropdown from './component';
2021-03-25 04:20:33 +08:00
const ChatDropdownContainer = ({ ...props }) => {
const usingUsersContext = useContext(UsersContext);
const { users } = usingUsersContext;
return <ChatDropdown {...props} users={users} />;
};
export default withTracker(() => {
const getMeetingName = () => {
const m = Meetings.findOne({ meetingId: Auth.meetingID },
{ fields: { 'meetingProp.name': 1 } });
return m.meetingProp.name;
};
return {
meetingName: getMeetingName(),
};
})(ChatDropdownContainer);