forked from devsecopsmaturitymodel/DevSecOps-MaturityModel
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsidenav-buttons.component.ts
More file actions
70 lines (65 loc) · 1.56 KB
/
sidenav-buttons.component.ts
File metadata and controls
70 lines (65 loc) · 1.56 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
import { Component, OnInit } from '@angular/core';
import { MatIconRegistry } from '@angular/material/icon';
import { DomSanitizer } from '@angular/platform-browser';
import { GITHUB_SVG } from '../../../assets/svg_icons';
import { ThemeService } from '../../service/theme.service';
@Component({
selector: 'app-sidenav-buttons',
templateUrl: './sidenav-buttons.component.html',
styleUrls: ['./sidenav-buttons.component.css'],
})
export class SidenavButtonsComponent implements OnInit {
Options: string[] = [
'Overview',
'Matrix',
'Mappings',
'Teams',
'Settings',
'Usage',
'Roadmap',
'DSOMM User Day',
'About Us',
];
Icons: string[] = [
'pie_chart',
'table_chart',
'timeline',
'people',
'list',
'description',
'landscape',
'school',
'info',
];
Routing: string[] = [
'/circular-heatmap',
'/matrix',
'/mapping',
'/teams',
'/settings',
'/usage',
'/roadmap',
'/userday',
'/about',
];
isNightMode = false;
constructor(
private themeService: ThemeService,
private iconRegistry: MatIconRegistry,
private sanitizer: DomSanitizer
) {
this.iconRegistry.addSvgIconLiteral(
'github',
this.sanitizer.bypassSecurityTrustHtml(GITHUB_SVG)
);
}
ngOnInit(): void {
const currentTheme = this.themeService.getTheme();
this.isNightMode = currentTheme === 'dark';
}
toggleTheme(): void {
this.isNightMode = !this.isNightMode;
const newTheme = this.isNightMode ? 'dark' : 'light';
this.themeService.setTheme(newTheme);
}
}