mempool/frontend/src/app/components/master-page/master-page.component.ts

31 lines
836 B
TypeScript
Raw Normal View History

import { Component, OnInit } from '@angular/core';
import { Env, StateService } from '../../services/state.service';
import { Observable, merge, of } from 'rxjs';
@Component({
selector: 'app-master-page',
templateUrl: './master-page.component.html',
styleUrls: ['./master-page.component.scss'],
})
export class MasterPageComponent implements OnInit {
env: Env;
network$: Observable<string>;
connectionState$: Observable<number>;
navCollapsed = false;
2020-10-09 13:56:43 +07:00
isMobile = window.innerWidth <= 767.98;
constructor(
private stateService: StateService,
) { }
ngOnInit() {
this.env = this.stateService.env;
this.connectionState$ = this.stateService.connectionState$;
this.network$ = merge(of(''), this.stateService.networkChanged$);
}
collapse(): void {
this.navCollapsed = !this.navCollapsed;
}
}