bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/breakout-room/container.jsx
2021-06-02 15:29:40 -03:00

59 lines
1.7 KiB
JavaScript

import React, { useContext } from 'react';
import { withTracker } from 'meteor/react-meteor-data';
import AudioService from '/imports/ui/components/audio/service';
import AudioManager from '/imports/ui/services/audio-manager';
import BreakoutComponent from './component';
import Service from './service';
import { NLayoutContext } from '../layout/context/context';
const BreakoutContainer = (props) => {
const newLayoutContext = useContext(NLayoutContext);
const { newLayoutContextDispatch } = newLayoutContext;
return <BreakoutComponent {...{ newLayoutContextDispatch, ...props }} />;
};
export default withTracker((props) => {
const {
endAllBreakouts,
requestJoinURL,
extendBreakoutsTime,
findBreakouts,
breakoutRoomUser,
transferUserToMeeting,
transferToBreakout,
meetingId,
amIModerator,
isUserInBreakoutRoom,
} = Service;
const breakoutRooms = findBreakouts();
const isMicrophoneUser = AudioService.isConnected() && !AudioService.isListenOnly();
const isMeteorConnected = Meteor.status().connected;
const isReconnecting = AudioService.isReconnecting();
const {
setBreakoutAudioTransferStatus,
getBreakoutAudioTransferStatus,
} = AudioService;
return {
...props,
breakoutRooms,
endAllBreakouts,
requestJoinURL,
extendBreakoutsTime,
breakoutRoomUser,
transferUserToMeeting,
transferToBreakout,
isMicrophoneUser,
meetingId: meetingId(),
amIModerator: amIModerator(),
isMeteorConnected,
isUserInBreakoutRoom,
exitAudio: () => AudioManager.exitAudio(),
isReconnecting,
setBreakoutAudioTransferStatus,
getBreakoutAudioTransferStatus,
};
})(BreakoutContainer);