From 26303a1c24a02df9592f533a35b85c3598c07dfb Mon Sep 17 00:00:00 2001 From: Venkat Kandagaddala Date: Thu, 1 Aug 2024 12:58:37 +0530 Subject: [PATCH] Karma programs v2 changes --- ...karma-programs-microsite-v2.component.html | 4 +- ...karma-programs-microsite-v2.component.scss | 35 ----------------- .../karma-programs-microsite-v2.component.ts | 39 +------------------ 3 files changed, 3 insertions(+), 75 deletions(-) diff --git a/project/ws/app/src/lib/routes/karma-programs/karma-programs-microsite-v2/karma-programs-microsite-v2.component.html b/project/ws/app/src/lib/routes/karma-programs/karma-programs-microsite-v2/karma-programs-microsite-v2.component.html index 8b9ce1e57..fcb14e866 100644 --- a/project/ws/app/src/lib/routes/karma-programs/karma-programs-microsite-v2/karma-programs-microsite-v2.component.html +++ b/project/ws/app/src/lib/routes/karma-programs/karma-programs-microsite-v2/karma-programs-microsite-v2.component.html @@ -86,14 +86,12 @@

{{data?.title}}

-
-
+
diff --git a/project/ws/app/src/lib/routes/karma-programs/karma-programs-microsite-v2/karma-programs-microsite-v2.component.scss b/project/ws/app/src/lib/routes/karma-programs/karma-programs-microsite-v2/karma-programs-microsite-v2.component.scss index ea88b2378..53bd423d4 100644 --- a/project/ws/app/src/lib/routes/karma-programs/karma-programs-microsite-v2/karma-programs-microsite-v2.component.scss +++ b/project/ws/app/src/lib/routes/karma-programs/karma-programs-microsite-v2/karma-programs-microsite-v2.component.scss @@ -114,39 +114,4 @@ .banner-image-v2 { width: 100%; height: 100%; - } - - @media screen and (min-width: 344px) and (max-width: 882px) { - .banner-new { - height: 250px; - } - .description-v2 { - padding: 0 15px; - } - } - - @media screen and (min-width: 430px) and (max-width: 932px) { - .banner-new { - height: 260px; - } - .description-v2 { - padding: 0 15px; - } - } - @media screen and (min-width: 540px) and (max-width: 720px) { - .banner-new { - height: 325px; - } - .description-v2 { - padding: 0 15px; - } - } - - @media screen and (min-width: 768px) and (max-width: 1180px) { - .banner-new { - height: 320px; - } - .description-v2 { - padding: 0 15px; - } } \ No newline at end of file diff --git a/project/ws/app/src/lib/routes/karma-programs/karma-programs-microsite-v2/karma-programs-microsite-v2.component.ts b/project/ws/app/src/lib/routes/karma-programs/karma-programs-microsite-v2/karma-programs-microsite-v2.component.ts index d00184e51..2dc176028 100644 --- a/project/ws/app/src/lib/routes/karma-programs/karma-programs-microsite-v2/karma-programs-microsite-v2.component.ts +++ b/project/ws/app/src/lib/routes/karma-programs/karma-programs-microsite-v2/karma-programs-microsite-v2.component.ts @@ -1,4 +1,4 @@ -import { Component, HostListener, OnInit } from '@angular/core' +import { Component, OnInit } from '@angular/core' import { ActivatedRoute } from '@angular/router' import { CommonMethodsService } from '@sunbird-cb/consumption' import { KarmaProgramsService } from '../service/karma-programs.service' @@ -65,50 +65,15 @@ export class KarmaProgramsMicrositeV2Component implements OnInit { && this.route.snapshot.data.formData.data.result.form.data.sectionList ) { this.sectionList = this.route.snapshot.data.formData.data.result.form.data.sectionList - let bannerSection = this.sectionList.find((ele: any) => ele.key === 'bannerSection' && ele.enabled) - if (bannerSection && bannerSection.column[0] && - bannerSection.column[0].data && bannerSection.column[0].data.versioning) { - this.bannerImages = this.sectionList[0].column[0].data.bannerImagesV2 - if (this.bannerImages) { - this.setBackgroundImage() - } - } - // if (this.sectionList[0] && this.sectionList[0].enabled && this.sectionList[0].column[0] && - // this.sectionList[0].column[0].data && - // this.sectionList[0].column[0].data.versioning) { - // this.bannerImages = this.sectionList[0].column[0].data.bannerImagesV2 - // if (this.bannerImages) { - // this.setBackgroundImage() - // } - // } this.getDataFromSearch() } } - - @HostListener('window:resize', ['$event']) - onResize() { - this.setBackgroundImage(); - } - + richTextContent(content: any) { return this.sanitizer.bypassSecurityTrustHtml(content) } - setBackgroundImage() { - const width = window.innerWidth; - if (width < 380) { - this.currentImageUrl = this.bannerImages.s; - } else if (width >= 380 && width < 600) { - this.currentImageUrl = this.bannerImages.m; - } else if (width >= 600 && width < 900) { - this.currentImageUrl = this.bannerImages.l; - } else if (width >= 900 && width < 1200) { - this.currentImageUrl = this.bannerImages.xl; - } else { - this.currentImageUrl = this.bannerImages.xxl; - } - } async getDataFromSearch(requestData?: any) { const request = requestData || this.formRequest() const sectionData = this.sectionList.filter((ele: any) => ele.key === 'contentSearch')