add paginated virtual scrolling to blockchain blocks bar

This commit is contained in:
Mononaut
2022-12-27 05:28:57 -06:00
parent 5905eebaa6
commit befafaa60c
11 changed files with 355 additions and 80 deletions

View File

@@ -1,4 +1,4 @@
import { Component, OnInit, OnDestroy, ChangeDetectionStrategy } from '@angular/core';
import { Component, OnInit, OnDestroy, ChangeDetectionStrategy, Input, OnChanges, SimpleChanges } from '@angular/core';
import { Subscription } from 'rxjs';
import { StateService } from '../../services/state.service';
@@ -9,6 +9,10 @@ import { StateService } from '../../services/state.service';
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class BlockchainComponent implements OnInit, OnDestroy {
@Input() pages: any[] = [];
@Input() pageIndex: number;
@Input() blocksPerPage: number = 8;
network: string;
timeLtrSubscription: Subscription;
timeLtr: boolean = this.stateService.timeLtr.value;
@@ -29,6 +33,10 @@ export class BlockchainComponent implements OnInit, OnDestroy {
this.timeLtrSubscription.unsubscribe();
}
trackByPageFn(index: number, item: { height: number }) {
return item.height;
}
toggleTimeDirection() {
this.ltrTransitionEnabled = true;
this.stateService.timeLtr.next(!this.timeLtr);