Merge pull request #4814 from mempool/natsoni/hide-featured-assets-testnet

Hide featured assets on Liquid testnet
This commit is contained in:
softsimon 2024-03-26 17:10:36 +09:00 committed by GitHub
commit 16f9593d2e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 15 additions and 4 deletions

View File

@ -1,5 +1,7 @@
<div *ngIf="featuredAssets$ | async as featured; else loading" class="featuredBox"> <div *ngIf="featuredAssets$ | async as featured; else loading" class="featuredBox">
<div *ngIf="featured.length === 0" class="text-center">
<div i18n="liquid.no-featured.assets" class="symbol">No featured assets</div>
</div>
<div class="card" *ngFor="let group of featured"> <div class="card" *ngFor="let group of featured">
<ng-template [ngIf]="group.assets" [ngIfElse]="singleAsset"> <ng-template [ngIf]="group.assets" [ngIfElse]="singleAsset">
<a [routerLink]="['/assets/group' | relativeUrl, group.id]"> <a [routerLink]="['/assets/group' | relativeUrl, group.id]">

View File

@ -47,3 +47,9 @@
.ticker { .ticker {
color: grey; color: grey;
} }
.symbol {
color: grey;
font-size: 1.5rem;
font-style: italic;
}

View File

@ -1,6 +1,7 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { Observable } from 'rxjs'; import { Observable } from 'rxjs';
import { ApiService } from '../../../services/api.service'; import { ApiService } from '../../../services/api.service';
import { StateService } from '../../../services/state.service';
@Component({ @Component({
selector: 'app-assets-featured', selector: 'app-assets-featured',
@ -12,10 +13,11 @@ export class AssetsFeaturedComponent implements OnInit {
constructor( constructor(
private apiService: ApiService, private apiService: ApiService,
private stateService: StateService,
) { } ) { }
ngOnInit(): void { ngOnInit(): void {
this.featuredAssets$ = this.apiService.listFeaturedAssets$(); this.featuredAssets$ = this.apiService.listFeaturedAssets$(this.stateService.network);
} }
} }

View File

@ -228,8 +228,9 @@ export class ApiService {
return this.httpClient.get<any>(this.apiBaseUrl + this.apiBasePath + '/api/v1/liquid/reserves/utxos/emergency-spent/stats'); return this.httpClient.get<any>(this.apiBaseUrl + this.apiBasePath + '/api/v1/liquid/reserves/utxos/emergency-spent/stats');
} }
listFeaturedAssets$(): Observable<any[]> { listFeaturedAssets$(network: string = 'liquid'): Observable<any[]> {
return this.httpClient.get<any[]>(this.apiBaseUrl + '/api/v1/assets/featured'); if (network === 'liquid') return this.httpClient.get<any[]>(this.apiBaseUrl + '/api/v1/assets/featured');
return of([]);
} }
getAssetGroup$(id: string): Observable<any> { getAssetGroup$(id: string): Observable<any> {