30 lines
1006 B
TypeScript
30 lines
1006 B
TypeScript
import {ChangeDetectionStrategy, Component, Input, OnInit} from '@angular/core';
|
|
import {Router} from '@angular/router';
|
|
|
|
@Component({
|
|
selector: 'app-transaction-details',
|
|
templateUrl: './transaction-details.component.html',
|
|
styleUrls: ['./transaction-details.component.scss'],
|
|
changeDetection: ChangeDetectionStrategy.OnPush
|
|
})
|
|
export class TransactionDetailsComponent implements OnInit {
|
|
@Input() transaction;
|
|
senderBloxbergLink: string;
|
|
recipientBloxbergLink: string;
|
|
|
|
constructor(private router: Router) { }
|
|
|
|
ngOnInit(): void {
|
|
this.senderBloxbergLink = 'https://blockexplorer.bloxberg.org/address/' + this.transaction?.from + '/transactions';
|
|
this.recipientBloxbergLink = 'https://blockexplorer.bloxberg.org/address/' + this.transaction?.to + '/transactions';
|
|
}
|
|
|
|
viewSender(): void {
|
|
this.router.navigateByUrl(`/accounts/${this.transaction.from}`).then();
|
|
}
|
|
|
|
viewRecipient(): void {
|
|
this.router.navigateByUrl(`/accounts/${this.transaction.to}`).then();
|
|
}
|
|
}
|