2017-03-15 07:21:55 +08:00
|
|
|
import React, { Component } from 'react';
|
2016-04-29 03:02:51 +08:00
|
|
|
import { createContainer } from 'meteor/react-meteor-data';
|
2017-04-19 03:06:51 +08:00
|
|
|
import { withModalMounter } from '/imports/ui/components/modal/service';
|
2016-05-20 21:46:30 +08:00
|
|
|
import ActionsBar from './component';
|
2016-11-08 02:19:00 +08:00
|
|
|
import Service from './service';
|
2017-05-02 03:52:57 +08:00
|
|
|
import AudioService from '../audio/service';
|
|
|
|
|
|
|
|
import AudioModal from '../audio/audio-modal/component';
|
2016-04-29 03:02:51 +08:00
|
|
|
|
2016-05-04 22:48:53 +08:00
|
|
|
class ActionsBarContainer extends Component {
|
2016-04-29 03:02:51 +08:00
|
|
|
constructor(props) {
|
|
|
|
super(props);
|
|
|
|
}
|
|
|
|
|
2017-03-15 07:21:55 +08:00
|
|
|
render() {
|
2016-04-29 03:02:51 +08:00
|
|
|
return (
|
2017-01-10 00:35:25 +08:00
|
|
|
<ActionsBar
|
2017-06-03 03:25:02 +08:00
|
|
|
{...this.props}
|
|
|
|
>
|
|
|
|
{this.props.children}
|
2016-05-04 22:48:53 +08:00
|
|
|
</ActionsBar>
|
2016-04-29 03:02:51 +08:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-04-19 03:06:51 +08:00
|
|
|
export default withModalMounter(createContainer(({ mountModal }) => {
|
2017-03-17 07:30:46 +08:00
|
|
|
const isPresenter = Service.isUserPresenter();
|
2017-04-29 00:15:29 +08:00
|
|
|
|
2017-05-03 01:18:01 +08:00
|
|
|
const handleExitAudio = () => AudioService.exitAudio();
|
2017-04-19 03:06:51 +08:00
|
|
|
const handleOpenJoinAudio = () =>
|
2017-05-03 01:18:01 +08:00
|
|
|
mountModal(<AudioModal handleJoinListenOnly={AudioService.joinListenOnly} />);
|
2017-03-17 07:30:46 +08:00
|
|
|
|
|
|
|
return {
|
|
|
|
isUserPresenter: isPresenter,
|
2017-06-03 03:25:02 +08:00
|
|
|
handleExitAudio,
|
|
|
|
handleOpenJoinAudio,
|
2017-03-17 07:30:46 +08:00
|
|
|
};
|
2017-04-19 03:06:51 +08:00
|
|
|
}, ActionsBarContainer));
|