Merge pull request #5226 from mempool/natsoni/fix-accel-pie-chart

Fix logic for pool pie chart position
This commit is contained in:
softsimon 2024-06-27 21:48:04 +09:00 committed by GitHub
commit d91c6bceed
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 8 additions and 11 deletions

View file

@ -4,11 +4,11 @@
<table>
<tbody>
<tr>
<td class="td-width field-label" [class]="isMobile() ? 'mobile' : ''" i18n="transaction.accelerated-to-feerate|Accelerated to feerate">Accelerated to</td>
<td class="pie-chart" rowspan="2" *ngIf="isMobile()">
<td class="td-width field-label" [class]="chartPositionLeft ? 'chart-left' : ''" i18n="transaction.accelerated-to-feerate|Accelerated to feerate">Accelerated to</td>
<td class="pie-chart" rowspan="2" *ngIf="chartPositionLeft">
<ng-container *ngTemplateOutlet="pieChart"></ng-container>
</td>
<td class="field-value" [class]="isMobile() ? 'mobile' : ''">
<td class="field-value" [class]="chartPositionLeft ? 'chart-left' : ''">
<div class="effective-fee-container">
@if (accelerationInfo?.acceleratedFeeRate && (!tx.effectiveFeePerVsize || accelerationInfo.acceleratedFeeRate >= tx.effectiveFeePerVsize)) {
<app-fee-rate [fee]="accelerationInfo.acceleratedFeeRate"></app-fee-rate>
@ -17,7 +17,7 @@
}
</div>
</td>
<td class="pie-chart" rowspan="2" *ngIf="!isMobile()">
<td class="pie-chart" rowspan="2" *ngIf="!chartPositionLeft">
<ng-container *ngTemplateOutlet="pieChart"></ng-container>
</td>
</tr>

View file

@ -16,7 +16,7 @@
width: auto;
min-width: auto;
}
&.mobile {
&.chart-left {
width: 100%;
}
}
@ -26,7 +26,7 @@
width: 100%;
}
&.mobile {
&.chart-left {
width: auto;
}

View file

@ -28,6 +28,7 @@ export class ActiveAccelerationBox implements OnChanges {
@Input() miningStats: MiningStats;
@Input() pools: number[];
@Input() chartOnly: boolean = false;
@Input() chartPositionLeft: boolean = false;
acceleratedByPercentage: string = '';
@ -132,8 +133,4 @@ export class ActiveAccelerationBox implements OnChanges {
}
this.chartInstance = ec;
}
isMobile() {
return window.innerWidth <= 767.98;
}
}

View file

@ -650,7 +650,7 @@
<ng-template #acceleratingRow>
<tr>
<td rowspan="2" colspan="2" style="padding: 0;">
<app-active-acceleration-box [tx]="tx" [accelerationInfo]="accelerationInfo" [miningStats]="miningStats"></app-active-acceleration-box>
<app-active-acceleration-box [tx]="tx" [accelerationInfo]="accelerationInfo" [miningStats]="miningStats" [chartPositionLeft]="isMobile"></app-active-acceleration-box>
</td>
</tr>
<tr></tr>