2021-03-13 18:24:50 +07:00
|
|
|
import { Component, OnInit } from '@angular/core';
|
2021-07-28 22:32:13 +03:00
|
|
|
import { Env, StateService } from '../../services/state.service';
|
2021-03-21 02:40:37 +07:00
|
|
|
import { Observable } from 'rxjs';
|
2022-09-21 17:23:45 +02:00
|
|
|
import { LanguageService } from '../../services/language.service';
|
|
|
|
import { EnterpriseService } from '../../services/enterprise.service';
|
2022-10-12 22:13:29 +00:00
|
|
|
import { NavigationService } from '../../services/navigation.service';
|
2021-03-13 18:24:50 +07:00
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: 'app-bisq-master-page',
|
|
|
|
templateUrl: './bisq-master-page.component.html',
|
|
|
|
styleUrls: ['./bisq-master-page.component.scss'],
|
|
|
|
})
|
|
|
|
export class BisqMasterPageComponent implements OnInit {
|
|
|
|
connectionState$: Observable<number>;
|
|
|
|
navCollapsed = false;
|
2021-07-28 22:32:13 +03:00
|
|
|
env: Env;
|
2021-08-18 21:48:12 +05:30
|
|
|
isMobile = window.innerWidth <= 767.98;
|
2022-01-10 15:50:21 +04:00
|
|
|
urlLanguage: string;
|
2022-10-12 22:13:29 +00:00
|
|
|
networkPaths: { [network: string]: string };
|
2022-01-10 15:50:21 +04:00
|
|
|
|
2021-03-13 18:24:50 +07:00
|
|
|
constructor(
|
|
|
|
private stateService: StateService,
|
2022-01-10 15:50:21 +04:00
|
|
|
private languageService: LanguageService,
|
2022-08-12 16:08:34 +04:00
|
|
|
private enterpriseService: EnterpriseService,
|
2022-10-12 22:13:29 +00:00
|
|
|
private navigationService: NavigationService,
|
2021-03-13 18:24:50 +07:00
|
|
|
) { }
|
|
|
|
|
|
|
|
ngOnInit() {
|
2021-07-28 22:32:13 +03:00
|
|
|
this.env = this.stateService.env;
|
2021-03-13 18:24:50 +07:00
|
|
|
this.connectionState$ = this.stateService.connectionState$;
|
2022-01-10 15:50:21 +04:00
|
|
|
this.urlLanguage = this.languageService.getLanguageForUrl();
|
2022-10-12 22:13:29 +00:00
|
|
|
this.navigationService.subnetPaths.subscribe((paths) => {
|
|
|
|
this.networkPaths = paths;
|
|
|
|
});
|
2021-03-13 18:24:50 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
collapse(): void {
|
|
|
|
this.navCollapsed = !this.navCollapsed;
|
|
|
|
}
|
2021-08-18 21:48:12 +05:30
|
|
|
|
|
|
|
onResize(event: any) {
|
|
|
|
this.isMobile = window.innerWidth <= 767.98;
|
|
|
|
}
|
2021-03-13 18:24:50 +07:00
|
|
|
}
|