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

72 lines
2.1 KiB
React
Raw Normal View History

import React, { Component } from 'react';
import { defineMessages, injectIntl } from 'react-intl';
import { clearModal } from '/imports/ui/components/app/service';
2017-04-29 00:15:29 +08:00
import { exitAudio } from '../audio/service';
import Modal from '/imports/ui/components/modal/fullscreen/component';
const intlMessages = defineMessages({
title: {
2016-11-14 19:57:10 +08:00
id: 'app.breakoutJoinConfirmation.title',
2017-04-10 23:50:03 +08:00
description: 'Join breakout room title',
},
message: {
id: 'app.breakoutJoinConfirmation.message',
2017-04-10 23:50:03 +08:00
description: 'Join breakout confim message',
},
confirmLabel: {
id: 'app.breakoutJoinConfirmation.confirmLabel',
2017-04-10 23:50:03 +08:00
description: 'Join confirmation button label',
},
confirmDesc: {
id: 'app.breakoutJoinConfirmation.confirmDesc',
2017-04-11 21:52:30 +08:00
description: 'adds context to confirm option',
},
dismissLabel: {
id: 'app.breakoutJoinConfirmation.dismissLabel',
2017-04-10 23:50:03 +08:00
description: 'Cancel button label',
},
dismissDesc: {
id: 'app.breakoutJoinConfirmation.dismissDesc',
2017-04-11 21:52:30 +08:00
description: 'adds context to dismiss option',
},
});
class BreakoutJoinConfirmation extends Component {
constructor(props) {
super(props);
this.handleJoinBreakoutConfirmation = this.handleJoinBreakoutConfirmation.bind(this);
}
handleJoinBreakoutConfirmation() {
const { breakoutURL } = this.props;
// leave main room's audio when joining a breakout room
exitAudio();
window.open(breakoutURL);
clearModal();
}
render() {
2016-11-14 19:57:10 +08:00
const { intl, breakoutName } = this.props;
return (
<Modal
title={intl.formatMessage(intlMessages.title)}
confirm={{
callback: this.handleJoinBreakoutConfirmation,
label: intl.formatMessage(intlMessages.confirmLabel),
description: intl.formatMessage(intlMessages.confirmDesc),
}}
dismiss={{
label: intl.formatMessage(intlMessages.dismissLabel),
description: intl.formatMessage(intlMessages.dismissDesc),
}}>
2016-11-14 19:57:10 +08:00
{`${intl.formatMessage(intlMessages.message)} ${breakoutName}?`}
</Modal>
);
}
};
export default injectIntl(BreakoutJoinConfirmation);