Simplified acceleration mode for mobile
This commit is contained in:
		
							parent
							
								
									91a8a8be34
								
							
						
					
					
						commit
						aa0c70bd44
					
				| @ -65,24 +65,26 @@ | |||||||
|         </div> |         </div> | ||||||
|       </div> |       </div> | ||||||
|       <br> |       <br> | ||||||
|       <h5 i18n="accelerator.pay-how-much">How much more are you willing to pay?</h5> |       @if (paymentType !== 'cashapp') { | ||||||
|       <div class="row"> |         <h5 i18n="accelerator.pay-how-much">How much more are you willing to pay?</h5> | ||||||
|         <div class="col"> |         <div class="row"> | ||||||
|           <small class="form-text text-muted mb-2" i18n="accelerator.transaction-fee-description">Choose the maximum extra transaction fee you're willing to pay to get into the next block.</small> |           <div class="col"> | ||||||
|           <div class="form-group"> |             <small class="form-text text-muted mb-2" i18n="accelerator.transaction-fee-description">Choose the maximum extra transaction fee you're willing to pay to get into the next block.</small> | ||||||
|             <div class="fee-card"> |             <div class="form-group"> | ||||||
|               <div class="d-flex mb-0"> |               <div class="fee-card"> | ||||||
|                 <ng-container *ngFor="let option of maxRateOptions"> |                 <div class="d-flex mb-0"> | ||||||
|                   <button type="button" class="btn btn-primary flex-grow-1 btn-border btn-sm feerate" [class]="{active: selectFeeRateIndex === option.index}" (click)="setUserBid(option)"> |                   <ng-container *ngFor="let option of maxRateOptions"> | ||||||
|                     <span class="fee">{{ option.fee + estimate.mempoolBaseFee + estimate.vsizeFee | number }} <span class="symbol" i18n="shared.sats">sats</span></span> |                     <button type="button" class="btn btn-primary flex-grow-1 btn-border btn-sm feerate" [class]="{active: selectFeeRateIndex === option.index}" (click)="setUserBid(option)"> | ||||||
|                     <span class="rate">~<app-fee-rate [fee]="option.rate" rounding="1.0-0"></app-fee-rate></span> |                       <span class="fee">{{ option.fee + estimate.mempoolBaseFee + estimate.vsizeFee | number }} <span class="symbol" i18n="shared.sats">sats</span></span> | ||||||
|                   </button> |                       <span class="rate">~<app-fee-rate [fee]="option.rate" rounding="1.0-0"></app-fee-rate></span> | ||||||
|                 </ng-container> |                     </button> | ||||||
|  |                   </ng-container> | ||||||
|  |                 </div> | ||||||
|               </div> |               </div> | ||||||
|             </div> |             </div> | ||||||
|           </div> |           </div> | ||||||
|         </div> |         </div> | ||||||
|       </div> |       } | ||||||
|    |    | ||||||
|       <h5>Acceleration summary</h5> |       <h5>Acceleration summary</h5> | ||||||
|       <div class="row mb-3"> |       <div class="row mb-3"> | ||||||
| @ -90,27 +92,51 @@ | |||||||
|           <table class="table table-borderless table-border table-dark table-accelerator"> |           <table class="table table-borderless table-border table-dark table-accelerator"> | ||||||
|             <tbody> |             <tbody> | ||||||
|               <!-- ESTIMATED FEE --> |               <!-- ESTIMATED FEE --> | ||||||
|               <ng-container> |               @if (paymentType === 'cashapp') { | ||||||
|                 <tr class="group-first"> |                 <ng-container> | ||||||
|                   <td class="item" i18n="accelerator.next-block-rate">Next block market rate</td> |                   <tr class="group-first"> | ||||||
|                   <td class="amt" style="font-size: 16px"> |                     <td class="item" i18n="accelerator.boost-rate">Boost rate</td> | ||||||
|                     {{ estimate.targetFeeRate | number : '1.0-0' }} |                     <td class="amt" style="font-size: 16px"> | ||||||
|                   </td> |                       {{ maxRateOptions[selectFeeRateIndex].rate | number : '1.0-0' }} | ||||||
|                   <td class="units"><span class="symbol" i18n="shared.sat-vbyte|sat/vB">sat/vB</span></td> |                     </td> | ||||||
|                 </tr> |                     <td class="units"><span class="symbol" i18n="shared.sat-vbyte|sat/vB">sat/vB</span></td> | ||||||
|                 <tr class="info"> |                   </tr> | ||||||
|                   <td class="info"> |                   <tr class="info"> | ||||||
|                     <i><small i18n="accelerator.estimated-extra-fee-required">Estimated extra fee required</small></i> |                     <td class="info"> | ||||||
|                   </td> |                       <i><small i18n="accelerator.estimated-extra-fee-required">Boost fee</small></i> | ||||||
|                   <td class="amt"> |                     </td> | ||||||
|                     {{ math.max(0, estimate.nextBlockFee - estimate.txSummary.effectiveFee) | number }} |                     <td class="amt"> | ||||||
|                   </td> |                       {{ maxRateOptions[selectFeeRateIndex].fee | number }} | ||||||
|                   <td class="units"> |                     </td> | ||||||
|                     <span class="symbol" i18n="shared.sats">sats</span> |                     <td class="units"> | ||||||
|                     <span class="fiat ml-1"><app-fiat [value]="math.max(0, estimate.nextBlockFee - estimate.txSummary.effectiveFee)"></app-fiat></span> |                       <span class="symbol" i18n="shared.sats">sats</span> | ||||||
|                   </td> |                       <span class="fiat ml-1"><app-fiat [value]="maxRateOptions[selectFeeRateIndex].fee"></app-fiat></span> | ||||||
|                 </tr> |                     </td> | ||||||
|               </ng-container> |                   </tr> | ||||||
|  |                 </ng-container> | ||||||
|  |               } @else { | ||||||
|  |                 <ng-container> | ||||||
|  |                   <tr class="group-first"> | ||||||
|  |                     <td class="item" i18n="accelerator.next-block-rate">Next block market rate</td> | ||||||
|  |                     <td class="amt" style="font-size: 16px"> | ||||||
|  |                       {{ estimate.targetFeeRate | number : '1.0-0' }} | ||||||
|  |                     </td> | ||||||
|  |                     <td class="units"><span class="symbol" i18n="shared.sat-vbyte|sat/vB">sat/vB</span></td> | ||||||
|  |                   </tr> | ||||||
|  |                   <tr class="info"> | ||||||
|  |                     <td class="info"> | ||||||
|  |                       <i><small i18n="accelerator.estimated-extra-fee-required">Estimated extra fee required</small></i> | ||||||
|  |                     </td> | ||||||
|  |                     <td class="amt"> | ||||||
|  |                       {{ math.max(0, estimate.nextBlockFee - estimate.txSummary.effectiveFee) | number }} | ||||||
|  |                     </td> | ||||||
|  |                     <td class="units"> | ||||||
|  |                       <span class="symbol" i18n="shared.sats">sats</span> | ||||||
|  |                       <span class="fiat ml-1"><app-fiat [value]="math.max(0, estimate.nextBlockFee - estimate.txSummary.effectiveFee)"></app-fiat></span> | ||||||
|  |                     </td> | ||||||
|  |                   </tr> | ||||||
|  |                 </ng-container> | ||||||
|  |               } | ||||||
|    |    | ||||||
|               <!-- MEMPOOL BASE FEE --> |               <!-- MEMPOOL BASE FEE --> | ||||||
|               <tr> |               <tr> | ||||||
| @ -141,53 +167,76 @@ | |||||||
|                 </td> |                 </td> | ||||||
|               </tr> |               </tr> | ||||||
| 
 | 
 | ||||||
