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

49 lines
1.5 KiB
JavaScript

import React from 'react';
import { withTracker } from 'meteor/react-meteor-data';
import Auth from '/imports/ui/services/auth';
import GuestUsers from '/imports/ui/local-collections/guest-users-collection/guest-users';
import Meetings from '/imports/ui/local-collections/meetings-collection/meetings';
import Service from './service';
import WaitingComponent from './component';
import { layoutDispatch } from '../layout/context';
const WaitingContainer = (props) => {
const layoutContextDispatch = layoutDispatch();
return <WaitingComponent {...{ layoutContextDispatch, ...props }} />;
};
export default withTracker(() => {
const guestUsers = GuestUsers.find({
meetingId: Auth.meetingID,
guest: true,
approved: false,
denied: false,
}).fetch();
const authenticatedUsers = GuestUsers.find({
meetingId: Auth.meetingID,
authenticated: true,
guest: false,
approved: false,
denied: false,
}).fetch();
const meeting = Meetings.findOne({ meetingId: Auth.meetingID });
const { usersProp } = meeting;
const { authenticatedGuest } = usersProp;
return {
guestUsers,
authenticatedUsers,
guestUsersCall: Service.guestUsersCall,
isWaitingRoomEnabled: Service.isWaitingRoomEnabled(),
changeGuestPolicy: Service.changeGuestPolicy,
isGuestLobbyMessageEnabled: Service.isGuestLobbyMessageEnabled,
setGuestLobbyMessage: Service.setGuestLobbyMessage,
guestLobbyMessage: Service.getGuestLobbyMessage(),
authenticatedGuest,
allowRememberChoice: Service.allowRememberChoice,
};
})(WaitingContainer);