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

57 lines
1.6 KiB
React
Raw Normal View History

import React, { Component } from 'react';
import { withRouter } from 'react-router';
import { defineMessages, injectIntl } from 'react-intl';
import Modal from '/imports/ui/components/modal/fullscreen/component';
const intlMessages = defineMessages({
title: {
id: 'app.leaveConfirmation.title',
2017-04-10 23:50:03 +08:00
description: 'Leave session modal title',
},
message: {
id: 'app.leaveConfirmation.message',
2017-04-10 23:50:03 +08:00
description: 'message for leaving session',
},
confirmLabel: {
id: 'app.leaveConfirmation.confirmLabel',
2017-04-10 23:50:03 +08:00
description: 'Confirmation button label',
},
confirmDesc: {
id: 'app.leaveConfirmation.confirmDesc',
2017-04-11 21:52:30 +08:00
description: 'adds context to confim option',
},
dismissLabel: {
id: 'app.leaveConfirmation.dismissLabel',
2017-04-10 23:50:03 +08:00
description: 'Dismiss button label',
},
dismissDesc: {
id: 'app.leaveConfirmation.dismissDesc',
2017-04-11 21:52:30 +08:00
description: 'adds context to dismiss option',
},
});
class LeaveConfirmation extends Component {
render() {
const { intl, router } = this.props;
return (
<Modal
title={intl.formatMessage(intlMessages.title)}
confirm={{
callback: () => router.push('/logout'),
label: intl.formatMessage(intlMessages.confirmLabel),
description: intl.formatMessage(intlMessages.confirmDesc),
}}
dismiss={{
callback: () => null,
label: intl.formatMessage(intlMessages.dismissLabel),
description: intl.formatMessage(intlMessages.dismissDesc),
}}>
{intl.formatMessage(intlMessages.message)}
</Modal>
);
}
};
export default withRouter(injectIntl(LeaveConfirmation));