fix: extract full description from productTabs block content instead of showing short fallback
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 8s
Build & Deploy / 🧪 QA (push) Successful in 1m42s
Build & Deploy / 🏗️ Build (push) Successful in 3m54s
Build & Deploy / 🚀 Deploy (push) Successful in 23s
Build & Deploy / 🧪 Post-Deploy Verification (push) Failing after 1m12s
Build & Deploy / ⚡ Performance & Accessibility (push) Has been skipped
Build & Deploy / 🔔 Notify (push) Successful in 2s
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 8s
Build & Deploy / 🧪 QA (push) Successful in 1m42s
Build & Deploy / 🏗️ Build (push) Successful in 3m54s
Build & Deploy / 🚀 Deploy (push) Successful in 23s
Build & Deploy / 🧪 Post-Deploy Verification (push) Failing after 1m12s
Build & Deploy / ⚡ Performance & Accessibility (push) Has been skipped
Build & Deploy / 🔔 Notify (push) Successful in 2s
This commit is contained in:
@@ -258,7 +258,7 @@ export default async function ProductPage({ params }: ProductPageProps) {
|
|||||||
(node.fields?.blockType === 'productTabs' ||
|
(node.fields?.blockType === 'productTabs' ||
|
||||||
node.fields?.blockType === 'productTechnicalData'),
|
node.fields?.blockType === 'productTechnicalData'),
|
||||||
);
|
);
|
||||||
const descriptionChildren = rootChildren.filter(
|
let descriptionChildren = rootChildren.filter(
|
||||||
(node: any) =>
|
(node: any) =>
|
||||||
!(
|
!(
|
||||||
node.type === 'block' &&
|
node.type === 'block' &&
|
||||||
@@ -267,6 +267,16 @@ export default async function ProductPage({ params }: ProductPageProps) {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// If no standalone description nodes, extract from the productTabs block's embedded content
|
||||||
|
if (descriptionChildren.length === 0) {
|
||||||
|
const tabsBlock = rootChildren.find(
|
||||||
|
(node: any) => node.type === 'block' && node.fields?.blockType === 'productTabs',
|
||||||
|
);
|
||||||
|
if (tabsBlock?.fields?.content?.root?.children) {
|
||||||
|
descriptionChildren = tabsBlock.fields.content.root.children;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const descriptionContent = {
|
const descriptionContent = {
|
||||||
root: {
|
root: {
|
||||||
...product.content.root,
|
...product.content.root,
|
||||||
|
|||||||
Reference in New Issue
Block a user