[accelerator] login CTA with redirection
This commit is contained in:
parent
ce3b599bab
commit
d09668aaa6
@ -75,7 +75,7 @@
|
|||||||
<ng-container *ngFor="let option of maxRateOptions">
|
<ng-container *ngFor="let option of maxRateOptions">
|
||||||
<button type="button" class="btn btn-primary flex-grow-1 btn-border btn-sm feerate" [class]="{active: selectFeeRateIndex === option.index}" (click)="setUserBid(option)">
|
<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="fee">{{ option.fee | number }} <span class="symbol" i18n="shared.sats|sats">sats</span></span>
|
<span class="fee">{{ option.fee | number }} <span class="symbol" i18n="shared.sats|sats">sats</span></span>
|
||||||
<span class="rate">~ <app-fee-rate [fee]="option.rate" rounding="1.0-0"></app-fee-rate></span>
|
<span class="rate">~<app-fee-rate [fee]="option.rate" rounding="1.0-0"></app-fee-rate></span>
|
||||||
</button>
|
</button>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
</div>
|
</div>
|
||||||
@ -228,7 +228,7 @@
|
|||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
<!-- USER BALANCE -->
|
<!-- USER BALANCE -->
|
||||||
<ng-container *ngIf="estimate.userBalance < maxCost">
|
<ng-container *ngIf="isLoggedIn() && estimate.userBalance < maxCost">
|
||||||
<tr class="group-first group-last" style="border-top: 1px dashed grey">
|
<tr class="group-first group-last" style="border-top: 1px dashed grey">
|
||||||
<td class="item">
|
<td class="item">
|
||||||
Available balance
|
Available balance
|
||||||
@ -244,6 +244,17 @@
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
|
<!-- LOGIN CTA -->
|
||||||
|
<ng-container *ngIf="!isLoggedIn()">
|
||||||
|
<tr class="group-first group-last" style="border-top: 1px dashed grey">
|
||||||
|
<td class="item"></td>
|
||||||
|
<td class="amt"></td>
|
||||||
|
<td class="units d-flex">
|
||||||
|
<a [routerLink]="['/login']" [queryParams]="{redirectTo: '/tx/' + tx.txid + '#accelerate'}" class="btn btn-purple flex-grow-1">Login</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</ng-container>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import { Component, OnInit, Input, OnDestroy, OnChanges, SimpleChanges, HostListener } from '@angular/core';
|
import { Component, OnInit, Input, OnDestroy, OnChanges, SimpleChanges, HostListener } from '@angular/core';
|
||||||
|
import { Router } from '@angular/router';
|
||||||
import { ApiService } from '../../services/api.service';
|
import { ApiService } from '../../services/api.service';
|
||||||
import { Subscription, catchError, of, tap } from 'rxjs';
|
import { Subscription, catchError, of, tap } from 'rxjs';
|
||||||
import { StorageService } from '../../services/storage.service';
|
import { StorageService } from '../../services/storage.service';
|
||||||
@ -62,7 +63,8 @@ export class AcceleratePreviewComponent implements OnInit, OnDestroy, OnChanges
|
|||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private apiService: ApiService,
|
private apiService: ApiService,
|
||||||
private storageService: StorageService
|
private storageService: StorageService,
|
||||||
|
private router: Router,
|
||||||
) { }
|
) { }
|
||||||
|
|
||||||
ngOnDestroy(): void {
|
ngOnDestroy(): void {
|
||||||
@ -73,7 +75,7 @@ export class AcceleratePreviewComponent implements OnInit, OnDestroy, OnChanges
|
|||||||
|
|
||||||
ngOnChanges(changes: SimpleChanges): void {
|
ngOnChanges(changes: SimpleChanges): void {
|
||||||
if (changes.scrollEvent) {
|
if (changes.scrollEvent) {
|
||||||
this.scrollToPreview('acceleratePreviewAnchor', 'center');
|
this.scrollToPreview('acceleratePreviewAnchor', 'start');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -126,7 +128,7 @@ export class AcceleratePreviewComponent implements OnInit, OnDestroy, OnChanges
|
|||||||
this.maxCost = this.userBid + this.estimate.mempoolBaseFee + this.estimate.vsizeFee;
|
this.maxCost = this.userBid + this.estimate.mempoolBaseFee + this.estimate.vsizeFee;
|
||||||
|
|
||||||
if (!this.error) {
|
if (!this.error) {
|
||||||
this.scrollToPreview('acceleratePreviewAnchor', 'center');
|
this.scrollToPreview('acceleratePreviewAnchor', 'start');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
|
@ -80,7 +80,7 @@
|
|||||||
|
|
||||||
<!-- Accelerator -->
|
<!-- Accelerator -->
|
||||||
<ng-container *ngIf="!tx?.status?.confirmed && showAccelerationSummary">
|
<ng-container *ngIf="!tx?.status?.confirmed && showAccelerationSummary">
|
||||||
<div class="title mt-3" id="acceleratePreviewAnchor">
|
<div class="title mt-3">
|
||||||
<h2>Accelerate</h2>
|
<h2>Accelerate</h2>
|
||||||
</div>
|
</div>
|
||||||
<div class="box">
|
<div class="box">
|
||||||
@ -135,7 +135,7 @@
|
|||||||
</ng-template>
|
</ng-template>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr *ngIf="network !== 'liquid' && network !== 'liquidtestnet'">
|
<tr *ngIf="network !== 'liquid' && network !== 'liquidtestnet'" id="acceleratePreviewAnchor">
|
||||||
<td class="td-width" i18n="transaction.features|Transaction Features">Features</td>
|
<td class="td-width" i18n="transaction.features|Transaction Features">Features</td>
|
||||||
<td>
|
<td>
|
||||||
<app-tx-features [tx]="tx"></app-tx-features>
|
<app-tx-features [tx]="tx"></app-tx-features>
|
||||||
|
@ -619,13 +619,17 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
// simulate normal anchor fragment behavior
|
// simulate normal anchor fragment behavior
|
||||||
applyFragment(): void {
|
applyFragment(): void {
|
||||||
const anchor = Array.from(this.fragmentParams.entries()).find(([frag, value]) => value === '');
|
const anchor = Array.from(this.fragmentParams.entries()).find(([frag, value]) => value === '');
|
||||||
if (anchor) {
|
if (anchor?.length) {
|
||||||
|
if (anchor[0] === 'accelerate') {
|
||||||
|
setTimeout(this.onAccelerateClicked.bind(this), 100);
|
||||||
|
} else {
|
||||||
const anchorElement = document.getElementById(anchor[0]);
|
const anchorElement = document.getElementById(anchor[0]);
|
||||||
if (anchorElement) {
|
if (anchorElement) {
|
||||||
anchorElement.scrollIntoView();
|
anchorElement.scrollIntoView();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@HostListener('window:resize', ['$event'])
|
@HostListener('window:resize', ['$event'])
|
||||||
setGraphSize(): void {
|
setGraphSize(): void {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user