Skip to content

Commit

Permalink
Merge pull request #354 from keerifox/tx-details-tweaks
Browse files Browse the repository at this point in the history
Transaction details page tweaks
  • Loading branch information
Joohansson committed Mar 25, 2021
2 parents cfd5e21 + 0dc8b1e commit d8f6eba
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ <h2 class="uk-heading-divider">Transaction Details</h2>
</div>

<div class="uk-width-1-1" *ngIf="transaction">
<div class="uk-card uk-card-default uk-width-1-1 uk-text-center" *ngIf="blockType !== 'change'">
<div class="uk-card uk-card-default uk-width-1-1 uk-text-center" *ngIf="(blockType !== 'change') && (blockType !== '')">
<span style="display: block; padding-top: 8px;">
<span *ngIf="blockType == 'send'">Send</span>
<span *ngIf="blockType == 'open'">Receive</span>
Expand All @@ -37,8 +37,8 @@ <h2 class="uk-heading-divider">Transaction Details</h2>
<span style="display:block; font-size: 32px;" *ngIf="transaction?.amount">{{ transaction?.amount | rai: 'mnano,true' | amountsplit: 0 }}{{ transaction?.amount | rai: 'mnano,true' | amountsplit: 1 }} NANO</span>
<span *ngIf="amountRaw.gt(0)" style="display:block; font-size: 12px;">+{{ amountRaw.toString(10) }} raw</span>
</div>
<div class="uk-card uk-card-default uk-width-1-1 uk-text-center" *ngIf="blockType == 'change'">
<span style="display:block; font-size: 32px;">Change Representative</span>
<div class="uk-card uk-card-default uk-width-1-1 uk-text-center" *ngIf="(blockType == 'change')">
<span style="display:block; font-size: 32px;">Representative Change</span>
</div>
<br>
<div uk-grid>
Expand Down Expand Up @@ -115,7 +115,7 @@ <h2 class="uk-heading-divider">Transaction Details</h2>
</a>
</div>
</div>
<div class="uk-margin" *ngIf="transaction?.contents?.previous">
<div class="uk-margin" *ngIf="transaction?.contents?.previous && (blockType != 'open')">
<label class="uk-form-label">Previous:</label>
<div class="uk-form-controls uk-text-truncate">
<a [routerLink]="'/transaction/' + transaction?.contents?.previous" class="uk-link-text" uk-tooltip title="View Block Details">{{ transaction?.contents?.previous }}</a>
Expand All @@ -127,7 +127,7 @@ <h2 class="uk-heading-divider">Transaction Details</h2>
<a [routerLink]="'/transaction/' + transaction?.contents?.source" class="uk-link-text" uk-tooltip title="View Block Details">{{ transaction?.contents?.source }}</a>
</div>
</div>
<div class="uk-margin" *ngIf="transaction?.contents?.link && blockType == 'receive'">
<div class="uk-margin" *ngIf="transaction?.contents?.link && (blockType == 'open' || blockType == 'receive')">
<label class="uk-form-label">Link (Source):</label>
<div class="uk-form-controls uk-text-truncate">
<a [routerLink]="'/transaction/' + transaction?.contents?.link" class="uk-link-text" uk-tooltip title="View Block Details">{{ transaction?.contents?.link }}</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export class TransactionDetailsComponent implements OnInit {
routerSub = null;
transaction: any = {};
hashID = '';
blockType = 'send';
blockType = '';
isStateBlock = true;
isUnconfirmedBlock = false;
blockHeight = -1;
Expand Down Expand Up @@ -59,6 +59,7 @@ export class TransactionDetailsComponent implements OnInit {
this.blockHeight = -1;
this.showBlockData = false;
let legacyFromAccount = '';
this.blockType = '';
this.amountRaw = new BigNumber(0);
const hash = this.route.snapshot.params.transaction;
this.hashID = hash;
Expand All @@ -76,9 +77,10 @@ export class TransactionDetailsComponent implements OnInit {
this.isUnconfirmedBlock = (hashData.confirmed === 'false') ? true : false;
this.blockHeight = hashData.height;

this.blockType = hashData.contents.type;
if (this.blockType === 'state') {
const blockType = hashData.contents.type;
if (blockType === 'state') {
const isOpen = hashData.contents.previous === '0000000000000000000000000000000000000000000000000000000000000000';

if (isOpen) {
this.blockType = 'open';
} else {
Expand All @@ -103,6 +105,7 @@ export class TransactionDetailsComponent implements OnInit {
}
}
} else {
this.blockType = blockType;
this.isStateBlock = false;
}
if (hashData.amount) {
Expand Down

0 comments on commit d8f6eba

Please sign in to comment.