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-10-12 03:04:50 +08:00
|
|
|
|
2016-11-19 05:24:59 +08:00
|
|
|
const openJoinAudio = () => showModal(<Audio />);
|
2016-05-20 21:37:19 +08:00
|
|
|
|
|
|
|
export default class ActionsBar extends Component {
|
|
|
|
constructor(props) {
|
|
|
|
super(props);
|
|
|
|
}
|
|
|
|
|
|
|
|
handleClick() {
|
|
|
|
}
|
2016-08-21 09:14:12 +08:00
|
|
|
|
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
|
2016-10-26 05:16:40 +08:00
|
|
|
open={openJoinAudio.bind(this)}
|
2016-11-19 05:24:59 +08:00
|
|
|
close={() => {exitAudio();}}
|
|
|
|
|
2016-10-12 03:04:50 +08:00
|
|
|
/>
|
2016-10-26 05:16:40 +08:00
|
|
|
|
2016-05-21 00:17:21 +08:00
|
|
|
<Button
|
2016-07-11 21:45:24 +08:00
|
|
|
onClick={this.handleClick}
|
2016-05-21 00:17:21 +08:00
|
|
|
label={'Cam Off'}
|
|
|
|
color={'primary'}
|
|
|
|
icon={'video-off'}
|
|
|
|
size={'lg'}
|
|
|
|
circle={true}
|
|
|
|
/>
|
2016-09-22 02:03:18 +08:00
|
|
|
<EmojiContainer />
|
2016-05-21 00:17:21 +08:00
|
|
|
</div>
|
|
|
|
<div className={styles.right}>
|
|
|
|
</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
|
2016-11-08 02:19:00 +08:00
|
|
|
open={openJoinAudio.bind(this)}
|
2016-12-10 04:39:48 +08:00
|
|
|
close={() => {exitAudio();}}
|
|
|
|
|
2016-11-08 02:19:00 +08:00
|
|
|
/>
|
|
|
|
|
|
|
|
<Button
|
|
|
|
onClick={this.handleClick}
|
|
|
|
label={'Cam Off'}
|
|
|
|
color={'primary'}
|
|
|
|
icon={'video-off'}
|
|
|
|
size={'lg'}
|
|
|
|
circle={true}
|
|
|
|
/>
|
|
|
|
<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
|
|
|
}
|