Skip to content

Commit a7487fb

Browse files
move custom attribute
1 parent 6ae7670 commit a7487fb

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

dotcom-rendering/src/components/ProductCardInline.tsx

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,21 @@ import {
1212
} from '@guardian/source/foundations';
1313
import type { ArticleFormat } from '../lib/articleFormat';
1414
import { palette } from '../palette';
15-
import type { ProductCta, ProductImage } from '../types/content';
15+
import type {
16+
ProductCta,
17+
ProductCustomAttribute,
18+
ProductImage,
19+
} from '../types/content';
1620
import { ProductCardButtons } from './ProductCardButtons';
1721
import { ProductCardImage } from './ProductCardImage';
1822

19-
export type CustomAttributes = {
20-
name: string;
21-
value: string;
22-
};
23-
2423
export type InlineProductCardProps = {
2524
format: ArticleFormat;
2625
brandName: string;
2726
productName: string;
2827
image?: ProductImage;
2928
productCtas: ProductCta[];
30-
customAttributes: CustomAttributes[];
29+
customAttributes: ProductCustomAttribute[];
3130
isCardOnly: boolean;
3231
shouldShowLeftColCard?: boolean;
3332
lowestPrice?: string;
@@ -140,7 +139,7 @@ const customAttributeItem = css`
140139
}
141140
`;
142141

143-
const CustomAttribute = ({ name, value }: CustomAttributes) => (
142+
const CustomAttribute = ({ name, value }: ProductCustomAttribute) => (
144143
<div css={customAttributeItem}>
145144
<strong>{name}</strong>
146145
<br />

dotcom-rendering/src/types/content.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -872,6 +872,11 @@ export type ProductCta = {
872872
price: string;
873873
};
874874

875+
export type ProductCustomAttribute = {
876+
name: string;
877+
value: string;
878+
};
879+
875880
export interface SrcSetItem {
876881
src: string;
877882
width: number;

0 commit comments

Comments
 (0)