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

85 lines
2.2 KiB
React
Raw Normal View History

import React from 'react';
import styles from '../styles.scss';
import Button from '/imports/ui/components/button/component';
import { clearModal } from '/imports/ui/components/app/service';
2017-02-11 04:26:52 +08:00
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
const intlMessages = defineMessages({
microphoneLabel: {
id: 'app.audioModal.microphoneLabel',
},
listenOnlyLabel: {
id: 'app.audioModal.listenOnlyLabel',
},
closeLabel: {
id: 'app.audioModal.closeLabel',
}
});
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() {
this.setState({ isOpen: false });
clearModal();
}
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.center}>
<Button className={styles.closeBtn}
label={intl.formatMessage(intlMessages.closeLabel)}
icon={'close'}
size={'lg'}
circle={true}
hideLabel={true}
onClick={this.handleClose}
/>
<div>
2017-02-11 04:26:52 +08:00
<FormattedMessage
id="app.audioModal.audioChoiceLabel"
description="app.audioModal.audioChoiceDescription"
defaultMessage="How would you like to join the audio?"
/>
</div>
</div>
<div className={styles.center}>
<Button className={styles.audioBtn}
label={intl.formatMessage(intlMessages.microphoneLabel)}
2017-03-02 09:03:02 +08:00
icon={'unmute'}
circle={true}
size={'jumbo'}
onClick={this.openAudio}
/>
<Button className={styles.audioBtn}
label={intl.formatMessage(intlMessages.listenOnlyLabel)}
icon={'listen'}
circle={true}
size={'jumbo'}
onClick={this.openListen}
/>
</div>
</div>
);
}
};
export default injectIntl(JoinAudio);