mirror of
https://github.com/mempool/mempool.git
synced 2025-01-10 07:26:46 +01:00
31 lines
888 B
TypeScript
31 lines
888 B
TypeScript
import { Component, OnInit, Input, ChangeDetectionStrategy } from '@angular/core';
|
|
import { StateService } from '../../services/state.service';
|
|
import { Observable } from 'rxjs';
|
|
|
|
@Component({
|
|
selector: 'app-amount',
|
|
templateUrl: './amount.component.html',
|
|
styleUrls: ['./amount.component.scss'],
|
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
})
|
|
export class AmountComponent implements OnInit {
|
|
conversions$: Observable<any>;
|
|
viewFiat$: Observable<boolean>;
|
|
network = '';
|
|
|
|
@Input() satoshis: number;
|
|
@Input() digitsInfo = '1.8-8';
|
|
@Input() noFiat = false;
|
|
|
|
constructor(
|
|
private stateService: StateService,
|
|
) { }
|
|
|
|
ngOnInit() {
|
|
this.viewFiat$ = this.stateService.viewFiat$.asObservable();
|
|
this.conversions$ = this.stateService.conversions$.asObservable();
|
|
this.stateService.networkChanged$.subscribe((network) => this.network = network);
|
|
}
|
|
|
|
}
|