diff --git a/frontend/src/app/components/transaction/cpfp-info.component.html b/frontend/src/app/components/transaction/cpfp-info.component.html new file mode 100644 index 000000000..55945c388 --- /dev/null +++ b/frontend/src/app/components/transaction/cpfp-info.component.html @@ -0,0 +1,56 @@ +
+
+

Related Transactions

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeTXIDVirtual sizeWeightFee rate
Descendant + +
Descendant + +
Ancestor + +
+
\ No newline at end of file diff --git a/frontend/src/app/components/transaction/cpfp-info.component.scss b/frontend/src/app/components/transaction/cpfp-info.component.scss new file mode 100644 index 000000000..df2b622e7 --- /dev/null +++ b/frontend/src/app/components/transaction/cpfp-info.component.scss @@ -0,0 +1,32 @@ +.title { + h2 { + line-height: 1; + margin: 0; + padding-bottom: 5px; + } +} + +.cpfp-details { + .txids { + width: 60%; + } + + @media (max-width: 500px) { + .txids { + width: 40%; + } + } +} + +.arrow-green { + color: var(--success); +} + +.arrow-red { + color: var(--red); +} + +.badge { + position: relative; + top: -1px; +} \ No newline at end of file diff --git a/frontend/src/app/components/transaction/cpfp-info.component.ts b/frontend/src/app/components/transaction/cpfp-info.component.ts new file mode 100644 index 000000000..3d122183b --- /dev/null +++ b/frontend/src/app/components/transaction/cpfp-info.component.ts @@ -0,0 +1,22 @@ +import { Component, OnInit, Input, ChangeDetectionStrategy } from '@angular/core'; +import { CpfpInfo } from '@interfaces/node-api.interface'; +import { Transaction } from '@interfaces/electrs.interface'; + +@Component({ + selector: 'app-cpfp-info', + templateUrl: './cpfp-info.component.html', + styleUrls: ['./cpfp-info.component.scss'], + changeDetection: ChangeDetectionStrategy.OnPush +}) +export class CpfpInfoComponent implements OnInit { + @Input() cpfpInfo: CpfpInfo; + @Input() tx: Transaction; + + constructor() {} + + ngOnInit(): void {} + + roundToOneDecimal(cpfpTx: any): number { + return +(cpfpTx.fee / (cpfpTx.weight / 4)).toFixed(1); + } +} diff --git a/frontend/src/app/components/transaction/transaction.component.html b/frontend/src/app/components/transaction/transaction.component.html index 8c2d9de01..099d7beb5 100644 --- a/frontend/src/app/components/transaction/transaction.component.html +++ b/frontend/src/app/components/transaction/transaction.component.html @@ -66,64 +66,7 @@ - -
-
-

Related Transactions

-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeTXIDVirtual sizeWeightFee rate
Descendant - -
Descendant - -
Ancestor - -
-
-
+ diff --git a/frontend/src/app/components/transaction/transaction.component.scss b/frontend/src/app/components/transaction/transaction.component.scss index d35f26130..fed9f742c 100644 --- a/frontend/src/app/components/transaction/transaction.component.scss +++ b/frontend/src/app/components/transaction/transaction.component.scss @@ -227,18 +227,6 @@ } } -.cpfp-details { - .txids { - width: 60%; - } - - @media (max-width: 500px) { - .txids { - width: 40%; - } - } -} - .tx-list { .alert-link { display: block; diff --git a/frontend/src/app/components/transaction/transaction.component.ts b/frontend/src/app/components/transaction/transaction.component.ts index 71ffaa2cd..50ff32340 100644 --- a/frontend/src/app/components/transaction/transaction.component.ts +++ b/frontend/src/app/components/transaction/transaction.component.ts @@ -1054,10 +1054,6 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy { this.stateService.markBlock$.next({}); } - roundToOneDecimal(cpfpTx: any): number { - return +(cpfpTx.fee / (cpfpTx.weight / 4)).toFixed(1); - } - setupGraph() { this.maxInOut = Math.min(this.inOutLimit, Math.max(this.tx?.vin?.length || 1, this.tx?.vout?.length + 1 || 1)); this.graphHeight = this.graphExpanded ? this.maxInOut * 15 : Math.min(360, this.maxInOut * 80); diff --git a/frontend/src/app/components/transaction/transaction.module.ts b/frontend/src/app/components/transaction/transaction.module.ts index 58b6493d8..a05191346 100644 --- a/frontend/src/app/components/transaction/transaction.module.ts +++ b/frontend/src/app/components/transaction/transaction.module.ts @@ -10,6 +10,7 @@ import { GraphsModule } from '@app/graphs/graphs.module'; import { AccelerateCheckout } from '@components/accelerate-checkout/accelerate-checkout.component'; import { AccelerateFeeGraphComponent } from '@components/accelerate-checkout/accelerate-fee-graph.component'; import { TransactionRawComponent } from '@components/transaction/transaction-raw.component'; +import { CpfpInfoComponent } from '@components/transaction/cpfp-info.component'; const routes: Routes = [ { @@ -55,12 +56,14 @@ export class TransactionRoutingModule { } AccelerateCheckout, AccelerateFeeGraphComponent, TransactionRawComponent, + CpfpInfoComponent, ], exports: [ TransactionComponent, TransactionDetailsComponent, AccelerateCheckout, AccelerateFeeGraphComponent, + CpfpInfoComponent, ] }) export class TransactionModule { }