Add specific render path for error and loading
This commit is contained in:
@@ -54,10 +54,9 @@ export class RelayerIndex extends React.Component<RelayerIndexProps, RelayerInde
|
|||||||
this._isUnmounted = true;
|
this._isUnmounted = true;
|
||||||
}
|
}
|
||||||
public render() {
|
public render() {
|
||||||
// TODO: loading and error states with a scrolling container
|
|
||||||
const readyToRender = _.isUndefined(this.state.error) && !_.isUndefined(this.state.relayerInfos);
|
const readyToRender = _.isUndefined(this.state.error) && !_.isUndefined(this.state.relayerInfos);
|
||||||
return (
|
if (readyToRender) {
|
||||||
readyToRender && (
|
return (
|
||||||
<div style={styles.root}>
|
<div style={styles.root}>
|
||||||
<GridList
|
<GridList
|
||||||
cellHeight={CELL_HEIGHT}
|
cellHeight={CELL_HEIGHT}
|
||||||
@@ -74,8 +73,11 @@ export class RelayerIndex extends React.Component<RelayerIndexProps, RelayerInde
|
|||||||
))}
|
))}
|
||||||
</GridList>
|
</GridList>
|
||||||
</div>
|
</div>
|
||||||
)
|
);
|
||||||
);
|
} else {
|
||||||
|
// TODO: loading and error states with a scrolling container
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
private async _fetchRelayerInfosAsync(): Promise<void> {
|
private async _fetchRelayerInfosAsync(): Promise<void> {
|
||||||
try {
|
try {
|
||||||
|
Reference in New Issue
Block a user