Skip to content

Commit

Permalink
Fix prettier warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Yamaguchi committed May 8, 2024
1 parent 0a78964 commit fffe419
Show file tree
Hide file tree
Showing 10 changed files with 115 additions and 42 deletions.
62 changes: 45 additions & 17 deletions frontend/src/app/address/address.page.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,35 @@
(click)="goToCoin(color['colorId'])"
>{{ color['colorId'] | formatColorId }}</ion-col
>
<ion-col size="2" class="pt-10 ion-text-right">{{ color['balanced'] }}</ion-col>
<ion-col size="2" class="pt-10 ion-text-right">{{ color['received'] }}</ion-col>
<ion-col size="2" class="pt-10 ion-text-right">{{ color['sent'] }}</ion-col>
<ion-col size="2" class="pt-10 ion-text-right">{{ color['count'] }}</ion-col>
<ion-col size="2" class="pt-10 ion-text-right"
>{{ color['balanced'] }}</ion-col
>
<ion-col size="2" class="pt-10 ion-text-right"
>{{ color['received'] }}</ion-col
>
<ion-col size="2" class="pt-10 ion-text-right"
>{{ color['sent'] }}</ion-col
>
<ion-col size="2" class="pt-10 ion-text-right"
>{{ color['count'] }}</ion-col
>
</ng-container>
<ng-container *ngIf="!isColored(color['colorId'])">
<ion-col size="4" class="pt-10">{{ color['colorId'] | formatColorId }}</ion-col>
<ion-col size="2" class="pt-10 ion-text-right">{{ color['balanced'] | asTpc }}</ion-col>
<ion-col size="2" class="pt-10 ion-text-right">{{ color['received'] | asTpc }}</ion-col>
<ion-col size="2" class="pt-10 ion-text-right">{{ color['sent'] | asTpc }}</ion-col>
<ion-col size="2" class="pt-10 ion-text-right">{{ color['count'] }}</ion-col>
<ion-col size="4" class="pt-10"
>{{ color['colorId'] | formatColorId }}</ion-col
>
<ion-col size="2" class="pt-10 ion-text-right"
>{{ color['balanced'] | asTpc }}</ion-col
>
<ion-col size="2" class="pt-10 ion-text-right"
>{{ color['received'] | asTpc }}</ion-col
>
<ion-col size="2" class="pt-10 ion-text-right"
>{{ color['sent'] | asTpc }}</ion-col
>
<ion-col size="2" class="pt-10 ion-text-right"
>{{ color['count'] }}</ion-col
>
</ng-container>
</ion-row>
</div>
Expand Down Expand Up @@ -99,7 +117,7 @@
<ng-container *ngFor="let input of tx.vin">
<ion-row>
<ion-col size="6">
<div
<div
(click)="!input.prevout?.scriptpubkey_uncolored_address || goToAddressPage(input.prevout?.scriptpubkey_uncolored_address)"
[ngClass]="{'link-color cursor-pointer ellipsis': input.prevout?.scriptpubkey_uncolored_address}"
>
Expand All @@ -115,24 +133,32 @@
>
</ion-col>
<ion-col size="4" class="ion-text-right">
<ng-container *ngIf="input.is_coinbase">
</ng-container>
<ng-container *ngIf="!input.is_coinbase && !!input.prevout.colorId">
<ng-container *ngIf="input.is_coinbase"> </ng-container>
<ng-container
*ngIf="!input.is_coinbase && !!input.prevout.colorId"
>
{{ input.prevout?.value }}
<span
class="link-color cursor-pointer"
(click)="goToCoin(input.prevout.colorId)"
>COIN
</span>
</ng-container>
<ng-container *ngIf="!input.is_coinbase && !input.prevout.colorId">
<ng-container
*ngIf="!input.is_coinbase && !input.prevout.colorId"
>
{{ input.prevout?.value | asTpc}}
<span>TPC</span>
</ng-container>
</ion-col>
</ion-row>
<ion-row *ngIf="!!input.prevout.colorId" class="table-border-bottom">
<ion-col size="8" class="ion-margin-bottom link-color cursor-pointer font-14 ellipsis"
<ion-row
*ngIf="!!input.prevout.colorId"
class="table-border-bottom"
>
<ion-col
size="8"
class="ion-margin-bottom link-color cursor-pointer font-14 ellipsis"
(click)="goToCoin(input.prevout.colorId)"
>
Color ID: {{ input.prevout?.colorId | formatColorId }}
Expand Down Expand Up @@ -168,7 +194,9 @@
</ion-col>
</ion-row>
<ion-row *ngIf="!!output.colorId" class="table-border-bottom">
<ion-col size="8" class="ion-margin-bottom link-color cursor-pointer font-14 ellipsis"
<ion-col
size="8"
class="ion-margin-bottom link-color cursor-pointer font-14 ellipsis"
(click)="goToCoin(output.colorId)"
>
Color ID: {{ output.colorId | formatColorId }}
Expand Down
5 changes: 4 additions & 1 deletion frontend/src/app/address/address.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ export class AddressPage implements OnInit {
}

