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

55 lines
1.2 KiB
React
Raw Normal View History

import React from 'react';
import { createContainer } from 'meteor/react-meteor-data';
import Button from '/imports/ui/components/button/component';
2017-02-15 00:28:21 +08:00
import { withRouter } from 'react-router';
import { defineMessages, injectIntl } from 'react-intl';
2017-02-15 00:28:21 +08:00
const intlMessages = defineMessages({
joinAudio: {
id: 'app.audio.joinAudio',
description: 'Join audio button label',
2017-02-15 00:28:21 +08:00
},
leaveAudio: {
id: 'app.audio.leaveAudio',
2017-04-10 23:50:03 +08:00
description: 'Leave audio button label',
2017-04-11 22:07:49 +08:00
},
2017-02-15 00:28:21 +08:00
});
2017-02-15 00:28:21 +08:00
class JoinAudioOptions extends React.Component {
render() {
const {
intl,
isInAudio,
isInListenOnly,
2017-03-15 06:34:57 +08:00
handleJoinAudio,
handleCloseAudio,
2017-02-15 00:28:21 +08:00
} = this.props;
if (isInAudio || isInListenOnly) {
return (
<Button
2017-03-15 06:34:57 +08:00
onClick={handleCloseAudio}
2017-02-15 00:28:21 +08:00
label={intl.formatMessage(intlMessages.leaveAudio)}
color={'danger'}
2017-03-02 09:03:02 +08:00
icon={'audio_off'}
size={'lg'}
2017-06-03 03:25:02 +08:00
circle
/>
2017-02-15 00:28:21 +08:00
);
}
return (
<Button
2017-03-15 06:34:57 +08:00
onClick={handleJoinAudio}
2017-02-15 00:28:21 +08:00
label={intl.formatMessage(intlMessages.joinAudio)}
color={'primary'}
2017-03-02 09:03:02 +08:00
icon={'audio_on'}
size={'lg'}
2017-06-03 03:25:02 +08:00
circle
/>
);
}
}
2017-02-15 00:28:21 +08:00
export default withRouter(injectIntl(JoinAudioOptions));