mirror of
https://github.com/mempool/mempool.git
synced 2025-01-10 07:26:46 +01:00
a8a1f4e976
refs #128
31 lines
864 B
TypeScript
31 lines
864 B
TypeScript
import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core';
|
|
import { StateService } from '../../services/state.service';
|
|
import { env } from 'src/app/app.constants';
|
|
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;
|
|
isMobile = window.innerWidth <= 767.98;
|
|
|
|
constructor(
|
|
private stateService: StateService,
|
|
) { }
|
|
|
|
ngOnInit() {
|
|
this.connectionState$ = this.stateService.connectionState$;
|
|
this.network$ = merge(of(''), this.stateService.networkChanged$);
|
|
}
|
|
|
|
collapse(): void {
|
|
this.navCollapsed = !this.navCollapsed;
|
|
}
|
|
}
|