Switch to toggle-style acceleration dismiss button

This commit is contained in:
Mononaut 2023-12-01 14:32:05 +09:00
parent e986cfd30b
commit 9fcafeeeb0
No known key found for this signature in database
GPG Key ID: A3F058E41374C04E
5 changed files with 9 additions and 24 deletions

View File

@ -238,8 +238,4 @@
</div> </div>
</ng-container> </ng-container>
</div> </div>
<button type="button" class="close dismiss-preview" (click)="onDismiss()">
<span aria-hidden="true">&times;</span>
</button>

View File

@ -109,14 +109,4 @@
.item { .item {
white-space: initial; white-space: initial;
}
.dismiss-preview {
position: absolute;
top: 0.4em;
right: 0.6em;
}
:host ::ng-deep .alert {
margin-right: 1.6em;
} }

View File

@ -1,4 +1,4 @@
import { Component, OnInit, Input, OnDestroy, OnChanges, SimpleChanges, HostListener, ChangeDetectorRef, Output, EventEmitter } from '@angular/core'; import { Component, OnInit, Input, OnDestroy, OnChanges, SimpleChanges, HostListener, ChangeDetectorRef } from '@angular/core';
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';
@ -40,7 +40,6 @@ export const MAX_BID_RATIO = 4;
export class AcceleratePreviewComponent implements OnInit, OnDestroy, OnChanges { export class AcceleratePreviewComponent implements OnInit, OnDestroy, OnChanges {
@Input() tx: Transaction | undefined; @Input() tx: Transaction | undefined;
@Input() scrollEvent: boolean; @Input() scrollEvent: boolean;
@Output() dismiss = new EventEmitter();
math = Math; math = Math;
error = ''; error = '';
@ -208,8 +207,4 @@ export class AcceleratePreviewComponent implements OnInit, OnDestroy, OnChanges
onResize(): void { onResize(): void {
this.isMobile = window.innerWidth <= 767.98; this.isMobile = window.innerWidth <= 767.98;
} }
onDismiss(): void {
this.dismiss.emit();
}
} }

View File

@ -83,11 +83,15 @@
<!-- Accelerator --> <!-- Accelerator -->
<ng-container *ngIf="!tx?.status?.confirmed && showAccelerationSummary"> <ng-container *ngIf="!tx?.status?.confirmed && showAccelerationSummary">
<div class="title mt-3"> <br>
<div class="title float-left">
<h2>Accelerate</h2> <h2>Accelerate</h2>
</div> </div>
<button type="button" class="btn btn-outline-info accelerator-toggle btn-sm float-right" (click)="showAccelerationSummary = false" i18n="hide-accelerator">Hide accelerator</button>
<div class="clearfix"></div>
<div class="box"> <div class="box">
<app-accelerate-preview [tx]="tx" [scrollEvent]="scrollIntoAccelPreview" (dismiss)="showAccelerationSummary = false;"></app-accelerate-preview> <app-accelerate-preview [tx]="tx" [scrollEvent]="scrollIntoAccelPreview"></app-accelerate-preview>
</div> </div>
</ng-container> </ng-container>

View File

@ -179,7 +179,7 @@
} }
} }
.details-button, .flow-toggle { .details-button, .flow-toggle, .accelerator-toggle {
margin-top: -5px; margin-top: -5px;
margin-left: 10px; margin-left: 10px;
@media (min-width: 768px){ @media (min-width: 768px){