From 83626deeecc813d9dcbb9d9a3c394af17ab0b482 Mon Sep 17 00:00:00 2001 From: rgravitvl Date: Thu, 18 Jan 2024 09:08:06 +0530 Subject: [PATCH 1/2] updated for product overview block --- blocks/product-overview/product-overview.css | 11 +++++++++++ blocks/product-overview/product-overview.js | 9 +++++++++ styles/styles.css | 14 ++++++++++++++ styles/tailwind.css | 1 + 4 files changed, 35 insertions(+) create mode 100644 blocks/product-overview/product-overview.css create mode 100644 blocks/product-overview/product-overview.js diff --git a/blocks/product-overview/product-overview.css b/blocks/product-overview/product-overview.css new file mode 100644 index 000000000..fa6f07804 --- /dev/null +++ b/blocks/product-overview/product-overview.css @@ -0,0 +1,11 @@ +.product-overview h3 { + @apply text-2xl; +} + +.product-overview h4, .product-overview p, .product-overview li { + @apply pt-2.5; +} + +.product-overview ul { + @apply list-disc pl-12; +} \ No newline at end of file diff --git a/blocks/product-overview/product-overview.js b/blocks/product-overview/product-overview.js new file mode 100644 index 000000000..63f846de1 --- /dev/null +++ b/blocks/product-overview/product-overview.js @@ -0,0 +1,9 @@ +import { getProductResponse } from '../../scripts/scripts.js'; + +export default async function decorate(block) { + const response = getProductResponse(); + block.classList.add(...'text-lg leading-7 overview xl:w-3/4 href-text v-html text-danahergray-700'.split(' ')); + if (response?.length > 0) { + block.innerHTML = response[0].raw ? response[0].raw.richlongdescription : ''; + } +} diff --git a/styles/styles.css b/styles/styles.css index 124cd987e..9d6155f4f 100644 --- a/styles/styles.css +++ b/styles/styles.css @@ -1640,6 +1640,20 @@ svg symbol path { display: none; } +.product-overview h3 { + font-size: 1.5rem; + line-height: 2rem; +} + +.product-overview h4, .product-overview p, .product-overview li { + padding-top: 0.625rem; +} + +.product-overview ul { + list-style-type: disc; + padding-left: 3rem; +} + dialog::backdrop { inset: 0px; background-color: rgb(0 0 0 / var(--tw-bg-opacity)); diff --git a/styles/tailwind.css b/styles/tailwind.css index a31616f80..972eeb433 100644 --- a/styles/tailwind.css +++ b/styles/tailwind.css @@ -24,6 +24,7 @@ @import '../blocks/takeway/takeway.css'; @import '../blocks/product-hero/product-hero.css'; @import '../blocks/page-tabs/page-tabs.css'; +@import '../blocks/product-overview/product-overview.css'; @import '../styles/modal/modal.css'; @import '../styles/coveo-atomic.css'; From d894573107cd687f98cb1e3d3db9a69bde45943e Mon Sep 17 00:00:00 2001 From: rgravitvl Date: Thu, 18 Jan 2024 10:35:29 +0530 Subject: [PATCH 2/2] added the check --- blocks/product-overview/product-overview.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blocks/product-overview/product-overview.js b/blocks/product-overview/product-overview.js index 63f846de1..0bc31897a 100644 --- a/blocks/product-overview/product-overview.js +++ b/blocks/product-overview/product-overview.js @@ -4,6 +4,6 @@ export default async function decorate(block) { const response = getProductResponse(); block.classList.add(...'text-lg leading-7 overview xl:w-3/4 href-text v-html text-danahergray-700'.split(' ')); if (response?.length > 0) { - block.innerHTML = response[0].raw ? response[0].raw.richlongdescription : ''; + block.innerHTML = response[0].raw?.richlongdescription ? response[0].raw.richlongdescription : ''; } }