Bisq markets: Titles

This commit is contained in:
softsimon 2021-03-14 23:24:06 +07:00
parent 146fcfc16d
commit 8e29a4cefd
No known key found for this signature in database
GPG Key ID: 488D7DCFB5A430D7
3 changed files with 10 additions and 2 deletions

View File

@ -1,5 +1,5 @@
<div class="container-xl">
<h1>Active Markets</h1>
<h1>Markets</h1>
<ng-container *ngIf="{ value: (tickers$ | async) } as tickers">
<table class="table table-borderless table-striped">

View File

@ -1,6 +1,7 @@
import { ChangeDetectionStrategy, Component, OnInit } from '@angular/core';
import { Observable, combineLatest } from 'rxjs';
import { filter, map } from 'rxjs/operators';
import { SeoService } from 'src/app/services/seo.service';
import { StateService } from 'src/app/services/state.service';
import { WebsocketService } from 'src/app/services/websocket.service';
import { BisqApiService } from '../bisq-api.service';
@ -19,9 +20,11 @@ export class BisqDashboardComponent implements OnInit {
private websocketService: WebsocketService,
private bisqApiService: BisqApiService,
private stateService: StateService,
private seoService: SeoService,
) { }
ngOnInit(): void {
this.seoService.setTitle(`Markets`);
this.websocketService.want(['blocks']);
this.tickers$ = combineLatest([

View File

@ -3,6 +3,7 @@ import { FormBuilder, FormGroup } from '@angular/forms';
import { ActivatedRoute } from '@angular/router';
import { combineLatest, merge, Observable, of } from 'rxjs';
import { map, switchMap } from 'rxjs/operators';
import { SeoService } from 'src/app/services/seo.service';
import { WebsocketService } from 'src/app/services/websocket.service';
import { BisqApiService } from '../bisq-api.service';
@ -25,6 +26,7 @@ export class BisqMarketComponent implements OnInit, OnDestroy {
private route: ActivatedRoute,
private bisqApiService: BisqApiService,
private formBuilder: FormBuilder,
private seoService: SeoService,
) { }
ngOnInit(): void {
@ -37,8 +39,11 @@ export class BisqMarketComponent implements OnInit, OnDestroy {
switchMap((markets) => combineLatest([of(markets), this.route.paramMap])),
map(([markets, routeParams]) => {
const pair = routeParams.get('pair');
const pairUpperCase = pair.replace('_', '/').toUpperCase();
this.seoService.setTitle(`Bisq market: ${pairUpperCase}`);
return {
pair: pair.replace('_', '/').toUpperCase(),
pair: pairUpperCase,
market: markets[pair],
};
})