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

39 lines
1.1 KiB
JavaScript
Raw Normal View History

import React from 'react'
import PropTypes from 'prop-types'
2020-03-25 03:08:43 +00: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-25 03:08:43 +00:00
class GroupCreateModal extends React.PureComponent {
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
>
<WrappedBundle component={GroupCreate} componentParams={{ id: groupId, onCloseModal: onClose }} />
2020-03-25 03:08:43 +00:00
</ModalLayout>
)
}
2020-03-25 03:08:43 +00: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)