cic-staff-client/src/app/pages/transactions/transaction-details/transaction-details.compone...

30 lines
1006 B
TypeScript
Raw Normal View History

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;
2021-03-15 12:58:18 +01:00
senderBloxbergLink: string;
recipientBloxbergLink: string;
constructor(private router: Router) { }
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';
}
viewSender(): void {
this.router.navigateByUrl(`/accounts/${this.transaction.from}`).then();
}
viewRecipient(): void {
this.router.navigateByUrl(`/accounts/${this.transaction.to}`).then();
}
}