2019-01-15 05:39:03 +08:00
|
|
|
import React from 'react';
|
|
|
|
import PropTypes from 'prop-types';
|
2020-05-26 04:00:13 +08:00
|
|
|
import { defineMessages, injectIntl } from 'react-intl';
|
2019-01-15 05:39:03 +08:00
|
|
|
import Button from '/imports/ui/components/button/component';
|
|
|
|
import Modal from '/imports/ui/components/modal/simple/component';
|
|
|
|
import { styles } from './styles';
|
2020-06-26 20:45:03 +08:00
|
|
|
import EndMeetingUserList from './user-list/component';
|
2019-01-15 05:39:03 +08:00
|
|
|
|
|
|
|
const intlMessages = defineMessages({
|
|
|
|
endMeetingTitle: {
|
|
|
|
id: 'app.endMeeting.title',
|
|
|
|
description: 'end meeting title',
|
|
|
|
},
|
|
|
|
endMeetingDescription: {
|
|
|
|
id: 'app.endMeeting.description',
|
|
|
|
description: 'end meeting description',
|
|
|
|
},
|
|
|
|
yesLabel: {
|
|
|
|
id: 'app.endMeeting.yesLabel',
|
|
|
|
description: 'label for yes button for end meeting',
|
|
|
|
},
|
|
|
|
noLabel: {
|
|
|
|
id: 'app.endMeeting.noLabel',
|
|
|
|
description: 'label for no button for end meeting',
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
const propTypes = {
|
2020-05-26 04:00:13 +08:00
|
|
|
intl: PropTypes.object.isRequired,
|
2019-01-15 05:39:03 +08:00
|
|
|
closeModal: PropTypes.func.isRequired,
|
|
|
|
endMeeting: PropTypes.func.isRequired,
|
2020-06-26 20:45:03 +08:00
|
|
|
users: PropTypes.arrayOf(PropTypes.shape({})).isRequired,
|
2019-01-15 05:39:03 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class EndMeetingComponent extends React.PureComponent {
|
|
|
|
render() {
|
2020-06-26 20:45:03 +08:00
|
|
|
const {
|
|
|
|
users, intl, closeModal, endMeeting,
|
|
|
|
} = this.props;
|
2019-01-15 05:39:03 +08:00
|
|
|
|
|
|
|
return (
|
|
|
|
<Modal
|
|
|
|
overlayClassName={styles.overlay}
|
|
|
|
className={styles.modal}
|
2019-01-18 00:33:43 +08:00
|
|
|
onRequestClose={closeModal}
|
2019-01-15 05:39:03 +08:00
|
|
|
hideBorder
|
2019-01-18 03:11:16 +08:00
|
|
|
title={intl.formatMessage(intlMessages.endMeetingTitle)}
|
2019-01-15 05:39:03 +08:00
|
|
|
>
|
|
|
|
<div className={styles.container}>
|
|
|
|
<div className={styles.description}>
|
2020-06-26 20:45:03 +08:00
|
|
|
<EndMeetingUserList
|
|
|
|
users={users}
|
|
|
|
/>
|
2019-01-15 05:39:03 +08:00
|
|
|
{intl.formatMessage(intlMessages.endMeetingDescription)}
|
|
|
|
</div>
|
|
|
|
<div className={styles.footer}>
|
|
|
|
<Button
|
2019-06-04 23:05:27 +08:00
|
|
|
data-test="confirmEndMeeting"
|
2019-01-15 05:39:03 +08:00
|
|
|
color="primary"
|
|
|
|
className={styles.button}
|
|
|
|
label={intl.formatMessage(intlMessages.yesLabel)}
|
2019-01-18 00:33:43 +08:00
|
|
|
onClick={endMeeting}
|
2019-01-15 05:39:03 +08:00
|
|
|
/>
|
|
|
|
<Button
|
|
|
|
label={intl.formatMessage(intlMessages.noLabel)}
|
|
|
|
className={styles.button}
|
2019-01-18 00:33:43 +08:00
|
|
|
onClick={closeModal}
|
2019-01-15 05:39:03 +08:00
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</Modal>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
EndMeetingComponent.propTypes = propTypes;
|
|
|
|
|
|
|
|
export default injectIntl(EndMeetingComponent);
|