2020-08-17 21:07:16 +01:00
|
|
|
import React from 'react'
|
2020-03-25 03:08:43 +00:00
|
|
|
import { defineMessages, injectIntl } from 'react-intl'
|
|
|
|
import ModalLayout from './modal_layout'
|
|
|
|
import GroupCreate from '../../features/group_create'
|
|
|
|
|
|
|
|
const messages = defineMessages({
|
2020-04-28 06:33:58 +01:00
|
|
|
title: { id: 'create_group', defaultMessage: 'Create group' },
|
2020-06-11 03:16:23 +01:00
|
|
|
update: { id: 'groups.form.update', defaultMessage: 'Update group' },
|
2020-03-25 03:08:43 +00:00
|
|
|
})
|
|
|
|
|
|
|
|
export default
|
|
|
|
@injectIntl
|
2020-08-17 21:07:16 +01:00
|
|
|
class GroupCreateModal extends React.PureComponent {
|
2020-03-25 03:08:43 +00:00
|
|
|
|
|
|
|
static propTypes = {
|
|
|
|
intl: PropTypes.object.isRequired,
|
2020-04-07 02:53:23 +01:00
|
|
|
onClose: PropTypes.func.isRequired,
|
2020-06-11 03:16:23 +01:00
|
|
|
groupId: PropTypes.string,
|
2020-03-25 03:08:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
2020-06-11 03:16:23 +01:00
|
|
|
const { intl, onClose, groupId } = this.props
|
|
|
|
|
|
|
|
const title = intl.formatMessage(groupId ? messages.update : messages.title)
|
2020-03-25 03:08:43 +00:00
|
|
|
|
|
|
|
return (
|
|
|
|
<ModalLayout
|
2020-06-11 03:16:23 +01:00
|
|
|
title={title}
|
2020-04-28 06:33:58 +01:00
|
|
|
width={440}
|
2020-04-07 02:53:23 +01:00
|
|
|
onClose={onClose}
|
2020-03-25 03:08:43 +00:00
|
|
|
>
|
2020-06-11 03:16:23 +01:00
|
|
|
<GroupCreate onCloseModal={onClose} params={{ id: groupId }} />
|
2020-03-25 03:08:43 +00:00
|
|
|
</ModalLayout>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|