bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/breakout-join-confirmation/component.jsx
2016-11-07 13:52:39 -02:00

69 lines
1.9 KiB
JavaScript

import React, { Component } from 'react';
import { defineMessages, injectIntl } from 'react-intl';
import { clearModal } from '/imports/ui/components/app/service';
import Auth from '/imports/ui/services/auth';
import Modal from '/imports/ui/components/modal/component';
const intlMessages = defineMessages({
title: {
id: 'app.breakoutJoinConfirmation.leaveConfirmation.title',
defaultMessage: 'Join Breakout Room',
},
message: {
id: 'app.breakoutJoinConfirmation.message',
defaultMessage: 'Do you want to join this Breakout Room??',
},
confirmLabel: {
id: 'app.breakoutJoinConfirmation.confirmLabel',
defaultMessage: 'Join',
},
confirmDesc: {
id: 'app.breakoutJoinConfirmation.confirmDesc',
defaultMessage: 'Join you to the Breakout Room',
},
dismissLabel: {
id: 'app.breakoutJoinConfirmation.dismissLabel',
defaultMessage: 'Cancel',
},
dismissDesc: {
id: 'app.breakoutJoinConfirmation.dismissDesc',
defaultMessage: 'Closes and rejects Joining the Breakout Room',
},
});
class LeaveConfirmation extends Component {
constructor(props) {
super(props);
this.handleJoinBreakoutConfirmation = this.handleJoinBreakoutConfirmation.bind(this);
}
handleJoinBreakoutConfirmation() {
const { breakoutURL } = this.props;
window.open(breakoutURL);
clearModal();
}
render() {
const { intl } = 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),
}}>
{intl.formatMessage(intlMessages.message)}
</Modal>
);
}
};
export default injectIntl(LeaveConfirmation);