Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 17 additions & 13 deletions dotcom-rendering/src/components/ScrollableProduct.importable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -324,19 +324,23 @@ export const ScrollableProduct = ({ products, format }: Props) => {
data-heatphan-type="carousel"
onFocus={scrollToCardOnFocus}
>
{products.map((product: ProductBlockElement) => (
<li
key={
product.productCtas[0]?.url ?? product.elementId
}
css={[subgridStyles, leftBorderStyles]}
>
<ProductCarouselCard
product={product}
format={format}
/>
</li>
))}
{products.map(
(product: ProductBlockElement, index: number) => (
<li
key={
product.productCtas[0]?.url ??
product.elementId
}
css={[subgridStyles, leftBorderStyles]}
data-component={`at-a-glance-carousel-card-${index}`}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want the data-component to be at-a-glance-carousel-card-0 for the first card as it is here? Or would it be more readable for non developers looking at the data for it to be at-a-glance-carousel-card-1?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh yea would be good to align with the stacked cards, are you doing index + 1 there?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep stacked cards is doing index + 1

>
<ProductCarouselCard
product={product}
format={format}
/>
</li>
),
)}
</ol>
<CarouselNavigationButtons
previousButtonEnabled={previousButtonEnabled}
Expand Down
Loading