2021-03-25 04:20:33 +08:00
|
|
|
import React, { useContext } from 'react';
|
2020-08-04 21:27:32 +08:00
|
|
|
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';
|
2020-08-04 21:27:32 +08:00
|
|
|
import ChatDropdown from './component';
|
|
|
|
|
2021-03-25 04:20:33 +08:00
|
|
|
const ChatDropdownContainer = ({ ...props }) => {
|
|
|
|
const usingUsersContext = useContext(UsersContext);
|
|
|
|
const { users } = usingUsersContext;
|
|
|
|
|
2021-04-15 20:12:21 +08:00
|
|
|
return <ChatDropdown {...props} users={users[Auth.meetingID]} />;
|
2021-03-25 04:20:33 +08:00
|
|
|
};
|
2020-08-04 21:27:32 +08:00
|
|
|
|
|
|
|
export default withTracker(() => {
|
|
|
|
const getMeetingName = () => {
|
|
|
|
const m = Meetings.findOne({ meetingId: Auth.meetingID },
|
|
|
|
{ fields: { 'meetingProp.name': 1 } });
|
|
|
|
return m.meetingProp.name;
|
|
|
|
};
|
|
|
|
|
|
|
|
return {
|
|
|
|
meetingName: getMeetingName(),
|
|
|
|
};
|
|
|
|
})(ChatDropdownContainer);
|