ov-components: update CLASSIC to Classic for consistency in theme handling

master
Carlos Santos 2025-09-30 12:08:41 +02:00
parent ec4e2a2f76
commit e00120b046
2 changed files with 4 additions and 4 deletions

View File

@ -5,7 +5,7 @@
export enum OpenViduThemeMode { export enum OpenViduThemeMode {
Light = 'light', Light = 'light',
Dark = 'dark', Dark = 'dark',
CLASSIC = 'classic' Classic = 'classic'
} }
/** /**

View File

@ -25,7 +25,7 @@ import { StorageService } from '../storage/storage.service';
}) })
export class OpenViduThemeService { export class OpenViduThemeService {
private readonly THEME_ATTRIBUTE = 'data-ov-theme'; private readonly THEME_ATTRIBUTE = 'data-ov-theme';
private currentThemeSubject = new BehaviorSubject<OpenViduThemeMode>(OpenViduThemeMode.CLASSIC); private currentThemeSubject = new BehaviorSubject<OpenViduThemeMode>(OpenViduThemeMode.Classic);
private currentVariablesSubject = new BehaviorSubject<OpenViduThemeVariables>({}); private currentVariablesSubject = new BehaviorSubject<OpenViduThemeVariables>({});
/** /**
@ -45,7 +45,7 @@ export class OpenViduThemeService {
initializeTheme(): void { initializeTheme(): void {
const savedTheme = this.storageService.getTheme(); const savedTheme = this.storageService.getTheme();
const initialTheme = savedTheme || OpenViduThemeMode.CLASSIC; const initialTheme = savedTheme || OpenViduThemeMode.Classic;
this.applyTheme(initialTheme); this.applyTheme(initialTheme);
this.currentThemeSubject.next(initialTheme); this.currentThemeSubject.next(initialTheme);
} }
@ -149,7 +149,7 @@ export class OpenViduThemeService {
private applyTheme(theme: OpenViduThemeMode): void { private applyTheme(theme: OpenViduThemeMode): void {
const documentElement = this.document.documentElement; const documentElement = this.document.documentElement;
const currentTheme = this.getCurrentTheme(); const currentTheme = this.getCurrentTheme();
if (theme === OpenViduThemeMode.CLASSIC) { if (theme === OpenViduThemeMode.Classic) {
documentElement.removeAttribute(this.THEME_ATTRIBUTE); documentElement.removeAttribute(this.THEME_ATTRIBUTE);
const currentVariables = this.getDefaultVariablesForTheme(currentTheme); const currentVariables = this.getDefaultVariablesForTheme(currentTheme);
this.removeCSSVariables(currentVariables); this.removeCSSVariables(currentVariables);