2016-11-16 05:00:28 +08:00
|
|
|
import React from 'react';
|
2017-01-12 02:00:31 +08:00
|
|
|
import styles from '../styles.scss';
|
2016-11-16 05:00:28 +08:00
|
|
|
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';
|
2016-11-16 05:00:28 +08:00
|
|
|
|
2017-01-12 02:00:31 +08:00
|
|
|
const intlMessages = defineMessages({
|
|
|
|
microphoneLabel: {
|
|
|
|
id: 'app.audioModal.microphoneLabel',
|
|
|
|
},
|
|
|
|
listenOnlyLabel: {
|
|
|
|
id: 'app.audioModal.listenOnlyLabel',
|
|
|
|
},
|
2017-02-17 06:14:10 +08:00
|
|
|
closeLabel: {
|
|
|
|
id: 'app.audioModal.closeLabel',
|
|
|
|
}
|
2017-01-12 02:00:31 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
class JoinAudio extends React.Component {
|
2016-11-16 05:00:28 +08:00
|
|
|
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();
|
2016-12-23 23:18:44 +08:00
|
|
|
this.props.handleJoinListenOnly();
|
2016-11-16 05:00:28 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
2017-01-12 02:00:31 +08:00
|
|
|
const { intl } = this.props;
|
2016-11-16 05:00:28 +08:00
|
|
|
return (
|
|
|
|
<div>
|
2017-03-23 04:10:49 +08:00
|
|
|
<div className={styles.closeBtn}>
|
2016-11-16 05:00:28 +08:00
|
|
|
<Button className={styles.closeBtn}
|
2017-02-17 06:14:10 +08:00
|
|
|
label={intl.formatMessage(intlMessages.closeLabel)}
|
2016-11-16 05:00:28 +08:00
|
|
|
icon={'close'}
|
|
|
|
size={'lg'}
|
|
|
|
hideLabel={true}
|
|
|
|
onClick={this.handleClose}
|
|
|
|
/>
|
2017-03-23 04:10:49 +08:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div className={styles.title}>
|
|
|
|
<FormattedMessage
|
2017-02-11 04:26:52 +08:00
|
|
|
id="app.audioModal.audioChoiceLabel"
|
|
|
|
description="app.audioModal.audioChoiceDescription"
|
|
|
|
defaultMessage="How would you like to join the audio?"
|
2017-03-23 04:10:49 +08:00
|
|
|
/>
|
2016-11-16 05:00:28 +08:00
|
|
|
</div>
|
|
|
|
<div className={styles.center}>
|
|
|
|
<Button className={styles.audioBtn}
|
2017-01-12 02:00:31 +08:00
|
|
|
label={intl.formatMessage(intlMessages.microphoneLabel)}
|
2017-03-02 09:03:02 +08:00
|
|
|
icon={'unmute'}
|
2016-11-16 05:00:28 +08:00
|
|
|
circle={true}
|
|
|
|
size={'jumbo'}
|
|
|
|
onClick={this.openAudio}
|
|
|
|
/>
|
2017-03-23 04:10:49 +08:00
|
|
|
|
|
|
|
<span className={styles.verticalLine}>
|
|
|
|
</span>
|
2016-11-16 05:00:28 +08:00
|
|
|
<Button className={styles.audioBtn}
|
2017-01-12 02:00:31 +08:00
|
|
|
label={intl.formatMessage(intlMessages.listenOnlyLabel)}
|
2016-11-16 05:00:28 +08:00
|
|
|
icon={'listen'}
|
|
|
|
circle={true}
|
|
|
|
size={'jumbo'}
|
|
|
|
onClick={this.openListen}
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
};
|
2017-01-12 02:00:31 +08:00
|
|
|
|
|
|
|
export default injectIntl(JoinAudio);
|