refactor getPresetExt method

This commit is contained in:
Mehmet Çetin
2025-01-07 16:31:08 +03:00
parent fba7700eff
commit e3bcb0fdb6

View File

@@ -34,8 +34,8 @@ declare type SurfacesType = {
800?: string; 800?: string;
900?: string; 900?: string;
950?: string; 950?: string;
} };
} };
@Component({ @Component({
selector: 'app-configurator', selector: 'app-configurator',
@@ -280,6 +280,14 @@ export class AppConfigurator {
getPresetExt() { getPresetExt() {
const color: SurfacesType = this.primaryColors().find((c) => c.name === this.selectedPrimaryColor()) || {}; const color: SurfacesType = this.primaryColors().find((c) => c.name === this.selectedPrimaryColor()) || {};
const preset = this.layoutService.layoutConfig().preset;
if (preset === 'Material') {
this.primeng.inputVariant.set('filled');
} else {
this.primeng.inputVariant.set('outlined');
}
if (color.name === 'noir') { if (color.name === 'noir') {
return { return {
semantic: { semantic: {
@@ -329,7 +337,7 @@ export class AppConfigurator {
} }
}; };
} else { } else {
if (this.layoutService.layoutConfig().preset === 'Nora') { if (preset === 'Nora') {
return { return {
semantic: { semantic: {
primary: color.palette, primary: color.palette,
@@ -365,9 +373,7 @@ export class AppConfigurator {
} }
} }
}; };
} else if (this.layoutService.layoutConfig().preset === 'Material') { } else if (preset === 'Material') {
this.primeng.inputVariant.set('filled');
return { return {
semantic: { semantic: {
primary: color.palette, primary: color.palette,