import { NonceInputFactory } from './NonceInputFactory'; import { inputNonce, TInputNonce } from 'actions/transaction'; import React, { Component } from 'react'; import { connect } from 'react-redux'; import { AppState } from 'reducers'; export interface CallbackProps { nonce: AppState['transaction']['fields']['nonce']; readOnly: boolean; shouldDisplay: boolean; onChange(ev: React.FormEvent): void; } interface DispatchProps { inputNonce: TInputNonce; } interface OwnProps { withProps(props: CallbackProps): React.ReactElement | null; } type Props = OwnProps & DispatchProps; class NonceFieldClass extends Component { public render() { return ; } private setNonce = (ev: React.FormEvent) => { const { value } = ev.currentTarget; this.props.inputNonce(value); }; } export const NonceFieldFactory = connect(null, { inputNonce })(NonceFieldClass);