import React from 'react'; import { connect } from 'react-redux'; import { edit, save } from 'Duck/customField'; import { Form, Input, Button, Message } from 'UI'; import styles from './customFieldForm.module.css'; @connect( (state) => ({ field: state.getIn(['customFields', 'instance']), saving: state.getIn(['customFields', 'saveRequest', 'loading']), errors: state.getIn(['customFields', 'saveRequest', 'errors']), }), { edit, save, } ) class CustomFieldForm extends React.PureComponent { setFocus = () => this.focusElement.focus(); onChangeSelect = (event, { name, value }) => this.props.edit({ [name]: value }); write = ({ target: { value, name } }) => this.props.edit({ [name]: value }); render() { const { field, errors } = this.props; const exists = field.exists(); return (