Add missing type definitions
This commit is contained in:
@@ -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,
|
||||
});
|
||||
|
@@ -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 (
|
||||
|
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user