aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts/components/inputs/token_amount_input.tsx
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2018-05-11 23:38:51 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2018-05-14 16:35:13 +0800
commitb74957acdfc8d67d154bcb4698acd7575db7cc47 (patch)
tree3f33c2faac3b55e52098ab0b5b9883a9b62f5aee /packages/website/ts/components/inputs/token_amount_input.tsx
parent6aed4fb1ae27dabed027c855f2cbdc0bfb4f3b6b (diff)
downloaddexon-sol-tools-b74957acdfc8d67d154bcb4698acd7575db7cc47.tar
dexon-sol-tools-b74957acdfc8d67d154bcb4698acd7575db7cc47.tar.gz
dexon-sol-tools-b74957acdfc8d67d154bcb4698acd7575db7cc47.tar.bz2
dexon-sol-tools-b74957acdfc8d67d154bcb4698acd7575db7cc47.tar.lz
dexon-sol-tools-b74957acdfc8d67d154bcb4698acd7575db7cc47.tar.xz
dexon-sol-tools-b74957acdfc8d67d154bcb4698acd7575db7cc47.tar.zst
dexon-sol-tools-b74957acdfc8d67d154bcb4698acd7575db7cc47.zip
Add missing type definitions
Diffstat (limited to 'packages/website/ts/components/inputs/token_amount_input.tsx')
-rw-r--r--packages/website/ts/components/inputs/token_amount_input.tsx12
1 files changed, 6 insertions, 6 deletions
diff --git a/packages/website/ts/components/inputs/token_amount_input.tsx b/packages/website/ts/components/inputs/token_amount_input.tsx
index 9e638b67b..9a74bdd51 100644
--- a/packages/website/ts/components/inputs/token_amount_input.tsx
+++ b/packages/website/ts/components/inputs/token_amount_input.tsx
@@ -52,14 +52,14 @@ export class TokenAmountInput extends React.Component<TokenAmountInputProps, Tok
isBalanceAndAllowanceLoaded: false,
};
}
- public componentWillMount() {
+ public componentWillMount(): void {
// tslint:disable-next-line:no-floating-promises
this._fetchBalanceAndAllowanceAsync(this.props.token.address, this.props.userAddress);
}
- public componentWillUnmount() {
+ public componentWillUnmount(): void {
this._isUnmounted = true;
}
- public componentWillReceiveProps(nextProps: TokenAmountInputProps) {
+ public componentWillReceiveProps(nextProps: TokenAmountInputProps): void {
if (
nextProps.userAddress !== this.props.userAddress ||
nextProps.networkId !== this.props.networkId ||
@@ -70,7 +70,7 @@ export class TokenAmountInput extends React.Component<TokenAmountInputProps, Tok
this._fetchBalanceAndAllowanceAsync(nextProps.token.address, nextProps.userAddress);
}
}
- public render() {
+ public render(): React.ReactNode {
const amount = this.props.amount
? ZeroEx.toUnitAmount(this.props.amount, this.props.token.decimals)
: undefined;
@@ -98,7 +98,7 @@ export class TokenAmountInput extends React.Component<TokenAmountInputProps, Tok
</div>
);
}
- private _onChange(isValid: boolean, amount?: BigNumber) {
+ private _onChange(isValid: boolean, amount?: BigNumber): void {
let baseUnitAmount;
if (!_.isUndefined(amount)) {
baseUnitAmount = ZeroEx.toBaseUnitAmount(amount, this.props.token.decimals);
@@ -122,7 +122,7 @@ export class TokenAmountInput extends React.Component<TokenAmountInputProps, Tok
return undefined;
}
}
- private async _fetchBalanceAndAllowanceAsync(tokenAddress: string, userAddress: string) {
+ private async _fetchBalanceAndAllowanceAsync(tokenAddress: string, userAddress: string): Promise<void> {
this.setState({
isBalanceAndAllowanceLoaded: false,
});