import React, { Component } from 'react'; import { Identicon } from 'components/ui'; import translate from 'translations'; //import { EnsAddress } from './components'; import { Query } from 'components/renderCbs'; import { ICurrentTo, getCurrentTo, isValidCurrentTo } from 'selectors/transaction'; import { connect } from 'react-redux'; import { AppState } from 'reducers'; import { CallbackProps } from 'components/AddressFieldFactory'; interface StateProps { currentTo: ICurrentTo; isValid: boolean; } interface OwnProps { onChange(ev: React.FormEvent): void; withProps(props: CallbackProps): React.ReactElement | null; } type Props = OwnProps & StateProps; //TODO: ENS handling class AddressInputFactoryClass extends Component { public render() { const { currentTo, onChange, isValid, withProps } = this.props; const { raw } = currentTo; return (
withProps({ currentTo, isValid, onChange, readOnly: !!readOnly, errorMsg: currentTo.error }) } /> {/**/}
); } } export const AddressInputFactory = connect((state: AppState) => ({ currentTo: getCurrentTo(state), isValid: isValidCurrentTo(state) }))(AddressInputFactoryClass);