mirror of
https://github.com/status-im/MyCrypto.git
synced 2025-01-10 19:16:10 +00:00
9ef1920fe0
* Align footer to bottom * Fix request payment offset padding * Update request payment padding * Add new Input and Dropdown components * Fix offset margins in equiv vals * Update all send tx inputs & dropdowns * Update generate wallet dropdowns * Update inputs & dropdowns for contracts tab * Add inputs & dropdowns for all but swap tab * amend * Fix imports * inputs are invalid when not disabled or readonly * Fix offset refresh button * Add togglable password back to wallet generation * Update swap inputs, textareas, and dropdowns * Update any outstanding inputs * Make UnitDropDown searchable * unitdropdown searchanble if options > 10 * Fix css issues * Reset before setting currentTo
31 lines
742 B
TypeScript
31 lines
742 B
TypeScript
import React, { HTMLProps } from 'react';
|
|
import './Input.scss';
|
|
|
|
interface State {
|
|
hasBlurred: boolean;
|
|
}
|
|
|
|
class Input extends React.Component<HTMLProps<HTMLInputElement>, State> {
|
|
public state: State = {
|
|
hasBlurred: false
|
|
};
|
|
public render() {
|
|
return (
|
|
<input
|
|
{...this.props}
|
|
onBlur={e => {
|
|
this.setState({ hasBlurred: true });
|
|
if (this.props && this.props.onBlur) {
|
|
this.props.onBlur(e);
|
|
}
|
|
}}
|
|
className={`input-group-input ${this.props.className} ${
|
|
this.state.hasBlurred ? 'has-blurred' : ''
|
|
} ${!!this.props.value && this.props.value.toString().length > 0 ? 'has-value' : ''}`}
|
|
/>
|
|
);
|
|
}
|
|
}
|
|
|
|
export default Input;
|