1
|
import { Component } from '@angular/core';
|
2
|
import { BreakpointObserver, Breakpoints } from '@angular/cdk/layout';
|
3
|
import { Observable } from 'rxjs';
|
4
|
import { map, shareReplay } from 'rxjs/operators';
|
5
|
import { AboutDialogComponent } from '../../shared-components/about-dialog/about-dialog.component';
|
6
|
import { MatDialog } from '@angular/material/dialog';
|
7
|
import { LoggerService } from '../../../services/logger/logger.service';
|
8
|
import { TranslateService } from '@ngx-translate/core';
|
9
|
|
10
|
@Component({
|
11
|
selector: 'app-main-nav',
|
12
|
templateUrl: './main-nav.component.html',
|
13
|
styleUrls: ['./main-nav.component.css']
|
14
|
})
|
15
|
export class MainNavComponent {
|
16
|
|
17
|
isHandset$: Observable<boolean> = this.breakpointObserver.observe(Breakpoints.Handset)
|
18
|
.pipe(
|
19
|
map(result => result.matches),
|
20
|
shareReplay()
|
21
|
);
|
22
|
|
23
|
constructor(private breakpointObserver: BreakpointObserver,
|
24
|
public dialog: MatDialog,
|
25
|
private LOGGER: LoggerService,
|
26
|
public translate: TranslateService ) {}
|
27
|
|
28
|
openAboutDialog() {
|
29
|
this.dialog.open(AboutDialogComponent, { panelClass: 'custom-dialog-container' });
|
30
|
}
|
31
|
|
32
|
onLanguageSelect(event, langSelect) {
|
33
|
this.translate.use(langSelect.value);
|
34
|
this.LOGGER.info('Selected language: ' + event.target.value);
|
35
|
}
|
36
|
|
37
|
}
|