File tree Expand file tree Collapse file tree 3 files changed +40
-36
lines changed
dotcom-rendering/src/components Expand file tree Collapse file tree 3 files changed +40
-36
lines changed Original file line number Diff line number Diff line change @@ -14,9 +14,9 @@ import {
1414import type { ArticleFormat } from '../lib/articleFormat' ;
1515import { palette } from '../palette' ;
1616import type { ProductImage } from '../types/content' ;
17+ import { ProductCardButtons } from './ProductCardButtons' ;
1718import { ProductCardImage } from './ProductCardImage' ;
1819import type { ProductCardCta } from './ProductElement' ;
19- import { ProductLinkButton } from './ProductLinkButton' ;
2020
2121export type CustomAttributes = {
2222 name : string ;
@@ -213,37 +213,3 @@ export const InlineProductCard = ({
213213 </ div >
214214 ) ;
215215} ;
216-
217- export const ProductCardButtons = ( {
218- productCtas,
219- dataComponent,
220- } : {
221- productCtas : ProductCardCta [ ] ;
222- dataComponent ?: string ;
223- } ) => {
224- return (
225- < >
226- { productCtas . map ( ( productCta , index ) => (
227- < ProductLinkButton
228- key = { productCta . label }
229- label = { productCta . label }
230- url = { productCta . url }
231- priority = { index === 0 ? 'primary' : 'tertiary' }
232- cssOverrides = {
233- index === 0
234- ? css `
235- width: 100%;
236- `
237- : css `
238- width: 100%;
239- margin- to p: ${ space [ 1 ] } px;
240- `
241- }
242- data-component = { `${
243- dataComponent ?? 'product-card-button'
244- } -${ index } `}
245- />
246- ) ) }
247- </ >
248- ) ;
249- } ;
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ import {
1010import type { ArticleFormat } from '../lib/articleFormat' ;
1111import { palette } from '../palette' ;
1212import type { ProductImage } from '../types/content' ;
13- import { ProductCardButtons } from './InlineProductCard ' ;
13+ import { ProductCardButtons } from './ProductCardButtons ' ;
1414import { ProductCardImage } from './ProductCardImage' ;
1515import type { ProductCardCta } from './ProductElement' ;
1616
Original file line number Diff line number Diff line change 1+ import { css } from '@emotion/react' ;
2+ import { space } from '@guardian/source/foundations' ;
3+ import type { ProductCardCta } from './ProductElement' ;
4+ import { ProductLinkButton } from './ProductLinkButton' ;
5+
6+ export const ProductCardButtons = ( {
7+ productCtas,
8+ dataComponent,
9+ } : {
10+ productCtas : ProductCardCta [ ] ;
11+ dataComponent ?: string ;
12+ } ) => {
13+ return (
14+ < >
15+ { productCtas . map ( ( productCta , index ) => (
16+ < ProductLinkButton
17+ key = { productCta . label }
18+ label = { productCta . label }
19+ url = { productCta . url }
20+ priority = { index === 0 ? 'primary' : 'tertiary' }
21+ cssOverrides = {
22+ index === 0
23+ ? css `
24+ width : 100% ;
25+ `
26+ : css `
27+ width : 100% ;
28+ margin-top : ${ space [ 1 ] } px;
29+ `
30+ }
31+ data-component = { `${
32+ dataComponent ?? 'product-card-button'
33+ } -${ index } `}
34+ />
35+ ) ) }
36+ </ >
37+ ) ;
38+ } ;
You can’t perform that action at this time.
0 commit comments