1
|
import { Component, Input } from '@angular/core';
|
2
|
import { MatDialog } from '@angular/material';
|
3
|
import { ProfileSettingsComponent } from '../profile-settings/profile-settings.component';
|
4
|
import { ProfileService } from '../services/profile.service';
|
5
|
import { UserProfile } from '../models/user-profile.model';
|
6
|
import {LocalizationService} from "../localization/localization.service";
|
7
|
|
8
|
@Component({
|
9
|
selector: 'app-header',
|
10
|
templateUrl: './header.component.html',
|
11
|
styleUrls: ['./header.component.sass']
|
12
|
})
|
13
|
export class HeaderComponent {
|
14
|
@Input() name = 'John Doe';
|
15
|
|
16
|
private notificationSettings: Date;
|
17
|
|
18
|
constructor(
|
19
|
private dialog: MatDialog,
|
20
|
private profileService: ProfileService,
|
21
|
private localizationService: LocalizationService
|
22
|
) {
|
23
|
// profileService.getProfile()
|
24
|
// .subscribe((data: UserProfile) => this.notificationSettings = new Date(data.settings.notification));
|
25
|
}
|
26
|
|
27
|
onProfileClick(): void {
|
28
|
this.dialog.open(ProfileSettingsComponent, {
|
29
|
data: {
|
30
|
shouldNotify: this.notificationSettings, // TODO potřeba?
|
31
|
notifyDate: this.notificationSettings,
|
32
|
notifyTime: {
|
33
|
hour: this.notificationSettings.getHours(),
|
34
|
minute: this.notificationSettings.getMinutes()
|
35
|
}
|
36
|
}
|
37
|
});
|
38
|
}
|
39
|
}
|