Add missing type definitions

This commit is contained in:
Leonid Logvinov
2018-05-11 17:38:51 +02:00
parent 6aed4fb1ae
commit b74957acdf
153 changed files with 655 additions and 600 deletions

View File

@@ -109,14 +109,14 @@ class ImgWithFallback extends React.Component<ImgWithFallbackProps, ImgWithFallb
imageLoadFailed: false,
};
}
public render() {
public render(): React.ReactNode {
if (this.state.imageLoadFailed || _.isUndefined(this.props.src)) {
return <img src={this.props.fallbackSrc} style={this.props.style} />;
} else {
return <img src={this.props.src} onError={this._onError.bind(this)} style={this.props.style} />;
}
}
private _onError() {
private _onError(): void {
this.setState({
imageLoadFailed: true,
});

View File

@@ -48,14 +48,14 @@ export class RelayerIndex extends React.Component<RelayerIndexProps, RelayerInde
error: undefined,
};
}
public componentWillMount() {
public componentWillMount(): void {
// tslint:disable-next-line:no-floating-promises
this._fetchRelayerInfosAsync();
}
public componentWillUnmount() {
public componentWillUnmount(): void {
this._isUnmounted = true;
}
public render() {
public render(): React.ReactNode {
const readyToRender = _.isUndefined(this.state.error) && !_.isUndefined(this.state.relayerInfos);
if (!readyToRender) {
return (

View File

@@ -41,6 +41,6 @@ export const TopTokens: React.StatelessComponent<TopTokensProps> = (props: TopTo
);
};
function tokenLinkFromToken(tokenInfo: WebsiteBackendTokenInfo, networkId: number) {
function tokenLinkFromToken(tokenInfo: WebsiteBackendTokenInfo, networkId: number): string {
return sharedUtils.getEtherScanLinkIfExists(tokenInfo.address, networkId, EtherscanLinkSuffixes.Address);
}