|               <!-- NEXT BLOCK ESTIMATE --> |  | ||||||
|               <ng-container> |  | ||||||
|                 <tr class="group-first" style="border-top: 1px dashed grey; border-collapse: collapse;"> |  | ||||||
|                   <td class="item"> |  | ||||||
|                     <b style="background-color: #5E35B1" class="p-1 pl-0" i18n="accelerator.estimated-cost">Estimated acceleration cost</b> |  | ||||||
|                   </td> |  | ||||||
|                   <td class="amt"> |  | ||||||
|                     <span style="background-color: #5E35B1" class="p-1 pl-0"> |  | ||||||
|                       {{ estimate.cost + estimate.mempoolBaseFee + estimate.vsizeFee | number }} |  | ||||||
|                     </span> |  | ||||||
|                   </td> |  | ||||||
|                   <td class="units"> |  | ||||||
|                     <span class="symbol" i18n="shared.sats">sats</span> |  | ||||||
|                     <span class="fiat ml-1"><app-fiat [value]="estimate.cost + estimate.mempoolBaseFee + estimate.vsizeFee"></app-fiat></span> |  | ||||||
|                   </td> |  | ||||||
|                 </tr> |  | ||||||
|                 <tr class="info group-last" style="border-bottom: 1px solid lightgrey"> |  | ||||||
|                   <td class="info" colspan=3> |  | ||||||
|                     <i><small><ng-container *ngTemplateOutlet="acceleratedTo; context: {$implicit: estimate.targetFeeRate }"></ng-container></small></i> |  | ||||||
|                   </td> |  | ||||||
|                 </tr> |  | ||||||
|               </ng-container> |  | ||||||
|                |                | ||||||
|               <!-- MAX COST --> |               @if (paymentType === 'cashapp') { | ||||||
|               <ng-container> |                 <!-- FIXED COST --> | ||||||
|                 <tr class="group-first"> |                 <ng-container> | ||||||
|                   <td class="item"> |                   <tr class="group-first group-last" style="border-top: 1px solid lightgrey; border-collapse: collapse;"> | ||||||
|                     <b style="background-color: #105fb0;" class="p-1 pl-0" i18n="accelerator.maximum-cost">Maximum acceleration cost</b> |                     <td class="item"> | ||||||
|                   </td> |                       <b style="background-color: #105fb0;" class="p-1 pl-0" i18n="accelerator.total-cost">Total cost</b> | ||||||
|                   <td class="amt"> |                     </td> | ||||||
|                     <span style="background-color: #105fb0" class="p-1 pl-0"> |                     <td class="amt"> | ||||||
|                       {{ maxCost | number }} |                       <span style="background-color: #105fb0" class="p-1 pl-0"> | ||||||
|                     </span> |                         {{ maxCost | number }} | ||||||
|                   </td> |                       </span> | ||||||
|                   <td class="units"> |                     </td> | ||||||
|                     <span class="symbol" i18n="shared.sats">sats</span> |                     <td class="units"> | ||||||
|                     <span class="fiat ml-1"> |                       <span class="symbol" i18n="shared.sats">sats</span> | ||||||
|                       <app-fiat [value]="maxCost" [colorClass]="estimate.userBalance < maxCost ? 'red-color' : 'green-color'"></app-fiat> |                       <span class="fiat ml-1"> | ||||||
|                     </span> |                         <app-fiat [value]="maxCost" [colorClass]="'green-color'"></app-fiat> | ||||||
|                   </td> |                       </span> | ||||||
|                 </tr> |                     </td> | ||||||
|                 <tr class="info group-last"> |                   </tr> | ||||||
|                   <td class="info" colspan=3> |                 </ng-container> | ||||||
|                     <i><small><ng-container *ngTemplateOutlet="acceleratedTo; context: {$implicit: (estimate.txSummary.effectiveFee + userBid) / estimate.txSummary.effectiveVsize }"></ng-container></small></i> |               } @else { | ||||||
|                   </td> |                 <!-- NEXT BLOCK ESTIMATE --> | ||||||
|                 </tr> |                 <ng-container> | ||||||
|               </ng-container> |                   <tr class="group-first" style="border-top: 1px dashed grey; border-collapse: collapse;"> | ||||||
|  |                     <td class="item"> | ||||||
|  |                       <b style="background-color: #5E35B1" class="p-1 pl-0" i18n="accelerator.estimated-cost">Estimated acceleration cost</b> | ||||||
|  |                     </td> | ||||||
|  |                     <td class="amt"> | ||||||
|  |                       <span style="background-color: #5E35B1" class="p-1 pl-0"> | ||||||
|  |                         {{ estimate.cost + estimate.mempoolBaseFee + estimate.vsizeFee | number }} | ||||||
|  |                       </span> | ||||||
|  |                     </td> | ||||||
|  |                     <td class="units"> | ||||||
|  |                       <span class="symbol" i18n="shared.sats">sats</span> | ||||||
|  |                       <span class="fiat ml-1"><app-fiat [value]="estimate.cost + estimate.mempoolBaseFee + estimate.vsizeFee"></app-fiat></span> | ||||||
|  |                     </td> | ||||||
|  |                   </tr> | ||||||
|  |                   <tr class="info group-last" style="border-bottom: 1px solid lightgrey"> | ||||||
|  |                     <td class="info" colspan=3> | ||||||
|  |                       <i><small><ng-container *ngTemplateOutlet="acceleratedTo; context: {$implicit: estimate.targetFeeRate }"></ng-container></small></i> | ||||||
|  |                     </td> | ||||||
|  |                   </tr> | ||||||
|  |                 </ng-container> | ||||||
|  |    | ||||||
|  |                 <!-- MAX COST --> | ||||||
|  |                 <ng-container> | ||||||
|  |                   <tr class="group-first"> | ||||||
|  |                     <td class="item"> | ||||||
|  |                       <b style="background-color: #105fb0;" class="p-1 pl-0" i18n="accelerator.maximum-cost">Maximum acceleration cost</b> | ||||||
|  |                     </td> | ||||||
|  |                     <td class="amt"> | ||||||
|  |                       <span style="background-color: #105fb0" class="p-1 pl-0"> | ||||||
|  |                         {{ maxCost | number }} | ||||||
|  |                       </span> | ||||||
|  |                     </td> | ||||||
|  |                     <td class="units"> | ||||||
|  |                       <span class="symbol" i18n="shared.sats">sats</span> | ||||||
|  |                       <span class="fiat ml-1"> | ||||||
|  |                         <app-fiat [value]="maxCost" [colorClass]="estimate.userBalance < maxCost ? 'red-color' : 'green-color'"></app-fiat> | ||||||
|  |                       </span> | ||||||
|  |                     </td> | ||||||
|  |                   </tr> | ||||||
|  |                   <tr class="info group-last"> | ||||||
|  |                     <td class="info" colspan=3> | ||||||
|  |                       <i><small><ng-container *ngTemplateOutlet="acceleratedTo; context: {$implicit: (estimate.txSummary.effectiveFee + userBid) / estimate.txSummary.effectiveVsize }"></ng-container></small></i> | ||||||
|  |                     </td> | ||||||
|  |                   </tr> | ||||||
|  |                 </ng-container> | ||||||
|  |               } | ||||||
|    |    | ||||||
|               <!-- USER BALANCE --> |               <!-- USER BALANCE --> | ||||||
|               <ng-container *ngIf="isLoggedIn() && estimate.userBalance < maxCost"> |               <ng-container *ngIf="isLoggedIn() && estimate.userBalance < maxCost"> | ||||||
|  | |||||||
| @ -409,6 +409,9 @@ | |||||||
|   } @else { |   } @else { | ||||||
|     <ng-container *ngTemplateOutlet="firstSeenRow"></ng-container> |     <ng-container *ngTemplateOutlet="firstSeenRow"></ng-container> | ||||||
|     <ng-container *ngTemplateOutlet="etaRow"></ng-container> |     <ng-container *ngTemplateOutlet="etaRow"></ng-container> | ||||||
|  |     @if (isMobile) { | ||||||
|  |       <ng-container *ngTemplateOutlet="accelerateRow"></ng-container> | ||||||
|  |     } | ||||||
|   } |   } | ||||||
|   <ng-container *ngTemplateOutlet="featuresRow"></ng-container> |   <ng-container *ngTemplateOutlet="featuresRow"></ng-container> | ||||||
|   @if (tx?.status?.confirmed) { |   @if (tx?.status?.confirmed) { | ||||||
| @ -530,7 +533,7 @@ | |||||||
|           } @else if (this.mempoolPosition.block >= 7) { |           } @else if (this.mempoolPosition.block >= 7) { | ||||||
|             <span [class]="(acceleratorAvailable && accelerateCtaType === 'button') ? 'etaDeepMempool d-flex justify-content-end align-items-center' : ''"> |             <span [class]="(acceleratorAvailable && accelerateCtaType === 'button') ? 'etaDeepMempool d-flex justify-content-end align-items-center' : ''"> | ||||||
|               <span i18n="transaction.eta.in-several-hours|Transaction ETA in several hours or more">In several hours (or more)</span> |               <span i18n="transaction.eta.in-several-hours|Transaction ETA in several hours or more">In several hours (or more)</span> | ||||||
|               @if (!tx.acceleration && acceleratorAvailable && accelerateCtaType === 'button' && !tx?.acceleration) { |               @if (!isMobile && !tx.acceleration && acceleratorAvailable && accelerateCtaType === 'button' && !tx?.acceleration) { | ||||||
|                 <a [href]="'/services/accelerator/accelerate?txid=' + tx.txid" class="btn btn-sm accelerateDeepMempool btn-small-height" i18n="transaction.accelerate|Accelerate button label" (click)="onAccelerateClicked()">Accelerate</a> |                 <a [href]="'/services/accelerator/accelerate?txid=' + tx.txid" class="btn btn-sm accelerateDeepMempool btn-small-height" i18n="transaction.accelerate|Accelerate button label" (click)="onAccelerateClicked()">Accelerate</a> | ||||||
|               } |               } | ||||||
|             </span> |             </span> | ||||||
| @ -539,7 +542,7 @@ | |||||||
|           } @else { |           } @else { | ||||||
|             <span class="eta justify-content-end" [class]="(acceleratorAvailable && accelerateCtaType === 'button') ? 'd-flex align-items-center' : ''"> |             <span class="eta justify-content-end" [class]="(acceleratorAvailable && accelerateCtaType === 'button') ? 'd-flex align-items-center' : ''"> | ||||||
|               <app-time kind="until" *ngIf="(da$ | async) as da;" [time]="da.adjustedTimeAvg * (this.mempoolPosition.block + 1) + now + da.timeOffset" [fastRender]="false" [fixedRender]="true"></app-time> |               <app-time kind="until" *ngIf="(da$ | async) as da;" [time]="da.adjustedTimeAvg * (this.mempoolPosition.block + 1) + now + da.timeOffset" [fastRender]="false" [fixedRender]="true"></app-time> | ||||||
|               @if (!tx.acceleration && acceleratorAvailable && accelerateCtaType === 'button' && !tx?.acceleration) { |               @if (!isMobile && !tx.acceleration && acceleratorAvailable && accelerateCtaType === 'button' && !tx?.acceleration) { | ||||||
|                 <a [href]="'/services/accelerator/accelerate?txid=' + tx.txid" class="btn btn-sm accelerate btn-small-height" i18n="transaction.accelerate|Accelerate button label" (click)="onAccelerateClicked()">Accelerate</a> |                 <a [href]="'/services/accelerator/accelerate?txid=' + tx.txid" class="btn btn-sm accelerate btn-small-height" i18n="transaction.accelerate|Accelerate button label" (click)="onAccelerateClicked()">Accelerate</a> | ||||||
|               } |               } | ||||||
|             </span> |             </span> | ||||||
| @ -552,6 +555,18 @@ | |||||||
|   } |   } | ||||||
| </ng-template> | </ng-template> | ||||||
| 
 | 
 | ||||||
