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