import React from 'react'; import { defineMessages, FormattedMessage, useIntl } from 'react-intl'; import { changeGroupEditorTitle, changeGroupEditorDescription, submitGroupEditor, } from 'soapbox/actions/groups'; import { Form, FormGroup, Input, Modal, Stack, Textarea } from 'soapbox/components/ui'; import { useAppDispatch, useAppSelector } from 'soapbox/hooks'; const messages = defineMessages({ groupNamePlaceholder: { id: 'manage_group.fields.name_placeholder', defaultMessage: 'Name' }, groupDescriptionPlaceholder: { id: 'manage_group.fields.description_placeholder', defaultMessage: 'Description' }, }); interface IManageGroupModal { onClose: (type?: string) => void, } const ManageGroupModal: React.FC = ({ onClose }) => { const intl = useIntl(); const dispatch = useAppDispatch(); const name = useAppSelector((state) => state.group_editor.displayName); const description = useAppSelector((state) => state.group_editor.note); const id = useAppSelector((state) => state.group_editor.groupId); const isSubmitting = useAppSelector((state) => state.group_editor.isSubmitting); const onChangeName: React.ChangeEventHandler = ({ target }) => { dispatch(changeGroupEditorTitle(target.value)); }; const onChangeDescription: React.ChangeEventHandler = ({ target }) => { dispatch(changeGroupEditorDescription(target.value)); }; const onClickClose = () => { onClose('manage_group'); }; const handleSubmit = () => { dispatch(submitGroupEditor(true)); }; const body = (
} > } >