gab-social/app/javascript/gabsocial/components/modal/group_create_modal.js

36 lines
899 B
JavaScript
Raw Normal View History

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' },
update: { id: 'groups.form.update', defaultMessage: 'Update group' },
2020-03-25 03:08:43 +00:00
})
export default
@injectIntl
class GroupCreateModal extends 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,
groupId: PropTypes.string,
2020-03-25 03:08:43 +00:00
}
render() {
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
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
>
<GroupCreate onCloseModal={onClose} params={{ id: groupId }} />
2020-03-25 03:08:43 +00:00
</ModalLayout>
)
}
}