2020-04-22 12:56:18 +02:00
|
|
|
import { Component, OnInit } from '@angular/core';
|
|
|
|
import { Observable } from 'rxjs';
|
|
|
|
|
2020-05-01 19:10:17 +02:00
|
|
|
import { Theme } from '../../../enums/theme.enum';
|
|
|
|
import { ThemeService } from '../../../services/theme.service';
|
2020-04-22 12:56:18 +02:00
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: 'app-theme-selector',
|
|
|
|
templateUrl: './theme-selector.component.html',
|
|
|
|
styleUrls: ['./theme-selector.component.scss'],
|
|
|
|
})
|
|
|
|
export class ThemeSelectorComponent implements OnInit {
|
|
|
|
public themeEnum = Theme;
|
|
|
|
public currentTheme: Observable<Theme>;
|
|
|
|
|
|
|
|
constructor(private themeService: ThemeService) {}
|
|
|
|
|
|
|
|
ngOnInit(): void {
|
|
|
|
this.currentTheme = this.themeService.theme;
|
|
|
|
}
|
|
|
|
|
|
|
|
public selectTheme(theme: string): void {
|
|
|
|
this.themeService.selectTheme(theme as Theme);
|
|
|
|
}
|
|
|
|
}
|