Skip to content

Commit

Permalink
Merge pull request bitpay#1873 from micahriggan/feature/load-more-txs
Browse files Browse the repository at this point in the history
feature(insight): load more txs
  • Loading branch information
micahriggan authored Jan 8, 2019
2 parents bc2697f + 8286fe1 commit e436459
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,15 @@

<div *ngIf="!loading">
<ion-grid>
<ion-row *ngFor="let tx of transactions">
<ion-col col-12>
<ion-row *ngFor="let tx of transactions; let i = index">
<ion-col col-12 *ngIf="i < limit">
<transaction [tx]="tx"></transaction>
</ion-col>
</ion-row>
<ion-row *ngIf="limit < transactions.length">
<ion-col col-12 text-center (click)="loadMore()">
<a>Load More</a>
</ion-col>
</ion-row>
</ion-grid>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ export class TransactionListComponent implements OnInit {
@Input()
public transactions?: any = [];

limit = 10;
chunkSize = 100;

constructor(private txProvider: TxsProvider) {}

ngOnInit(): void {
Expand All @@ -33,4 +36,9 @@ export class TransactionListComponent implements OnInit {
this.loading = false;
}
}

loadMore() {
this.limit += this.chunkSize;
this.chunkSize *= 2;
}
}

0 comments on commit e436459

Please # to comment.