isColored(colorId) {
return colorId !== '000000000000000000000000000000000000000000000000000000000000000000';
return (
colorId !==
'000000000000000000000000000000000000000000000000000000000000000000'
);
}
}
20 changes: 14 additions & 6 deletions frontend/src/app/block/block.page.html
Original file line number Diff line number Diff line change
Expand Up @@ -169,18 +169,19 @@
size="8"
class="ion-no-margin text-primary cursor-pointer"
(click)="goToAddress(input.prevout.scriptpubkey_uncolored_address)"
>{{ input.prevout.scriptpubkey_uncolored_address }}</ion-col
>{{ input.prevout.scriptpubkey_uncolored_address
}}</ion-col
>
<ion-col
size="4"
class="ion-no-margin ion-text-right text-gray"
>
>
<ng-container *ngIf="!!input.prevout.colorId">
{{ input.prevout.value }}
<span
class="link-color cursor-pointer"
(click)="goToCoin(input.prevout.colorId)"
>COIN
>COIN
</span>
</ng-container>
<ng-container *ngIf="!input.prevout.colorId">
Expand All @@ -189,8 +190,13 @@
</ng-container>
</ion-col>
</ion-row>
<ion-row *ngIf="!!input.prevout.colorId" class="table-border-bottom">
<ion-col size="8" class="ion-margin-bottom link-color cursor-pointer font-14 ellipsis"
<ion-row
*ngIf="!!input.prevout.colorId"
class="table-border-bottom"
>
<ion-col
size="8"
class="ion-margin-bottom link-color cursor-pointer font-14 ellipsis"
(click)="goToCoin(input.prevout.colorId)"
>
Color ID: {{ input.prevout.colorId | formatColorId }}
Expand Down Expand Up @@ -241,7 +247,9 @@
</ion-col>
</ion-row>
<ion-row *ngIf="!!vout.colorId" class="table-border-bottom">
<ion-col size="8" class="ion-margin-bottom link-color cursor-pointer font-14 ellipsis"
<ion-col
size="8"
class="ion-margin-bottom link-color cursor-pointer font-14 ellipsis"
(click)="goToCoin(vout.colorId)"
>
Color ID: {{ vout.colorId | formatColorId }}
Expand Down
1 change: 0 additions & 1 deletion frontend/src/app/blocks/blocks.page.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ ion-content {
}
}


