From e3bcb0fdb6374f088ec05bf0c8cb709496184f2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mehmet=20=C3=87etin?= <92744169+mehmetcetin01140@users.noreply.github.com> Date: Tue, 7 Jan 2025 16:31:08 +0300 Subject: [PATCH] refactor getPresetExt method --- src/app/layout/core/app.configurator.ts | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/app/layout/core/app.configurator.ts b/src/app/layout/core/app.configurator.ts index 13c98a0..cf90bd7 100644 --- a/src/app/layout/core/app.configurator.ts +++ b/src/app/layout/core/app.configurator.ts @@ -34,8 +34,8 @@ declare type SurfacesType = { 800?: string; 900?: string; 950?: string; - } -} + }; +}; @Component({ selector: 'app-configurator', @@ -280,6 +280,14 @@ export class AppConfigurator { getPresetExt() { 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') { return { semantic: { @@ -329,7 +337,7 @@ export class AppConfigurator { } }; } else { - if (this.layoutService.layoutConfig().preset === 'Nora') { + if (preset === 'Nora') { return { semantic: { primary: color.palette, @@ -365,9 +373,7 @@ export class AppConfigurator { } } }; - } else if (this.layoutService.layoutConfig().preset === 'Material') { - this.primeng.inputVariant.set('filled'); - + } else if (preset === 'Material') { return { semantic: { primary: color.palette,