From 1c51a819ed88fdca825ea4590b0aa70ee5a9b44e Mon Sep 17 00:00:00 2001 From: sdarbinyan Date: Thu, 16 Jul 2026 02:07:41 +0400 Subject: [PATCH] feat(project-editor): adopt Toggle/SectionCard in homepage and widgets sections Co-Authored-By: Claude Sonnet 5 --- .../sections/homepage-section.component.html | 9 ++++----- .../sections/homepage-section.component.ts | 4 +++- .../sections/widgets-section.component.html | 17 ++++++++--------- .../sections/widgets-section.component.ts | 4 +++- 4 files changed, 18 insertions(+), 16 deletions(-) diff --git a/src/app/features/project-editor/sections/homepage-section.component.html b/src/app/features/project-editor/sections/homepage-section.component.html index c78da56..777d459 100644 --- a/src/app/features/project-editor/sections/homepage-section.component.html +++ b/src/app/features/project-editor/sections/homepage-section.component.html @@ -1,14 +1,13 @@ @if (homePage()) { -
-

{{ 'builder.homepage' | translate }}

+
@for (section of sections(); track section.id) {
{{ section.id }} -
}
-
+ } diff --git a/src/app/features/project-editor/sections/homepage-section.component.ts b/src/app/features/project-editor/sections/homepage-section.component.ts index df83bd9..977944d 100644 --- a/src/app/features/project-editor/sections/homepage-section.component.ts +++ b/src/app/features/project-editor/sections/homepage-section.component.ts @@ -4,6 +4,8 @@ import { FormsModule } from '@angular/forms'; import { ProjectEditorFacade } from '../facade/project-editor.facade'; import { TranslatePipe } from '../../../i18n/translate.pipe'; import { InputComponent } from '../../../shared/ui/input/input.component'; +import { SectionCardComponent } from '../../../shared/ui/section-card/section-card.component'; +import { ToggleComponent } from '../../../shared/ui/toggle/toggle.component'; export interface LayoutStrategyOption { value: 'stack' | 'grid' | 'hero' | 'carousel' | 'split'; @@ -14,7 +16,7 @@ export interface LayoutStrategyOption { @Component({ selector: 'app-project-editor-homepage-section', standalone: true, - imports: [DragDropModule, FormsModule, TranslatePipe, InputComponent], + imports: [DragDropModule, FormsModule, TranslatePipe, InputComponent, SectionCardComponent, ToggleComponent], templateUrl: './homepage-section.component.html', styleUrls: ['./section.shared.scss'], changeDetection: ChangeDetectionStrategy.OnPush diff --git a/src/app/features/project-editor/sections/widgets-section.component.html b/src/app/features/project-editor/sections/widgets-section.component.html index 0bd99ab..4344450 100644 --- a/src/app/features/project-editor/sections/widgets-section.component.html +++ b/src/app/features/project-editor/sections/widgets-section.component.html @@ -1,6 +1,5 @@ @if (widgets().length > 0) { -
-

{{ 'builder.widgets' | translate }}

+
@for (entry of widgets(); track entry.widget.id) {
@@ -10,8 +9,8 @@
- - + +
} @case ('categories') { @@ -24,10 +23,10 @@
- - - - + + + +
} @default { @@ -41,5 +40,5 @@
}
-
+ } diff --git a/src/app/features/project-editor/sections/widgets-section.component.ts b/src/app/features/project-editor/sections/widgets-section.component.ts index 9044593..89299d5 100644 --- a/src/app/features/project-editor/sections/widgets-section.component.ts +++ b/src/app/features/project-editor/sections/widgets-section.component.ts @@ -3,11 +3,13 @@ import { FormsModule } from '@angular/forms'; import { ProjectEditorFacade } from '../facade/project-editor.facade'; import { TranslatePipe } from '../../../i18n/translate.pipe'; import { InputComponent } from '../../../shared/ui/input/input.component'; +import { SectionCardComponent } from '../../../shared/ui/section-card/section-card.component'; +import { ToggleComponent } from '../../../shared/ui/toggle/toggle.component'; @Component({ selector: 'app-project-editor-widgets-section', standalone: true, - imports: [FormsModule, TranslatePipe, InputComponent], + imports: [FormsModule, TranslatePipe, InputComponent, SectionCardComponent, ToggleComponent], templateUrl: './widgets-section.component.html', styleUrls: ['./section.shared.scss'], changeDetection: ChangeDetectionStrategy.OnPush