Hide fee diagram on mobile

This commit is contained in:
Mononaut 2023-08-30 17:16:39 +09:00
parent cb363aca23
commit ed12e30517
No known key found for this signature in database
GPG key ID: A3F058E41374C04E
2 changed files with 16 additions and 8 deletions

View file

@ -13,13 +13,15 @@
</div> </div>
<div class="accelerate-cols"> <div class="accelerate-cols">
<app-accelerate-fee-graph <ng-container *ngIf="!isMobile">
[tx]="tx" <app-accelerate-fee-graph
[estimate]="estimate" [tx]="tx"
[maxRateOptions]="maxRateOptions" [estimate]="estimate"
[maxRateIndex]="selectFeeRateIndex" [maxRateOptions]="maxRateOptions"
(setUserBid)="setUserBid($event)" [maxRateIndex]="selectFeeRateIndex"
></app-accelerate-fee-graph> (setUserBid)="setUserBid($event)"
></app-accelerate-fee-graph>
</ng-container>
<ng-container *ngIf="estimate"> <ng-container *ngIf="estimate">
<div [class]="{estimateDisabled: error}"> <div [class]="{estimateDisabled: error}">

View file

@ -1,4 +1,4 @@
import { Component, OnInit, Input, OnDestroy, OnChanges, SimpleChanges } from '@angular/core'; import { Component, OnInit, Input, OnDestroy, OnChanges, SimpleChanges, HostListener } 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';
@ -57,6 +57,7 @@ export class AcceleratePreviewComponent implements OnInit, OnDestroy, OnChanges
userBid = 0; userBid = 0;
selectFeeRateIndex = 1; selectFeeRateIndex = 1;
showTable: 'estimated' | 'maximum' = 'maximum'; showTable: 'estimated' | 'maximum' = 'maximum';
isMobile: boolean = window.innerWidth <= 767.98;
maxRateOptions: RateOption[] = []; maxRateOptions: RateOption[] = [];
@ -197,4 +198,9 @@ export class AcceleratePreviewComponent implements OnInit, OnDestroy, OnChanges
const auth = this.storageService.getAuth(); const auth = this.storageService.getAuth();
return auth !== null; return auth !== null;
} }
@HostListener('window:resize', ['$event'])
onResize(): void {
this.isMobile = window.innerWidth <= 767.98;
}
} }