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