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
|
|
9
|
@Component({
|
10
|
selector: 'app-main-nav',
|
11
|
templateUrl: './main-nav.component.html',
|
12
|
styleUrls: ['./main-nav.component.css']
|
13
|
})
|
14
|
export class MainNavComponent {
|
15
|
|
16
|
languages: string[] = ['EN', 'DE', 'CZ'];
|
17
|
|
18
|
isHandset$: Observable<boolean> = this.breakpointObserver.observe(Breakpoints.Handset)
|
19
|
.pipe(
|
20
|
map(result => result.matches),
|
21
|
shareReplay()
|
22
|
);
|
23
|
|
24
|
constructor(private breakpointObserver: BreakpointObserver,
|
25
|
public dialog: MatDialog,
|
26
|
private LOGGER: LoggerService) {}
|
27
|
|
28
|
openAboutDialog() {
|
29
|
this.dialog.open(AboutDialogComponent, { panelClass: 'custom-dialog-container' });
|
30
|
}
|
31
|
|
32
|
onLanguageSelect(event) {
|
33
|
console.log(event.target.value);
|
34
|
this.LOGGER.error('Selected language ' + event.target.value);
|
35
|
}
|
36
|
|
37
|
}
|