HenryNguyen5 8d27d0ba4d Improve form validation (#1772)
* Change gas price validation to be string input based

* Change sanitization to use Nunber

* Have validators use Number over parseFloat

* Fix css validation class

* Add valid css to address field

* Add data field validation

* Remove unused import

* Fix button being hidden on inputs

* Dead code removal

* Unify textarea and input class validation

* Adjust validity styling to only apply after a value has been inputted

* Do not pass custom props to DOM
2018-05-13 14:24:50 -05:00

33 lines
875 B
TypeScript

import React, { PureComponent } from 'react';
import translate from 'translations';
import { SwapInput } from 'reducers/swap/types';
import './PaymentInfo.scss';
import { Input } from 'components/ui';
export interface Props {
origin: SwapInput;
paymentAddress: string | null;
}
export default class PaymentInfo extends PureComponent<Props, {}> {
public render() {
const { origin } = this.props;
return (
<section className="SwapPayment">
<h2>
{translate('SWAP_SEND_TO', {
$origin_amount: origin.amount.toString(),
$origin_label: origin.label
})}
<Input
className="SwapPayment-address"
isValid={!!this.props.paymentAddress}
value={this.props.paymentAddress || undefined}
disabled={true}
/>
</h2>
</section>
);
}
}