2016-11-16 05:00:28 +08:00
|
|
|
import React from 'react';
|
|
|
|
import {createContainer} from 'meteor/react-meteor-data';
|
|
|
|
import {callServer} from '/imports/ui/services/api';
|
|
|
|
import Button from '/imports/ui/components/button/component';
|
|
|
|
import Users from '/imports/api/users/index';
|
|
|
|
import Auth from '/imports/ui/services/auth/index';
|
|
|
|
import MuteAudioComponent from './component';
|
|
|
|
|
|
|
|
class MuteAudioContainer extends React.Component {
|
|
|
|
render() {
|
|
|
|
return (
|
|
|
|
<MuteAudioComponent
|
|
|
|
isMuted = {this.props.isMuted}
|
2016-11-19 05:24:59 +08:00
|
|
|
muteUser = {this.props.muteUser}
|
|
|
|
unmuteUser = {this.props.unmuteUser}
|
2016-11-16 05:00:28 +08:00
|
|
|
/>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default createContainer((params) => {
|
|
|
|
const data = {
|
|
|
|
isMuted: Users.findOne({ userId: Auth.userID }).user.voiceUser.muted,
|
2016-11-19 05:24:59 +08:00
|
|
|
muteUser: () => callServer('muteUser', Auth.userID),
|
|
|
|
unmuteUser: () => callServer('unmuteUser', Auth.userID),
|
2016-11-16 05:00:28 +08:00
|
|
|
};
|
|
|
|
return data;
|
|
|
|
}, MuteAudioContainer);
|