diff --git a/src/app/features/project-editor/sections/theme-section.component.html b/src/app/features/project-editor/sections/theme-section.component.html
index b79bcbb..3e89de4 100644
--- a/src/app/features/project-editor/sections/theme-section.component.html
+++ b/src/app/features/project-editor/sections/theme-section.component.html
@@ -1,35 +1,20 @@
@if (bootstrap(); as bootstrap) {
-
- {{ 'builder.theme' | translate }}
+
-
+
}
diff --git a/src/app/features/project-editor/sections/theme-section.component.ts b/src/app/features/project-editor/sections/theme-section.component.ts
index 0e52c18..c4be5c5 100644
--- a/src/app/features/project-editor/sections/theme-section.component.ts
+++ b/src/app/features/project-editor/sections/theme-section.component.ts
@@ -1,9 +1,13 @@
-import { ChangeDetectionStrategy, Component, inject } from '@angular/core';
+import { ChangeDetectionStrategy, Component, computed, inject } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { ProjectEditorFacade } from '../facade/project-editor.facade';
import { TranslatePipe } from '../../../i18n/translate.pipe';
+import { TranslateService } from '../../../i18n/translate.service';
import { PlatformLayoutType, ThemePaletteConfig } from '../../../shared/models/config';
import { FormFieldComponent } from '../../../shared/ui/form-field/form-field.component';
+import { SectionCardComponent } from '../../../shared/ui/section-card/section-card.component';
+import { SelectComponent, SelectOption } from '../../../shared/ui/select/select.component';
+import { ColorPickerComponent } from '../../../shared/ui/color-picker/color-picker.component';
export interface ThemeModeOption {
value: 'light' | 'dark' | 'system';
@@ -20,13 +24,14 @@ export interface SiteLayoutOption {
@Component({
selector: 'app-project-editor-theme-section',
standalone: true,
- imports: [FormsModule, TranslatePipe, FormFieldComponent],
+ imports: [FormsModule, TranslatePipe, FormFieldComponent, SectionCardComponent, SelectComponent, ColorPickerComponent],
templateUrl: './theme-section.component.html',
styleUrls: ['./section.shared.scss'],
changeDetection: ChangeDetectionStrategy.OnPush
})
export class ProjectEditorThemeSectionComponent {
private readonly facade = inject(ProjectEditorFacade);
+ private readonly translate = inject(TranslateService);
readonly bootstrap = this.facade.bootstrap;
readonly themeModeOptions: ThemeModeOption[] = [
@@ -42,6 +47,22 @@ export class ProjectEditorThemeSectionComponent {
{ value: 'minimal', labelKey: 'builder.siteLayoutMinimal', descKey: 'builder.siteLayoutMinimalDesc' },
];
+ readonly themeModeSelectOptions = computed(() =>
+ this.themeModeOptions.map(option => ({
+ value: option.value,
+ label: this.translate.t(option.labelKey),
+ description: this.translate.t(option.descKey)
+ }))
+ );
+
+ readonly siteLayoutSelectOptions = computed(() =>
+ this.siteLayoutOptions.map(option => ({
+ value: option.value,
+ label: this.translate.t(option.labelKey),
+ description: this.translate.t(option.descKey)
+ }))
+ );
+
updatePalette(key: K, value: string): void {
this.facade.updateBootstrap(current => ({
...current,
@@ -62,12 +83,4 @@ export class ProjectEditorThemeSectionComponent {
layout: { ...current.layout, type: type as PlatformLayoutType }
}));
}
-
- themeModeDescKey(mode: string): string {
- return this.themeModeOptions.find(option => option.value === mode)?.descKey ?? '';
- }
-
- siteLayoutDescKey(type: string): string {
- return this.siteLayoutOptions.find(option => option.value === type)?.descKey ?? '';
- }
}