import PropTypes from 'prop-types'; import React, { Component } from 'react'; import { connect } from 'react-redux'; import classNames from 'classnames'; import { FormattedMessage as Message } from 'react-intl'; import { Input, TextArea, Button, Form, FormModel, Dropdown, } from 'components/ui/form'; import feedback from 'services/api/feedback'; import icons from 'components/ui/icons.scss'; import popupStyles from 'components/ui/popup/popup.scss'; import logger from 'services/logger'; import styles from './contactForm.scss'; import messages from './contactForm.intl.json'; const CONTACT_CATEGORIES = [ // TODO: сюда позже проставить реальные id категорий с backend , , , , , ]; export class ContactForm extends Component { static displayName = 'ContactForm'; static propTypes = { onClose: PropTypes.func, user: PropTypes.shape({ email: PropTypes.string, }).isRequired, }; static defaultProps = { onClose() {}, }; state = { isLoading: false, isSuccessfullySent: false, }; form = new FormModel(); render() { const { isSuccessfullySent } = this.state || {}; const { onClose } = this.props; return (

{isSuccessfullySent ? this.renderSuccess() : this.renderForm()}
); } renderForm() { const { form } = this; const { user } = this.props; const { isLoading } = this.state; return (