Files
marketplaces/src/app/features/project-editor/sections/theme-section.component.ts

26 lines
991 B
TypeScript
Raw Normal View History

2026-07-10 13:43:53 +04:00
import { ChangeDetectionStrategy, Component, inject } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { ProjectEditorFacade } from '../facade/project-editor.facade';
import { TranslatePipe } from '../../../i18n/translate.pipe';
import { ThemePaletteConfig } from '../../../shared/models/config';
@Component({
selector: 'app-project-editor-theme-section',
standalone: true,
imports: [FormsModule, TranslatePipe],
templateUrl: './theme-section.component.html',
styleUrls: ['./section.shared.scss'],
changeDetection: ChangeDetectionStrategy.OnPush
})
export class ProjectEditorThemeSectionComponent {
private readonly facade = inject(ProjectEditorFacade);
readonly bootstrap = this.facade.bootstrap;
updatePalette<K extends keyof ThemePaletteConfig>(key: K, value: string): void {
this.facade.updateBootstrap(current => ({
...current,
theme: { ...current.theme, palette: { ...current.theme.palette, [key]: value } }
}));
}
}