2016-05-20 21:37:19 +08:00
|
|
|
import React, { Component, PropTypes } from 'react';
|
2016-10-12 03:04:50 +08:00
|
|
|
import { showModal } from '/imports/ui/components/app/service';
|
|
|
|
import Audio from '/imports/ui/components/audio-modal/component';
|
2016-10-26 05:16:40 +08:00
|
|
|
import Button from '/imports/ui/components/button/component';
|
2016-05-20 21:37:19 +08:00
|
|
|
import styles from './styles.scss';
|
2016-09-27 05:06:41 +08:00
|
|
|
import EmojiContainer from './emoji-menu/container';
|
2016-09-27 05:55:33 +08:00
|
|
|
import ActionsDropdown from './actions-dropdown/component';
|
2016-10-26 05:16:40 +08:00
|
|
|
import Auth from '/imports/ui/services/auth/index';
|
|
|
|
import Users from '/imports/api/users/index';
|
2016-12-06 01:07:25 +08:00
|
|
|
import JoinAudioOptionsContainer from './audio-menu/container';
|
2016-12-07 05:15:23 +08:00
|
|
|
import MuteAudioContainer from './mute-button/container';
|
2016-10-26 05:16:40 +08:00
|
|
|
import { exitAudio } from '/imports/api/phone';
|
2016-12-15 03:55:35 +08:00
|
|
|
import JoinVideo from './video-button/component';
|
|
|
|
|
2016-05-20 21:37:19 +08:00
|
|
|
export default class ActionsBar extends Component {
|
|
|
|
constructor(props) {
|
|
|
|
super(props);
|
|
|
|
}
|
|
|
|
|
2017-01-10 00:35:25 +08:00
|
|
|
openJoinAudio() {
|
|
|
|
return showModal(<Audio handleJoinListenOnly={this.props.handleJoinListenOnly} />)
|
|
|
|
}
|
|
|
|
|
2016-11-08 02:19:00 +08:00
|
|
|
renderForPresenter() {
|
2016-05-20 21:37:19 +08:00
|
|
|
return (
|
|
|
|
<div className={styles.actionsbar}>
|
2016-05-21 00:17:21 +08:00
|
|
|
<div className={styles.left}>
|
2016-09-27 05:55:33 +08:00
|
|
|
<ActionsDropdown />
|
2016-05-21 00:17:21 +08:00
|
|
|
</div>
|
|
|
|
<div className={styles.center}>
|
2016-12-10 04:39:48 +08:00
|
|
|
<MuteAudioContainer />
|
2016-12-06 01:07:25 +08:00
|
|
|
<JoinAudioOptionsContainer
|
2017-01-10 00:35:25 +08:00
|
|
|
open={this.openJoinAudio.bind(this)}
|
2016-11-19 05:24:59 +08:00
|
|
|
close={() => {exitAudio();}}
|
|
|
|
|
2016-10-12 03:04:50 +08:00
|
|
|
/>
|
2016-12-21 04:27:16 +08:00
|
|
|
{/*<JoinVideo />*/}
|
2016-09-22 02:03:18 +08:00
|
|
|
<EmojiContainer />
|
2016-05-21 00:17:21 +08:00
|
|
|
</div>
|
2017-03-13 23:55:16 +08:00
|
|
|
<div className={styles.right} style={{visibility: 'hidden'}}>
|
|
|
|
<ActionsDropdown />
|
2016-05-21 00:17:21 +08:00
|
|
|
</div>
|
2016-05-20 21:37:19 +08:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
2016-11-08 02:19:00 +08:00
|
|
|
|
|
|
|
renderForUser() {
|
|
|
|
return (
|
|
|
|
<div className={styles.actionsbar}>
|
|
|
|
<div className={styles.center}>
|
2016-12-10 04:39:48 +08:00
|
|
|
<MuteAudioContainer />
|
2016-12-06 01:07:25 +08:00
|
|
|
<JoinAudioOptionsContainer
|
2017-01-10 00:35:25 +08:00
|
|
|
open={this.openJoinAudio.bind(this)}
|
2016-12-10 04:39:48 +08:00
|
|
|
close={() => {exitAudio();}}
|
|
|
|
|
2016-11-08 02:19:00 +08:00
|
|
|
/>
|
2016-12-21 04:27:16 +08:00
|
|
|
{/*<JoinVideo />*/}
|
2016-11-08 02:19:00 +08:00
|
|
|
<EmojiContainer />
|
|
|
|
</div>
|
|
|
|
<div className={styles.right}>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
2016-11-15 10:48:56 +08:00
|
|
|
const { isUserPresenter } = this.props;
|
2016-12-10 04:30:33 +08:00
|
|
|
|
2016-12-06 04:41:24 +08:00
|
|
|
return isUserPresenter ?
|
|
|
|
this.renderForPresenter() :
|
|
|
|
this.renderForUser();
|
2016-11-08 02:19:00 +08:00
|
|
|
}
|
2016-05-20 21:37:19 +08:00
|
|
|
}
|