File tree Expand file tree Collapse file tree 2 files changed +11
-12
lines changed
dotcom-rendering/src/components Expand file tree Collapse file tree 2 files changed +11
-12
lines changed Original file line number Diff line number Diff line change @@ -8,14 +8,12 @@ const getLabel = (cta: ProductCta): string => {
88
99export const ProductCardButtons = ( {
1010 productCtas,
11- buttonLabelOverride,
1211} : {
1312 productCtas : ProductCta [ ] ;
14- buttonLabelOverride ?: string ;
1513} ) => (
1614 < >
1715 { productCtas . map ( ( productCta , index ) => {
18- const label = buttonLabelOverride ?? getLabel ( productCta ) ;
16+ const label = getLabel ( productCta ) ;
1917 return (
2018 < ProductLinkButton
2119 key = { label }
Original file line number Diff line number Diff line change @@ -10,8 +10,8 @@ import {
1010import type { ArticleFormat } from '../lib/articleFormat' ;
1111import { palette } from '../palette' ;
1212import type { ProductBlockElement } from '../types/content' ;
13- import { ProductCardButtons } from './ProductCardButtons' ;
1413import { ProductCardImage } from './ProductCardImage' ;
14+ import { ProductLinkButton } from './ProductLinkButton' ;
1515
1616export type ProductCarouselCardProps = {
1717 product : ProductBlockElement ;
@@ -112,14 +112,15 @@ export const ProductCarouselCard = ({
112112 ) }
113113 < div css = { priceStyle } > { firstCta ?. price } </ div >
114114
115- < div css = { buttonWrapper } >
116- < ProductCardButtons
117- productCtas = { firstCta ? [ firstCta ] : [ ] }
118- buttonLabelOverride = {
119- firstCta ? `Buy at ${ firstCta . retailer } ` : undefined
120- }
121- />
122- </ div >
115+ { firstCta && (
116+ < div css = { buttonWrapper } >
117+ < ProductLinkButton
118+ label = { `Buy at ${ firstCta . retailer } ` }
119+ url = { firstCta . url }
120+ minimisePadding = { true }
121+ />
122+ </ div >
123+ ) }
123124 </ div >
124125 ) ;
125126} ;
You can’t perform that action at this time.
0 commit comments