2020-04-14 11:28:33 +02:00
|
|
|
import { Component, OnInit } from '@angular/core';
|
2020-04-20 18:11:00 +02:00
|
|
|
import { ConfigService } from '../../../services/config.service';
|
2020-04-02 16:36:09 +02:00
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: 'framadate-theme-selector',
|
|
|
|
templateUrl: './theme-selector.component.html',
|
2020-04-14 11:28:33 +02:00
|
|
|
styleUrls: ['./theme-selector.component.scss'],
|
2020-04-02 16:36:09 +02:00
|
|
|
})
|
|
|
|
export class ThemeSelectorComponent implements OnInit {
|
|
|
|
constructor(public config: ConfigService) {
|
2020-04-11 16:59:46 +02:00
|
|
|
// this.selectTheme('dark-crystal')
|
2020-04-02 16:36:09 +02:00
|
|
|
}
|
|
|
|
|
2020-04-14 11:28:33 +02:00
|
|
|
ngOnInit(): void {}
|
2020-04-02 16:36:09 +02:00
|
|
|
|
|
|
|
selectTheme(themeName: string) {
|
|
|
|
if (this.config.themeChoices.includes(themeName)) {
|
2020-04-11 16:59:46 +02:00
|
|
|
this.config.setPreference('themeName', themeName);
|
2020-04-02 16:36:09 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|