bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/audio/join-audio/component.jsx

93 lines
2.4 KiB
React
Raw Normal View History

import React from 'react';
import styles from '../audio-modal/styles.scss';
import Button from '/imports/ui/components/button/component';
2017-04-19 03:06:51 +08:00
import { withModalMounter } from '/imports/ui/components/modal/service';
import { defineMessages, injectIntl } from 'react-intl';
const intlMessages = defineMessages({
microphoneLabel: {
id: 'app.audioModal.microphoneLabel',
2017-04-10 23:50:03 +08:00
description: 'Join mic audio button label',
},
listenOnlyLabel: {
id: 'app.audioModal.listenOnlyLabel',
2017-04-10 23:50:03 +08:00
description: 'Join listen only audio button label',
},
closeLabel: {
id: 'app.audioModal.closeLabel',
2017-04-10 23:50:03 +08:00
description: 'close audio modal button label',
},
audioChoiceLabel: {
id: 'app.audioModal.audioChoiceLabel',
2017-04-11 21:52:30 +08:00
description: 'Join audio modal title',
2017-04-19 03:06:51 +08:00
},
});
class JoinAudio extends React.Component {
constructor(props) {
super(props);
this.handleClose = this.handleClose.bind(this);
this.openAudio = this.openAudio.bind(this);
this.openListen = this.openListen.bind(this);
}
handleClose() {
2017-04-19 03:06:51 +08:00
/* TODO: Refactor this to the outer component (audio-modal/container) */
this.props.mountModal(null);
}
openAudio() {
this.props.changeMenu(this.props.AUDIO_SETTINGS);
}
openListen() {
2016-12-23 01:47:12 +08:00
this.handleClose();
this.props.handleJoinListenOnly();
}
render() {
const { intl } = this.props;
return (
<div>
<div className={styles.closeBtnWrapper}>
2017-06-03 03:25:02 +08:00
<Button
className={styles.closeBtn}
label={intl.formatMessage(intlMessages.closeLabel)}
icon={'close'}
size={'lg'}
2017-06-03 03:25:02 +08:00
hideLabel
onClick={this.handleClose}
/>
</div>
<div className={styles.title}>
{intl.formatMessage(intlMessages.audioChoiceLabel)}
</div>
<div className={styles.center}>
2017-06-03 03:25:02 +08:00
<Button
className={styles.audioBtn}
label={intl.formatMessage(intlMessages.microphoneLabel)}
2017-03-02 09:03:02 +08:00
icon={'unmute'}
2017-06-03 03:25:02 +08:00
circle
size={'jumbo'}
onClick={this.openAudio}
/>
2017-06-03 03:25:02 +08:00
<span className={styles.verticalLine} />
<Button
className={styles.audioBtn}
label={intl.formatMessage(intlMessages.listenOnlyLabel)}
icon={'listen'}
2017-06-03 03:25:02 +08:00
circle
size={'jumbo'}
onClick={this.openListen}
/>
</div>
</div>
);
}
2017-06-03 03:25:02 +08:00
}
2017-04-19 03:06:51 +08:00
export default withModalMounter(injectIntl(JoinAudio));