frontend: Improve theme config feature and apply base theme in components
This commit is contained in:
parent
0a97f05c58
commit
693de3aa15
@ -48,6 +48,7 @@ import {
|
||||
DataPacket_Kind,
|
||||
OpenViduComponentsUiModule,
|
||||
OpenViduService,
|
||||
OpenViduThemeMode,
|
||||
OpenViduThemeService,
|
||||
ParticipantLeftEvent,
|
||||
ParticipantLeftReason,
|
||||
@ -135,9 +136,10 @@ export class MeetingComponent implements OnInit {
|
||||
this.features = this.featureConfService.features;
|
||||
|
||||
// Change theme variables when custom theme is enabled
|
||||
effect(async () => {
|
||||
effect(() => {
|
||||
if (this.features().hasCustomTheme) {
|
||||
const theme = this.features().themeConfig;
|
||||
this.ovThemeService.setTheme(theme!.baseTheme as unknown as OpenViduThemeMode);
|
||||
this.ovThemeService.updateThemeVariables({
|
||||
'--ov-primary-action-color': theme?.primaryColor,
|
||||
'--ov-secondary-action-color': theme?.secondaryColor,
|
||||
|
||||
@ -2,6 +2,7 @@ import { computed, Injectable, signal } from '@angular/core';
|
||||
import {
|
||||
MeetAppearanceConfig,
|
||||
MeetRoomConfig,
|
||||
MeetRoomTheme,
|
||||
ParticipantPermissions,
|
||||
ParticipantRole,
|
||||
RecordingPermissions,
|
||||
@ -36,12 +37,7 @@ export interface ApplicationFeatures {
|
||||
|
||||
// Appearance
|
||||
hasCustomTheme: boolean;
|
||||
themeConfig?: {
|
||||
primaryColor?: string;
|
||||
secondaryColor?: string;
|
||||
backgroundColor?: string;
|
||||
surfaceColor?: string;
|
||||
};
|
||||
themeConfig?: MeetRoomTheme;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -204,12 +200,7 @@ export class FeatureConfigurationService {
|
||||
features.showThemeSelector = !hasEnabledTheme;
|
||||
|
||||
if (hasEnabledTheme) {
|
||||
features.themeConfig = {
|
||||
primaryColor: theme.primaryColor,
|
||||
secondaryColor: theme.secondaryColor,
|
||||
backgroundColor: theme.backgroundColor,
|
||||
surfaceColor: theme.surfaceColor
|
||||
};
|
||||
features.themeConfig = theme;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user