From a1e1c200f2c6a40b465731c6faed9fc9b73d608e Mon Sep 17 00:00:00 2001 From: Alexandru-Butuza Date: Thu, 16 Jan 2025 11:21:03 +0200 Subject: [PATCH] removed hardcoded price label --- .../product-comparison-table.js | 9 +++------ _src/scripts/template-factories/dex-19400.css | 15 +++++++-------- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/_src/blocks/product-comparison-table/product-comparison-table.js b/_src/blocks/product-comparison-table/product-comparison-table.js index c614440cb..eef6343d6 100644 --- a/_src/blocks/product-comparison-table/product-comparison-table.js +++ b/_src/blocks/product-comparison-table/product-comparison-table.js @@ -10,6 +10,7 @@ createNanoBlock('priceComparison', (code, variant, label, block, productIndex, c const priceRoot = document.createElement('div'); priceRoot.classList.add('product-comparison-price'); const oldPriceText = block.closest('.section').dataset.old_price_text ?? ''; + const newPriceLabel = block.closest('.section').dataset.new_price_label ?? ''; const oldPriceElement = document.createElement('p'); priceRoot.appendChild(oldPriceElement); oldPriceElement.innerText = '-'; @@ -37,12 +38,12 @@ createNanoBlock('priceComparison', (code, variant, label, block, productIndex, c oldPriceElement.innerHTML = `
${oldPriceText} - Savings + Savings
`; priceElement.innerHTML = `
- /year + ${newPriceLabel}
`; priceAppliedOnTime.innerHTML = label; @@ -295,10 +296,6 @@ export default function decorate(block) { } }); - if (block.classList.contains('green-tag')) { - block.querySelector('.savings').classList.remove('d-none'); - } - matchHeights(block, 'h3'); matchHeights(block, '.old-price-container'); matchHeights(block, '.product-comparison-price'); diff --git a/_src/scripts/template-factories/dex-19400.css b/_src/scripts/template-factories/dex-19400.css index 257424f1a..b435bbfe7 100644 --- a/_src/scripts/template-factories/dex-19400.css +++ b/_src/scripts/template-factories/dex-19400.css @@ -3,7 +3,12 @@ .section.centered { h2 { font-size: 23px; - justify-self: center; + } + + .default-content-wrapper { + display: flex; + flex-flow: column; + align-items: center; } } @@ -15,7 +20,7 @@ background-color: #F6F6F6; } - .section.light-sky-blue .default-content-wrapper, .section.light-gray .default-content-wrappe { + .section.light-sky-blue .default-content-wrapper, .section.light-gray .default-content-wrapper { h2 { font-size: 23px; margin-bottom: 24px; @@ -42,12 +47,6 @@ } } - .default-content-wrapper{ - display: flex; - flex-flow: column; - align-items: center; - } - .benefits { svg { width: 31px;