2021-03-14 09:23:20 +01:00
|
|
|
import {ChangeDetectionStrategy, Component, Input, OnInit} from '@angular/core';
|
2021-03-10 10:47:01 +01:00
|
|
|
import {Router} from '@angular/router';
|
2020-11-04 13:36:30 +01:00
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: 'app-transaction-details',
|
|
|
|
templateUrl: './transaction-details.component.html',
|
2021-03-14 09:23:20 +01:00
|
|
|
styleUrls: ['./transaction-details.component.scss'],
|
|
|
|
changeDetection: ChangeDetectionStrategy.OnPush
|
2020-11-04 13:36:30 +01:00
|
|
|
})
|
|
|
|
export class TransactionDetailsComponent implements OnInit {
|
2020-12-05 07:30:30 +01:00
|
|
|
@Input() transaction;
|
2021-03-15 12:58:18 +01:00
|
|
|
senderBloxbergLink: string;
|
|
|
|
recipientBloxbergLink: string;
|
2020-11-04 13:36:30 +01:00
|
|
|
|
2021-03-10 10:47:01 +01:00
|
|
|
constructor(private router: Router) { }
|
2020-11-04 13:36:30 +01:00
|
|
|
|
|
|
|
ngOnInit(): void {
|
2021-03-15 12:58:18 +01:00
|
|
|
this.senderBloxbergLink = 'https://blockexplorer.bloxberg.org/address/' + this.transaction?.from + '/transactions';
|
|
|
|
this.recipientBloxbergLink = 'https://blockexplorer.bloxberg.org/address/' + this.transaction?.to + '/transactions';
|
2020-11-04 13:36:30 +01:00
|
|
|
}
|
|
|
|
|
2021-03-10 10:47:01 +01:00
|
|
|
viewSender(): void {
|
|
|
|
this.router.navigateByUrl(`/accounts/${this.transaction.from}`).then();
|
|
|
|
}
|
|
|
|
|
|
|
|
viewRecipient(): void {
|
|
|
|
this.router.navigateByUrl(`/accounts/${this.transaction.to}`).then();
|
|
|
|
}
|
2020-11-04 13:36:30 +01:00
|
|
|
}
|