mirror of
https://github.com/status-im/MyCrypto.git
synced 2025-01-26 19:09:11 +00:00
Clean up typing and formatting
This commit is contained in:
parent
6b2a8eedbc
commit
1c601f58e4
@ -18,7 +18,7 @@ interface OwnProps {
|
||||
placeholder?: string;
|
||||
value?: string;
|
||||
dropdownThreshold?: number;
|
||||
onChangeOverride?: (ev: React.FormEvent<HTMLInputElement>) => void;
|
||||
onChangeOverride?(ev: React.FormEvent<HTMLInputElement>): void;
|
||||
}
|
||||
|
||||
interface StateProps {
|
||||
|
@ -8,12 +8,24 @@ import { addressBookSelectors } from 'features/addressBook';
|
||||
import { Address, Identicon } from 'components/ui';
|
||||
import './AddressFieldDropdown.scss';
|
||||
|
||||
/**
|
||||
* @desc The `onChangeOverride` prop needs to work
|
||||
* with actual events, but also needs a value to be directly passed in
|
||||
* occasionally. This interface allows us to skip all of the other FormEvent
|
||||
* properties and methods.
|
||||
*/
|
||||
interface FakeFormEvent {
|
||||
currentTarget: {
|
||||
value: string;
|
||||
};
|
||||
}
|
||||
|
||||
interface StateProps {
|
||||
value?: string;
|
||||
dropdownThreshold?: number;
|
||||
onChangeOverride?: (ev: React.FormEvent<HTMLInputElement>) => void;
|
||||
labelAddresses: ReturnType<typeof addressBookSelectors.getLabelAddresses>;
|
||||
currentTo: ReturnType<typeof transactionSelectors.getToRaw>;
|
||||
onChangeOverride?(ev: React.FormEvent<HTMLInputElement> | FakeFormEvent): void;
|
||||
}
|
||||
|
||||
interface DispatchProps {
|
||||
|
@ -18,8 +18,8 @@ interface OwnProps {
|
||||
showIdenticon?: boolean;
|
||||
value?: string;
|
||||
dropdownThreshold?: number;
|
||||
onChangeOverride?: (ev: React.FormEvent<HTMLInputElement>) => void;
|
||||
withProps(props: CallbackProps): React.ReactElement<any> | null;
|
||||
onChangeOverride?(ev: React.FormEvent<HTMLInputElement>): void;
|
||||
}
|
||||
|
||||
interface State {
|
||||
@ -113,8 +113,8 @@ interface DefaultAddressFieldProps {
|
||||
showIdenticon?: boolean;
|
||||
value?: string;
|
||||
dropdownThreshold?: number;
|
||||
onChangeOverride?: (ev: React.FormEvent<HTMLInputElement>) => void;
|
||||
withProps(props: CallbackProps): React.ReactElement<any> | null;
|
||||
onChangeOverride?(ev: React.FormEvent<HTMLInputElement>): void;
|
||||
}
|
||||
|
||||
const DefaultAddressField: React.SFC<DefaultAddressFieldProps> = ({
|
||||
|
@ -32,8 +32,8 @@ interface OwnProps {
|
||||
className?: string;
|
||||
value?: string;
|
||||
dropdownThreshold?: number;
|
||||
onChangeOverride?: (ev: React.FormEvent<HTMLInputElement>) => void;
|
||||
onChange(ev: React.FormEvent<HTMLInputElement>): void;
|
||||
onChangeOverride?(ev: React.FormEvent<HTMLInputElement>): void;
|
||||
onFocus(ev: React.FormEvent<HTMLInputElement>): void;
|
||||
onBlur(ev: React.FormEvent<HTMLInputElement>): void;
|
||||
withProps(props: CallbackProps): React.ReactElement<any> | null;
|
||||
@ -63,7 +63,6 @@ type Props = OwnProps & StateProps;
|
||||
class AddressInputFactoryClass extends Component<Props> {
|
||||
public render() {
|
||||
const {
|
||||
className,
|
||||
label,
|
||||
currentTo,
|
||||
onChange,
|
||||
|
Loading…
x
Reference in New Issue
Block a user