2020-07-14 14:38:52 +07:00
|
|
|
import { Component, OnInit } from '@angular/core';
|
|
|
|
import { BisqApiService } from '../bisq-api.service';
|
|
|
|
import { BisqStats } from '../bisq.interfaces';
|
|
|
|
import { SeoService } from 'src/app/services/seo.service';
|
2020-07-14 21:26:02 +07:00
|
|
|
import { StateService } from 'src/app/services/state.service';
|
2020-07-14 14:38:52 +07:00
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: 'app-bisq-stats',
|
|
|
|
templateUrl: './bisq-stats.component.html',
|
|
|
|
styleUrls: ['./bisq-stats.component.scss']
|
|
|
|
})
|
|
|
|
export class BisqStatsComponent implements OnInit {
|
|
|
|
isLoading = true;
|
|
|
|
stats: BisqStats;
|
2020-07-14 21:26:02 +07:00
|
|
|
price: number;
|
2020-07-14 14:38:52 +07:00
|
|
|
|
|
|
|
constructor(
|
|
|
|
private bisqApiService: BisqApiService,
|
|
|
|
private seoService: SeoService,
|
2020-07-14 21:26:02 +07:00
|
|
|
private stateService: StateService,
|
2020-07-14 14:38:52 +07:00
|
|
|
) { }
|
|
|
|
|
2020-07-14 21:26:02 +07:00
|
|
|
ngOnInit() {
|
2020-08-12 14:04:04 +07:00
|
|
|
this.seoService.setTitle('BSQ Statistics');
|
2020-07-14 14:38:52 +07:00
|
|
|
|
2020-07-14 21:26:02 +07:00
|
|
|
this.stateService.bsqPrice$
|
|
|
|
.subscribe((bsqPrice) => {
|
|
|
|
this.price = bsqPrice;
|
|
|
|
});
|
|
|
|
|
2020-07-14 14:38:52 +07:00
|
|
|
this.bisqApiService.getStats$()
|
|
|
|
.subscribe((stats) => {
|
|
|
|
this.isLoading = false;
|
|
|
|
this.stats = stats;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|