.display-none-max-md {
@media (max-width: 768px) {
display: none;
Expand Down
33 changes: 25 additions & 8 deletions frontend/src/app/color/color.page.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,26 +77,37 @@ <h3 id="color-header-text">Transactions</h3>
</ion-col>
<ion-col size="4" class="ion-text-right">
<ng-container *ngIf="input.is_coinbase"></ng-container>
<ng-container *ngIf="!input.is_coinbase && !!input.prevout.colorId && input.prevout.colorId !== colorId">
<ng-container
*ngIf="!input.is_coinbase && !!input.prevout.colorId && input.prevout.colorId !== colorId"
>
{{ input.prevout?.value }}
<span
class="link-color cursor-pointer"
(click)="goToCoin(input.prevout.colorId)"
>COIN
</span>
</ng-container>
<ng-container *ngIf="!input.is_coinbase && !!input.prevout.colorId && input.prevout.colorId === colorId">
<ng-container
*ngIf="!input.is_coinbase && !!input.prevout.colorId && input.prevout.colorId === colorId"
>
{{ input.prevout?.value }}
<span class="cursor-pointer">COIN</span>
</ng-container>
<ng-container *ngIf="!input.is_coinbase && !input.prevout.colorId">
<ng-container
*ngIf="!input.is_coinbase && !input.prevout.colorId"
>
{{ input.prevout?.value | asTpc}}
<span>TPC</span>
</ng-container>
</ion-col>
</ion-row>
<ion-row *ngIf="!!input.prevout.colorId" class="table-border-bottom">
<ion-col size="8" class="link-color cursor-pointer font-14 ellipsis"
<ion-row
*ngIf="!!input.prevout.colorId"
class="table-border-bottom"
>
<ion-col
size="8"
class="link-color cursor-pointer font-14 ellipsis"
(click)="goToCoin(input.prevout.colorId)"
>
Color ID: {{ input.prevout.colorId | formatColorId }}
Expand All @@ -117,15 +128,19 @@ <h3 id="color-header-text">Transactions</h3>
<ion-badge color="danger">OUT</ion-badge>
</ion-col>
<ion-col size="4" class="ion-text-right">
<ng-container *ngIf="!!output.colorId && output.colorId !== colorId">
<ng-container
*ngIf="!!output.colorId && output.colorId !== colorId"
>
{{ output.value }}
<span
class="link-color cursor-pointer"
(click)="goToCoin(output.colorId)"
>COIN
</span>
</ng-container>
<ng-container *ngIf="!!output.colorId && output.colorId === colorId">
<ng-container
*ngIf="!!output.colorId && output.colorId === colorId"
>
{{ output.value }}
<span class="cursor-pointer">COIN</span>
</ng-container>
Expand All @@ -136,7 +151,9 @@ <h3 id="color-header-text">Transactions</h3>
</ion-col>
</ion-row>
<ion-row *ngIf="!!output.colorId" class="table-border-bottom">
<ion-col size="8" class="link-color cursor-pointer font-14 ellipsis"
<ion-col
size="8"
class="link-color cursor-pointer font-14 ellipsis"
(click)="goToCoin(output.colorId)"
>
Color ID: {{ output.colorId | formatColorId }}
Expand Down
1 change: 0 additions & 1 deletion frontend/src/app/colors/colors.page.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,3 @@ ion-content {
font-size: 14px;
color: #aaaaaa;
}

7 changes: 6 additions & 1 deletion frontend/src/app/modules/sharePipe.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ import { AsTpcPipe } from '../pipes/as-tpc.pipe';
import { DateFormatPipe } from '../pipes/date-format.pipe';
import { FormatColorIdPipe } from '../pipes/format-color-id.pipe';
@NgModule({
declarations: [MomentFromNowPipe, AsTpcPipe, DateFormatPipe, FormatColorIdPipe],
declarations: [
MomentFromNowPipe,
AsTpcPipe,
DateFormatPipe,
FormatColorIdPipe
],
imports: [CommonModule],
exports: [MomentFromNowPipe, AsTpcPipe, DateFormatPipe, FormatColorIdPipe]
})
Expand Down
5 changes: 4 additions & 1 deletion frontend/src/app/pipes/format-color-id.pipe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ import { Injectable } from '@angular/core';
})
export class FormatColorIdPipe implements PipeTransform {
transform(colorId: any, ...args: any[]): any {
if (colorId === '000000000000000000000000000000000000000000000000000000000000000000') {
if (
colorId ===
'000000000000000000000000000000000000000000000000000000000000000000'
) {
return '(TPC)';
} else {
return colorId;
Expand Down
21 changes: 16 additions & 5 deletions frontend/src/app/transaction/transaction.page.html
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@
size="8"
class="ion-no-margin link-color cursor-pointer"
(click)="goToAddress(vin.prevout.scriptpubkey_uncolored_address)"
>{{ vin.prevout.scriptpubkey_uncolored_address }}</ion-col
>{{ vin.prevout.scriptpubkey_uncolored_address
}}</ion-col
>
<ion-col
size="4"
Expand All @@ -119,8 +120,13 @@
</ng-container>
</ion-col>
</ion-row>
<ion-row *ngIf="!!vin.prevout.colorId" class="table-border-bottom">
<ion-col size="8" class="link-color cursor-pointer font-14 ellipsis"
<ion-row
*ngIf="!!vin.prevout.colorId"
class="table-border-bottom"
>
<ion-col
size="8"
class="link-color cursor-pointer font-14 ellipsis"
(click)="goToCoin(vin.prevout.colorId)"
>
Color ID: {{ vin.prevout.colorId | formatColorId }}
Expand Down Expand Up @@ -236,8 +242,13 @@
</ng-container>
</ion-col>
</ion-row>
<ion-row *ngIf="!!vout.colorId" class="table-border-bottom">
<ion-col size="8" class="link-color cursor-pointer font-14 ellipsis"
<ion-row
*ngIf="!!vout.colorId"
class="table-border-bottom"
>
<ion-col
size="8"
class="link-color cursor-pointer font-14 ellipsis"
(click)="goToCoin(vout.colorId)"
>
Color ID: {{ vout.colorId | formatColorId }}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/global.scss
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,4 @@ ion-toast {
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
}

0 comments on commit fffe419

Please sign in to comment.