2020-02-16 16:15:07 +01:00
|
|
|
import { Component, OnInit, Input, ChangeDetectionStrategy } from '@angular/core';
|
|
|
|
import { StateService } from '../../services/state.service';
|
|
|
|
import { Observable } from 'rxjs';
|
2020-03-25 15:29:40 +01:00
|
|
|
import { environment } from '../../../environments/environment';
|
2020-02-16 16:15:07 +01:00
|
|
|
|
|
|
|
@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>;
|
2020-03-25 15:29:40 +01:00
|
|
|
network = environment.network;
|
2020-02-16 16:15:07 +01:00
|
|
|
|
|
|
|
@Input() satoshis: number;
|
|
|
|
|
|
|
|
constructor(
|
|
|
|
private stateService: StateService,
|
|
|
|
) { }
|
|
|
|
|
|
|
|
ngOnInit() {
|
|
|
|
this.viewFiat$ = this.stateService.viewFiat$.asObservable();
|
|
|
|
this.conversions$ = this.stateService.conversions$.asObservable();
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|