bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/audio/container.jsx

32 lines
782 B
React
Raw Normal View History

2017-03-28 04:40:44 +08:00
import React, { Component } from 'react';
import { createContainer } from 'meteor/react-meteor-data';
2017-05-02 03:52:57 +08:00
import { withModalMounter } from '/imports/ui/components/modal/service';
import Service from './service';
2017-03-28 04:40:44 +08:00
import Audio from './component';
2017-05-02 03:52:57 +08:00
import AudioModal from './audio-modal/component';
2017-03-28 04:40:44 +08:00
class AudioContainer extends Component {
render() {
return (
2017-05-02 03:52:57 +08:00
<Audio {...this.props}>
2017-04-20 04:42:48 +08:00
{this.props.children}
</Audio>
2017-03-28 04:40:44 +08:00
);
}
}
2017-05-02 03:52:57 +08:00
export default withModalMounter(createContainer(({ mountModal }) => {
2017-04-20 04:42:48 +08:00
const APP_CONFIG = Meteor.settings.public.app;
2017-03-28 04:40:44 +08:00
return {
2017-05-02 03:52:57 +08:00
init: () => {
Service.init();
if (APP_CONFIG.autoJoinAudio) {
mountModal(<AudioModal handleJoinListenOnly={Service.joinListenOnly} />);
}
},
2017-03-28 04:40:44 +08:00
};
2017-05-02 03:52:57 +08:00
}, AudioContainer));