39 lines
1.1 KiB
JavaScript
Raw Normal View History

import React from 'react'
import PropTypes from 'prop-types'
2020-03-24 23:08:43 -04:00
import { defineMessages, injectIntl } from 'react-intl'
import ModalLayout from './modal_layout'
import { GroupCreate } from '../../features/ui/util/async_components'
import WrappedBundle from '../../features/ui/util/wrapped_bundle'
2020-03-24 23:08:43 -04:00
class GroupCreateModal extends React.PureComponent {
2020-03-24 23:08:43 -04:00
render() {
const { intl, onClose, groupId } = this.props
const title = intl.formatMessage(groupId ? messages.update : messages.title)
2020-03-24 23:08:43 -04:00
return (
<ModalLayout
title={title}
2020-04-28 01:33:58 -04:00
width={440}
2020-04-06 21:53:23 -04:00
onClose={onClose}
2020-03-24 23:08:43 -04:00
>
<WrappedBundle component={GroupCreate} componentParams={{ id: groupId, onCloseModal: onClose }} />
2020-03-24 23:08:43 -04:00
</ModalLayout>
)
}
2020-03-24 23:08:43 -04:00
}
const messages = defineMessages({
title: { id: 'create_group', defaultMessage: 'Create group' },
update: { id: 'groups.form.update', defaultMessage: 'Update group' },
})
GroupCreateModal.propTypes = {
intl: PropTypes.object.isRequired,
onClose: PropTypes.func.isRequired,
groupId: PropTypes.string,
}
export default injectIntl(GroupCreateModal)