-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathimprint.component.ts
More file actions
81 lines (73 loc) · 2.67 KB
/
Copy pathimprint.component.ts
File metadata and controls
81 lines (73 loc) · 2.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
import { Component, OnDestroy, OnInit } from "@angular/core";
import { RouterModule } from "@angular/router";
import { ObservationService } from "../../shared/services/observation.service";
import { TranslateModule } from "@ngx-translate/core";
import { Subscription, tap } from "rxjs";
import { ThemeOptions } from "../../shared/enums/theme-options.enum";
import { CommonModule } from "@angular/common";
import { BaseRoute } from "../../api/routes/base.route.enum";
import { AssetsPreloadService } from "../../shared/services/assets-preload.service";
@Component({
selector: 'tava-imprint',
templateUrl: './imprint.component.html',
styleUrl: './imprint.component.scss',
imports: [
CommonModule,
RouterModule,
TranslateModule
]
})
export class ImprintComponent implements OnInit, OnDestroy {
protected selectedBg: string;
protected devData: any;
protected ownerData: any;
protected images: string[];
protected isPreloading: boolean;
private subscriptionThemeObservation$: Subscription;
constructor(
private readonly observation: ObservationService,
private readonly preload: AssetsPreloadService
) {
this.selectedBg = '';
this.subscriptionThemeObservation$ = new Subscription();
this.devData = {
project: 'taxi-varga',
version: 'v2.0.9',
github: 'https://github.com/yqni13/taxi-varga/tree/production',
portfolio: 'https://yqni13.com',
contact: BaseRoute.SUPPORT
};
this.ownerData = {
name: 'Ing. Laszlo Varga',
address: 'Anton Bruckner-Gasse 11\n2544 Leobersdorf, Österreich',
uid: 'ATU60067019',
email: 'laszlovarga@gmx.at',
phone: '+436644465466',
};
this.images = [];
this.isPreloading = true;
}
ngOnInit() {
this.subscriptionThemeObservation$ = this.observation.themeOption$.pipe(
tap((theme: ThemeOptions) => {
switch(theme) {
case(ThemeOptions.lightMode): {
this.selectedBg = 'bg-pattern-light';
break;
}
case(ThemeOptions.darkMode):
default: {
this.selectedBg = 'bg-pattern-dark';
}
}
})
).subscribe();
this.images = ['assets/docs/icons/yqni13-small.png'];
this.preload.preloadAssets({images: this.images}).finally(() => {
this.isPreloading = false;
})
}
ngOnDestroy() {
this.subscriptionThemeObservation$.unsubscribe();
}
}