mirror of
https://github.com/status-im/MyCrypto.git
synced 2025-01-27 11:24:46 +00:00
Clean up typing and formatting
This commit is contained in:
parent
6b2a8eedbc
commit
1c601f58e4
@ -18,7 +18,7 @@ interface OwnProps {
|
|||||||
placeholder?: string;
|
placeholder?: string;
|
||||||
value?: string;
|
value?: string;
|
||||||
dropdownThreshold?: number;
|
dropdownThreshold?: number;
|
||||||
onChangeOverride?: (ev: React.FormEvent<HTMLInputElement>) => void;
|
onChangeOverride?(ev: React.FormEvent<HTMLInputElement>): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface StateProps {
|
interface StateProps {
|
||||||
|
@ -8,12 +8,24 @@ import { addressBookSelectors } from 'features/addressBook';
|
|||||||
import { Address, Identicon } from 'components/ui';
|
import { Address, Identicon } from 'components/ui';
|
||||||
import './AddressFieldDropdown.scss';
|
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 {
|
interface StateProps {
|
||||||
value?: string;
|
value?: string;
|
||||||
dropdownThreshold?: number;
|
dropdownThreshold?: number;
|
||||||
onChangeOverride?: (ev: React.FormEvent<HTMLInputElement>) => void;
|
|
||||||
labelAddresses: ReturnType<typeof addressBookSelectors.getLabelAddresses>;
|
labelAddresses: ReturnType<typeof addressBookSelectors.getLabelAddresses>;
|
||||||
currentTo: ReturnType<typeof transactionSelectors.getToRaw>;
|
currentTo: ReturnType<typeof transactionSelectors.getToRaw>;
|
||||||
|
onChangeOverride?(ev: React.FormEvent<HTMLInputElement> | FakeFormEvent): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface DispatchProps {
|
interface DispatchProps {
|
||||||
|
@ -18,8 +18,8 @@ interface OwnProps {
|
|||||||
showIdenticon?: boolean;
|
showIdenticon?: boolean;
|
||||||
value?: string;
|
value?: string;
|
||||||
dropdownThreshold?: number;
|
dropdownThreshold?: number;
|
||||||
onChangeOverride?: (ev: React.FormEvent<HTMLInputElement>) => void;
|
|
||||||
withProps(props: CallbackProps): React.ReactElement<any> | null;
|
withProps(props: CallbackProps): React.ReactElement<any> | null;
|
||||||
|
onChangeOverride?(ev: React.FormEvent<HTMLInputElement>): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface State {
|
interface State {
|
||||||
@ -113,8 +113,8 @@ interface DefaultAddressFieldProps {
|
|||||||
showIdenticon?: boolean;
|
showIdenticon?: boolean;
|
||||||
value?: string;
|
value?: string;
|
||||||
dropdownThreshold?: number;
|
dropdownThreshold?: number;
|
||||||
onChangeOverride?: (ev: React.FormEvent<HTMLInputElement>) => void;
|
|
||||||
withProps(props: CallbackProps): React.ReactElement<any> | null;
|
withProps(props: CallbackProps): React.ReactElement<any> | null;
|
||||||
|
onChangeOverride?(ev: React.FormEvent<HTMLInputElement>): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
const DefaultAddressField: React.SFC<DefaultAddressFieldProps> = ({
|
const DefaultAddressField: React.SFC<DefaultAddressFieldProps> = ({
|
||||||
|
@ -32,8 +32,8 @@ interface OwnProps {
|
|||||||
className?: string;
|
className?: string;
|
||||||
value?: string;
|
value?: string;
|
||||||
dropdownThreshold?: number;
|
dropdownThreshold?: number;
|
||||||
onChangeOverride?: (ev: React.FormEvent<HTMLInputElement>) => void;
|
|
||||||
onChange(ev: React.FormEvent<HTMLInputElement>): void;
|
onChange(ev: React.FormEvent<HTMLInputElement>): void;
|
||||||
|
onChangeOverride?(ev: React.FormEvent<HTMLInputElement>): void;
|
||||||
onFocus(ev: React.FormEvent<HTMLInputElement>): void;
|
onFocus(ev: React.FormEvent<HTMLInputElement>): void;
|
||||||
onBlur(ev: React.FormEvent<HTMLInputElement>): void;
|
onBlur(ev: React.FormEvent<HTMLInputElement>): void;
|
||||||
withProps(props: CallbackProps): React.ReactElement<any> | null;
|
withProps(props: CallbackProps): React.ReactElement<any> | null;
|
||||||
@ -63,7 +63,6 @@ type Props = OwnProps & StateProps;
|
|||||||
class AddressInputFactoryClass extends Component<Props> {
|
class AddressInputFactoryClass extends Component<Props> {
|
||||||
public render() {
|
public render() {
|
||||||
const {
|
const {
|
||||||
className,
|
|
||||||
label,
|
label,
|
||||||
currentTo,
|
currentTo,
|
||||||
onChange,
|
onChange,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user