bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/waiting-users/alert/container.jsx
2019-02-26 14:08:15 -03:00

35 lines
1.0 KiB
JavaScript

import React, { PureComponent } from 'react';
import { Session } from 'meteor/session';
import { withTracker } from 'meteor/react-meteor-data';
import Auth from '/imports/ui/services/auth';
import GuestUsers from '/imports/api/guest-users/';
import Users from '/imports/api/users/';
import WaitingComponent from './component';
const USER_CONFIG = Meteor.settings.public.user;
const ROLE_MODERATOR = USER_CONFIG.role_moderator;
class WaitingContainer extends PureComponent {
render() {
return (
<WaitingComponent {...this.props} />
);
}
}
export default withTracker(() => {
const pendingtUsers = GuestUsers.find({
meetingId: Auth.meetingID,
approved: false,
denied: false,
}).fetch();
const managementPanelIsOpen = Session.get('openPanel') === 'waitingUsersPanel';
return {
managementPanelIsOpen,
pendingtUsers,
currentUserIsModerator: Users.findOne({ userId: Auth.userID }).role === ROLE_MODERATOR,
joinTime: Users.findOne({ userId: Auth.userID }).loginTime,
};
})(WaitingContainer);