import React from 'react'; import { Input, Form } from 'antd'; import { ProposalDraft } from 'types'; import { getCreateErrors } from 'modules/create/utils'; import { DONATION } from 'utils/constants'; interface State { payoutAddress: string; tipJarAddress: string; } interface Props { initialState?: Partial; updateForm(form: Partial): void; } export default class CreateFlowPayment extends React.Component { constructor(props: Props) { super(props); this.state = { payoutAddress: '', tipJarAddress: '', ...(props.initialState || {}), }; } render() { const { payoutAddress, tipJarAddress } = this.state; const errors = getCreateErrors(this.state, true); const payoutHelp = errors.payoutAddress || ` This must be a Sapling Z address `; const tipJarHelp = errors.tipJarAddress || ` Allows your proposal to receive tips. Must be a Sapling Z address `; return (
); } private handlePaymentInputChange = ( event: React.ChangeEvent, ) => { const { value, name } = event.currentTarget; this.setState({ [name]: value } as any, () => { this.props.updateForm(this.state); }); }; private handleTippingInputChange = ( event: React.ChangeEvent, ) => { const { value, name } = event.currentTarget; this.setState({ [name]: value } as any, () => { this.props.updateForm(this.state); }); }; }