Add loading spinners.
This commit is contained in:
parent
6b5b80f866
commit
d4508bd876
@ -3,7 +3,12 @@
|
|||||||
<h1>Trading volume</h1>
|
<h1>Trading volume</h1>
|
||||||
|
|
||||||
<div id="volumeHolder">
|
<div id="volumeHolder">
|
||||||
<ng-container *ngIf="volumes$ | async as volumes">
|
<ng-template #loadingVolumes>
|
||||||
|
<div class="text-center loadingVolumes">
|
||||||
|
<div class="spinner-border text-light"></div>
|
||||||
|
</div>
|
||||||
|
</ng-template>
|
||||||
|
<ng-container *ngIf="volumes$ | async as volumes; else loadingVolumes">
|
||||||
<app-lightweight-charts-area [data]="volumes.data" [lineData]="volumes.linesData"></app-lightweight-charts-area>
|
<app-lightweight-charts-area [data]="volumes.data" [lineData]="volumes.linesData"></app-lightweight-charts-area>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,4 +1,10 @@
|
|||||||
#volumeHolder {
|
#volumeHolder {
|
||||||
height: 500px;
|
height: 500px;
|
||||||
background-color: #000;
|
background-color: #000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.loadingVolumes {
|
||||||
|
position: relative;
|
||||||
|
top: 50%;
|
||||||
|
z-index: 100;
|
||||||
}
|
}
|
@ -40,7 +40,15 @@
|
|||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<app-lightweight-charts [data]="hlocData.hloc" [volumeData]="hlocData.volume" [precision]="currency.market.rtype === 'crypto' ? currency.market.lprecision : currency.market.rprecision"></app-lightweight-charts>
|
<div class="clearfix"></div>
|
||||||
|
|
||||||
|
<div id="graphHolder">
|
||||||
|
<div class="text-center loadingChart" [hidden]="!isLoadingGraph">
|
||||||
|
<div class="spinner-border text-light"></div>
|
||||||
|
</div>
|
||||||
|
<app-lightweight-charts [data]="hlocData.hloc" [volumeData]="hlocData.volume" [precision]="currency.market.rtype === 'crypto' ? currency.market.lprecision : currency.market.rprecision"></app-lightweight-charts>
|
||||||
|
</div>
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
<ng-container *ngIf="offers$ | async as offers; else loadingSpinner">
|
<ng-container *ngIf="offers$ | async as offers; else loadingSpinner">
|
||||||
|
@ -1,3 +1,14 @@
|
|||||||
.priceheader {
|
.priceheader {
|
||||||
font-size: 24px;
|
font-size: 24px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.loadingChart {
|
||||||
|
z-index: 100;
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
left: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
#graphHolder {
|
||||||
|
height: 550px;
|
||||||
|
}
|
||||||
|
@ -21,6 +21,8 @@ export class BisqMarketComponent implements OnInit, OnDestroy {
|
|||||||
radioGroupForm: FormGroup;
|
radioGroupForm: FormGroup;
|
||||||
defaultInterval = 'day';
|
defaultInterval = 'day';
|
||||||
|
|
||||||
|
isLoadingGraph = false;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private websocketService: WebsocketService,
|
private websocketService: WebsocketService,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
@ -68,10 +70,13 @@ export class BisqMarketComponent implements OnInit, OnDestroy {
|
|||||||
])
|
])
|
||||||
.pipe(
|
.pipe(
|
||||||
switchMap(([routeParams, interval]) => {
|
switchMap(([routeParams, interval]) => {
|
||||||
|
this.isLoadingGraph = true;
|
||||||
const pair = routeParams.get('pair');
|
const pair = routeParams.get('pair');
|
||||||
return this.bisqApiService.getMarketsHloc$(pair, interval);
|
return this.bisqApiService.getMarketsHloc$(pair, interval);
|
||||||
}),
|
}),
|
||||||
map((hlocData) => {
|
map((hlocData) => {
|
||||||
|
this.isLoadingGraph = false;
|
||||||
|
|
||||||
hlocData = hlocData.map((h) => {
|
hlocData = hlocData.map((h) => {
|
||||||
h.time = h.period_start;
|
h.time = h.period_start;
|
||||||
return h;
|
return h;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user