|  | <ng-template #accelerateRow> | ||||||
|  |   @if (!isLoadingTx) { | ||||||
|  |     <tr> | ||||||
|  |       <td class="td-width align-items-center align-middle p-0" colspan="2"> | ||||||
|  |         <a [href]="'/services/accelerator/accelerate?txid=' + tx.txid" class="btn accelerateFullSize" i18n="transaction.accelerate|Accelerate button label" (click)="onAccelerateClicked()">Accelerate</a> | ||||||
|  |       </td> | ||||||
|  |     </tr> | ||||||
|  |   } @else { | ||||||
|  |     <ng-container *ngTemplateOutlet="skeletonDetailsRow"></ng-container> | ||||||
|  |   } | ||||||
|  | </ng-template> | ||||||
|  | 
 | ||||||
| <ng-template #gogglesRow> | <ng-template #gogglesRow> | ||||||
|   @if (!isLoadingTx) { |   @if (!isLoadingTx) { | ||||||
|     @if (((auditStatus && auditStatus.accelerated) || accelerationInfo || (tx && tx.acceleration)) || filters.length) { |     @if (((auditStatus && auditStatus.accelerated) || accelerationInfo || (tx && tx.acceleration)) || filters.length) { | ||||||
|  | |||||||
| @ -311,6 +311,13 @@ | |||||||
|   } |   } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | .accelerateFullSize { | ||||||
|  |   width: 100%; | ||||||
|  |   height: 100%; | ||||||
|  |   padding: 0.5rem 0.25rem; | ||||||
|  |   background-color: #653b9c; | ||||||
|  | } | ||||||
|  | 
 | ||||||
| .goggles-icon { | .goggles-icon { | ||||||
|   display: block; |   display: block; | ||||||
|   width: 2.2em; |   width: 2.2em; | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user