1 |
37333849
|
Václav Jirák
|
import { Component, Inject } from '@angular/core';
|
2 |
|
|
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material';
|
3 |
|
|
import { FormControl } from '@angular/forms';
|
4 |
|
|
|
5 |
|
|
@Component({
|
6 |
|
|
selector: 'app-profile-settings',
|
7 |
|
|
templateUrl: './profile-settings.component.html',
|
8 |
|
|
styleUrls: ['./profile-settings.component.sass']
|
9 |
|
|
})
|
10 |
|
|
export class ProfileSettingsComponent {
|
11 |
|
|
constructor(
|
12 |
|
|
public dialogRef: MatDialogRef<ProfileSettingsComponent>,
|
13 |
|
|
@Inject(MAT_DIALOG_DATA) public data: ProfileSettingsDialogData,
|
14 |
|
|
) {
|
15 |
|
|
if (data.notifyTime == null) {
|
16 |
|
|
data.notifyTime = { hour: 8, minute: 0 };
|
17 |
|
|
}
|
18 |
|
|
}
|
19 |
|
|
|
20 |
|
|
onConfirmClick(): void {
|
21 |
|
|
// TODO API CALL
|
22 |
|
|
this.dialogRef.close();
|
23 |
|
|
}
|
24 |
|
|
|
25 |
|
|
onCloseClick(): void {
|
26 |
|
|
this.dialogRef.close();
|
27 |
|
|
}
|
28 |
|
|
}
|
29 |
|
|
|
30 |
|
|
export interface ProfileSettingsDialogData {
|
31 |
|
|
shouldNotify: boolean;
|
32 |
|
|
notifyDate: FormControl;
|
33 |
|
|
notifyTime: { hour: number, minute: number };
|
34 |
|
|
}
|