diff --git a/app/soapbox/features/groups/create/index.js b/app/soapbox/features/groups/create/index.js deleted file mode 100644 index d7189baa4..000000000 --- a/app/soapbox/features/groups/create/index.js +++ /dev/null @@ -1,116 +0,0 @@ -import classNames from 'clsx'; -import PropTypes from 'prop-types'; -import React from 'react'; -import { defineMessages, injectIntl } from 'react-intl'; -import { connect } from 'react-redux'; -import { withRouter } from 'react-router-dom'; - -import { changeValue, submit, reset } from '../../../actions/group_editor'; - -const messages = defineMessages({ - title: { id: 'groups.form.title', defaultMessage: 'Enter a new group title' }, - description: { id: 'groups.form.description', defaultMessage: 'Enter the group description' }, - coverImage: { id: 'groups.form.coverImage', defaultMessage: 'Upload a banner image' }, - coverImageChange: { id: 'groups.form.coverImageChange', defaultMessage: 'Banner image selected' }, - create: { id: 'groups.form.create', defaultMessage: 'Create group' }, -}); - -const mapStateToProps = state => ({ - title: state.getIn(['group_editor', 'title']), - description: state.getIn(['group_editor', 'description']), - coverImage: state.getIn(['group_editor', 'coverImage']), - disabled: state.getIn(['group_editor', 'isSubmitting']), -}); - -const mapDispatchToProps = dispatch => ({ - onTitleChange: value => dispatch(changeValue('title', value)), - onDescriptionChange: value => dispatch(changeValue('description', value)), - onCoverImageChange: value => dispatch(changeValue('coverImage', value)), - onSubmit: routerHistory => dispatch(submit(routerHistory)), - reset: () => dispatch(reset()), -}); - -export default @connect(mapStateToProps, mapDispatchToProps) -@injectIntl -@withRouter -class Create extends React.PureComponent { - - static propTypes = { - title: PropTypes.string.isRequired, - description: PropTypes.string.isRequired, - coverImage: PropTypes.object, - disabled: PropTypes.bool, - intl: PropTypes.object.isRequired, - onTitleChange: PropTypes.func.isRequired, - onSubmit: PropTypes.func.isRequired, - reset: PropTypes.func.isRequired, - onDescriptionChange: PropTypes.func.isRequired, - onCoverImageChange: PropTypes.func.isRequired, - history: PropTypes.object, - }; - - constructor(props) { - super(props); - props.reset(); - } - - handleTitleChange = e => { - this.props.onTitleChange(e.target.value); - } - - handleDescriptionChange = e => { - this.props.onDescriptionChange(e.target.value); - } - - handleCoverImageChange = e => { - this.props.onCoverImageChange(e.target.files[0]); - } - - handleSubmit = e => { - e.preventDefault(); - this.props.onSubmit(this.props.history); - } - - render() { - const { title, description, coverImage, disabled, intl } = this.props; - - return ( -
-
- -
-
-