Skip to content

Commit ef8921e

Browse files
Fix xcust by adding all the cards to the dom from the server (#15332)
uses css to show and hide those additional cards. This means that the links are in the DOM from the server. As these links are always there they are now all updated by the function that adds the additional parameters in the client.
1 parent 694c549 commit ef8921e

1 file changed

Lines changed: 17 additions & 16 deletions

File tree

dotcom-rendering/src/components/StackedProducts.importable.tsx

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -76,22 +76,23 @@ export const StackedProducts = ({
7676
`,
7777
]}
7878
>
79-
{products.map(
80-
(product: ProductBlockElement, index) =>
81-
(index < cardsShownByDefault || isExpanded) && (
82-
<div
83-
key={index}
84-
data-component={`at-a-glance-stacked-card-${
85-
index + 1
86-
}`}
87-
>
88-
<HorizontalSummaryProductCard
89-
product={product}
90-
format={format}
91-
/>
92-
</div>
93-
),
94-
)}
79+
{products.map((product: ProductBlockElement, index) => (
80+
<div
81+
key={index}
82+
data-component={`at-a-glance-stacked-card-${index + 1}`}
83+
style={{
84+
display:
85+
!isExpanded && index >= cardsShownByDefault
86+
? 'none'
87+
: 'block',
88+
}}
89+
>
90+
<HorizontalSummaryProductCard
91+
product={product}
92+
format={format}
93+
/>
94+
</div>
95+
))}
9596
</div>
9697

9798
{products.length > cardsShownByDefault && (

0 commit comments

Comments
 (0)