Commit 19a080a4 by Torkel Ödegaard

Restored loading spinner to DataPanel

parent 79008a7a
...@@ -188,11 +188,7 @@ export class DataPanel extends Component<Props, State> { ...@@ -188,11 +188,7 @@ export class DataPanel extends Component<Props, State> {
const panelData = this.getPanelData(); const panelData = this.getPanelData();
if (isFirstLoad && loading === LoadingState.Loading) { if (isFirstLoad && loading === LoadingState.Loading) {
return ( return this.renderLoadingState();
<div className="panel-loading">
<i className="fa fa-spinner fa-spin" />
</div>
);
} }
if (!queries.length) { if (!queries.length) {
...@@ -203,9 +199,23 @@ export class DataPanel extends Component<Props, State> { ...@@ -203,9 +199,23 @@ export class DataPanel extends Component<Props, State> {
); );
} }
return this.props.children({ return (
loading, <>
panelData, {this.renderLoadingState()}
}); {this.props.children({ loading, panelData })}
</>
);
}
private renderLoadingState(): JSX.Element {
const { loading } = this.state;
if (loading === LoadingState.Loading) {
return (
<div className="panel-loading">
<i className="fa fa-spinner fa-spin" />
</div>
);
}
return null;
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment