diff --git a/packages/components/plh/index.ts b/packages/components/plh/index.ts index 1f28fe7a3a..076f6e744b 100644 --- a/packages/components/plh/index.ts +++ b/packages/components/plh/index.ts @@ -9,14 +9,21 @@ import { PlhParentPointCounterComponent } from "./parent-point-counter/parent-po import { PlhParentPointBoxComponent } from "./parent-point-box/parent-point-box.component"; import { PlhModuleListItemComponent } from "./plh-kids-kw/components/module-list-item/module-list-item.component"; import { RouterModule } from "@angular/router"; +import { PlhModuleDetailsHeaderComponent } from "./plh-kids-kw/components/module-details-header/module-details-header.component"; @NgModule({ imports: [CommonModule, IonicModule, TemplatePipesModule, LottieModule, RouterModule], - exports: [PlhParentPointCounterComponent, PlhParentPointBoxComponent, PlhModuleListItemComponent], + exports: [ + PlhParentPointCounterComponent, + PlhParentPointBoxComponent, + PlhModuleListItemComponent, + PlhModuleDetailsHeaderComponent, + ], declarations: [ PlhParentPointCounterComponent, PlhParentPointBoxComponent, PlhModuleListItemComponent, + PlhModuleDetailsHeaderComponent, ], providers: [], }) @@ -25,5 +32,6 @@ export class PlhComponentsModule {} export const PLH_COMPONENT_MAPPING: Record> = { parent_point_counter: PlhParentPointCounterComponent, parent_point_box: PlhParentPointBoxComponent, + plh_module_details_header: PlhModuleDetailsHeaderComponent, plh_module_list_item: PlhModuleListItemComponent, }; diff --git a/packages/components/plh/plh-kids-kw/components/module-details-header/module-details-header.component.html b/packages/components/plh/plh-kids-kw/components/module-details-header/module-details-header.component.html new file mode 100644 index 0000000000..b9446501e4 --- /dev/null +++ b/packages/components/plh/plh-kids-kw/components/module-details-header/module-details-header.component.html @@ -0,0 +1,22 @@ +
+
+
+ @if (params.moduleImageAsset) { +
+ +
+ } +
+ @if (_row.value) { +
+

{{ _row.value }}

+
+ } +
+
diff --git a/packages/components/plh/plh-kids-kw/components/module-details-header/module-details-header.component.scss b/packages/components/plh/plh-kids-kw/components/module-details-header/module-details-header.component.scss new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/components/plh/plh-kids-kw/components/module-details-header/module-details-header.component.spec.ts b/packages/components/plh/plh-kids-kw/components/module-details-header/module-details-header.component.spec.ts new file mode 100644 index 0000000000..55d43ae18a --- /dev/null +++ b/packages/components/plh/plh-kids-kw/components/module-details-header/module-details-header.component.spec.ts @@ -0,0 +1,24 @@ +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; +import { IonicModule } from "@ionic/angular"; + +import { PlhModuleDetailsHeaderComponent } from "./module-details-header.component"; + +describe("ModuleDetailsHeaderComponent", () => { + let component: PlhModuleDetailsHeaderComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [PlhModuleDetailsHeaderComponent], + imports: [IonicModule.forRoot()], + }).compileComponents(); + + fixture = TestBed.createComponent(PlhModuleDetailsHeaderComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + })); + + it("should create", () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/packages/components/plh/plh-kids-kw/components/module-details-header/module-details-header.component.ts b/packages/components/plh/plh-kids-kw/components/module-details-header/module-details-header.component.ts new file mode 100644 index 0000000000..69ad13cfcc --- /dev/null +++ b/packages/components/plh/plh-kids-kw/components/module-details-header/module-details-header.component.ts @@ -0,0 +1,34 @@ +import { Component, OnInit } from "@angular/core"; +import { TemplateBaseComponent } from "src/app/shared/components/template/components/base"; +import { TemplateTranslateService } from "src/app/shared/components/template/services/template-translate.service"; +import { getParamFromTemplateRow, getStringParamFromTemplateRow } from "src/app/shared/utils"; + +interface IModuleHeaderParams { + bgImage?: string; + moduleImageAsset?: string; +} +@Component({ + selector: "plh-module-details-header", + templateUrl: "./module-details-header.component.html", + styleUrls: ["./module-details-header.component.scss"], +}) +export class PlhModuleDetailsHeaderComponent extends TemplateBaseComponent implements OnInit { + params: Partial = {}; + + constructor(public templateTranslateService: TemplateTranslateService) { + super(); + } + + ngOnInit() { + this.getParams(); + } + + private getParams() { + this.params.bgImage = getStringParamFromTemplateRow(this._row, "background_illustration", null); + this.params.moduleImageAsset = getStringParamFromTemplateRow( + this._row, + "module_image_asset", + null + ); + } +} diff --git a/src/theme/themes/plh_kids_kw/_overrides.scss b/src/theme/themes/plh_kids_kw/_overrides.scss index bc43f62bbb..aa01d929fd 100644 --- a/src/theme/themes/plh_kids_kw/_overrides.scss +++ b/src/theme/themes/plh_kids_kw/_overrides.scss @@ -249,6 +249,46 @@ body[data-theme="plh_kids_kw"] { } } + // module header + plh-module-details-header { + .module-header { + border-bottom-left-radius: 40px; + border-bottom-right-radius: 40px; + background-color: #9ecbf5; + } + .image { + .module-illustration { + height: 480px; + background-position: center; + background-repeat: no-repeat; + background-size: 380px; + + display: flex; + justify-content: center; + align-items: center; + } + img.module-image { + max-width: 220px; + min-width: 220px; + margin-top: -40px; + } + } + .module-title { + margin-top: -70px; + padding-bottom: 30px; + padding-left: 16px; + h2 { + font-weight: var(--font-weight-bold); + font-size: 28px; + } + } + .wrapper[data-language-direction~="rtl"] { + .module-title { + padding-right: 16px; + } + } + } + // module-list-item plh-module-list-item { .module-item {