Tooltip-style tx previews in block overview

This commit is contained in:
Mononaut
2022-06-15 01:40:05 +00:00
parent 08454f2833
commit aa0fc24dc5
12 changed files with 204 additions and 73 deletions

View File

@@ -5,5 +5,5 @@
[blockLimit]="stateService.blockVSize"
[orientation]="'left'"
[flip]="true"
(txPreviewEvent)="onTxPreview($event)"
(txClickEvent)="onTxClick($event)"
></app-block-overview-graph>

View File

@@ -6,6 +6,8 @@ import { BlockOverviewGraphComponent } from 'src/app/components/block-overview-g
import { Subscription, BehaviorSubject, merge, of } from 'rxjs';
import { switchMap, filter } from 'rxjs/operators';
import { WebsocketService } from 'src/app/services/websocket.service';
import { RelativeUrlPipe } from 'src/app/shared/pipes/relative-url/relative-url.pipe';
import { Router } from '@angular/router';
@Component({
selector: 'app-mempool-block-overview',
@@ -27,7 +29,8 @@ export class MempoolBlockOverviewComponent implements OnDestroy, OnChanges, Afte
constructor(
public stateService: StateService,
private websocketService: WebsocketService
private websocketService: WebsocketService,
private router: Router,
) { }
ngAfterViewInit(): void {
@@ -89,7 +92,8 @@ export class MempoolBlockOverviewComponent implements OnDestroy, OnChanges, Afte
this.isLoading$.next(false);
}
onTxPreview(event: TransactionStripped | void): void {
this.txPreviewEvent.emit(event);
onTxClick(event: TransactionStripped): void {
const url = new RelativeUrlPipe(this.stateService).transform(`/tx/${event.txid}`);
this.router.navigate([url]);
}
}