import React from 'react'; import { connect } from 'react-redux'; import { edit, save } from 'Duck/webhook'; import { Form, Button, Input } from 'UI'; import styles from './webhookForm.module.css'; @connect( (state) => ({ webhook: state.getIn(['webhooks', 'instance']), loading: state.getIn(['webhooks', 'saveRequest', 'loading']), }), { edit, save, } ) class WebhookForm 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 }); save = () => { this.props.save(this.props.webhook).then(() => { this.props.onClose(); }); }; render() { const { webhook, loading } = this.props; return (