Skip to content

Commit 9c76474

Browse files
Left col card changes:
- minor tweaks to left col card so its more aligned with the figma - removed retailer from the price row (TBC) - reworded cta (this TBC) - updated storybooks to reflect the likes/dislikes of product
1 parent 16128e4 commit 9c76474

File tree

4 files changed

+36
-59
lines changed

4 files changed

+36
-59
lines changed

dotcom-rendering/src/components/LeftColProductCard.stories.tsx

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,23 +27,20 @@ const meta = {
2727
export default meta;
2828

2929
const sampleProductCard: LeftColProductCardProps = {
30-
image: 'https://i.guim.co.uk/img/media/d8755abe62a318b62e2736b98383bf11762d6c91/0_0_2562_2562/master/2562.jpg?width=620&dpr=2&s=none&crop=none',
31-
url: 'https://go.skimresources.com/?id=114047X1572903&url=https%3A%2F%2Fwww.waitrose.com%2Fecom%2Fproducts%2Fkenko-mayonnaise%2F424830-807548-807549&sref=https://www.theguardian.com/thefilter/2025/jun/07/best-supermarket-mayonnaise-tom-hunt&xcust=referrer%7Cwww.theguardian.com%7CaccountId%7C114047X1572903',
32-
price: '£4.40',
33-
retailer: 'Waitrose',
34-
brandName: 'Kenko',
35-
productName: 'Japanese mayonnaise',
30+
format,
31+
brandName: 'AirCraft',
32+
productName: 'Lume',
33+
image: 'https://media.guim.co.uk/ed32f52c10d742be18c4ff1b218dce611e71f57e/500_0_3000_3000/master/3000.jpg',
34+
primaryCta: 'Buy at AirCraft',
35+
primaryUrl: 'https://www.aircraft.com/lume',
36+
primaryPrice: '£199.99',
3637
statistics: [
38+
{ name: 'We love', value: 'It packs away pretty small' },
3739
{
38-
name: 'Rating',
39-
value: '4.8/5',
40-
},
41-
{
42-
name: 'Taste',
43-
value: 'sweet, sour, salty and has an umami-rich profile',
40+
name: 'We dont love',
41+
value: 'there’s nowhere to stow the remote control',
4442
},
4543
],
46-
format,
4744
};
4845

4946
export const Default = () => <LeftColProductCard {...sampleProductCard} />;

dotcom-rendering/src/components/LeftColProductCard.tsx

Lines changed: 19 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {
33
from,
44
headlineMedium17,
55
space,
6-
textSans14,
6+
textSans15,
77
textSans17,
88
} from '@guardian/source/foundations';
99
import type { ArticleFormat } from '../lib/articleFormat';
@@ -20,9 +20,9 @@ export type LeftColProductCardProps = {
2020
brandName: string;
2121
productName: string;
2222
image: string;
23-
url: string;
24-
price: string;
25-
retailer: string;
23+
primaryCta: string;
24+
primaryUrl: string;
25+
primaryPrice: string;
2626
statistics: Statistics[];
2727
format: ArticleFormat;
2828
};
@@ -34,13 +34,12 @@ const card = css`
3434
position: sticky;
3535
display: block;
3636
margin-top: 10px;
37-
padding: 10px;
3837
width: 220px;
3938
border-top: 1px solid ${palette('--section-border-lifestyle')};
4039
}
4140
img {
42-
height: 200px;
43-
width: 200px;
41+
height: 220px;
42+
width: 220px;
4443
}
4544
strong {
4645
font-weight: 700;
@@ -50,7 +49,7 @@ const card = css`
5049
const productInfoContainer = css`
5150
display: grid;
5251
row-gap: ${space[1]}px;
53-
padding-bottom: ${space[2]}px;
52+
padding: 0 10px 8px 0;
5453
`;
5554

5655
const primaryHeading = css`
@@ -73,19 +72,21 @@ const buttonOverride = css`
7372
const statisticsContainer = css`
7473
border-top: 1px solid ${palette('--section-border')};
7574
padding-top: ${space[3]}px;
75+
padding-bottom: ${space[4]}px;
7676
display: grid;
77-
row-gap: ${space[2]}px;
77+
row-gap: ${space[3]}px;
7878
`;
7979

8080
const Statistic = ({ name, value }: Statistics) => (
8181
<div
8282
css={css`
83-
${textSans14};
83+
${textSans15};
8484
margin-top: 4px;
8585
`}
8686
>
87-
{name}:<br />
88-
<strong>{value}</strong>
87+
<strong>{name}</strong>
88+
<br />
89+
{value}
8990
</div>
9091
);
9192

@@ -95,9 +96,9 @@ export const LeftColProductCard = ({
9596
brandName,
9697
productName,
9798
image,
98-
url,
99-
price,
100-
retailer,
99+
primaryCta,
100+
primaryUrl,
101+
primaryPrice,
101102
statistics,
102103
format,
103104
}: LeftColProductCardProps) => (
@@ -117,29 +118,13 @@ export const LeftColProductCard = ({
117118
<div css={primaryHeading}>{brandName}</div>
118119
<div css={secondaryHeading}>{productName}</div>
119120
<div css={priceRowStyle}>
120-
<strong>{price}</strong> from{' '}
121-
<a
122-
css={css`
123-
color: ${palette('--article-text')};
124-
border-bottom: 1px solid
125-
${palette('--article-link-border')};
126-
text-decoration: none;
127-
:hover,
128-
:active {
129-
border-bottom: 1px solid
130-
${palette('--article-text')};
131-
}
132-
`}
133-
href={url}
134-
>
135-
{retailer}
136-
</a>
121+
<strong>{primaryPrice}</strong>
137122
</div>
138123
</div>
139124
<div css={buttonOverride}>
140125
<ProductLinkButton
141-
label={'Shop Now'}
142-
url={url}
126+
label={primaryCta}
127+
url={primaryUrl}
143128
size={'small'}
144129
cssOverrides={css`
145130
min-width: 100%;

dotcom-rendering/src/components/ProductElement.stories.tsx

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,23 +39,18 @@ const product: ProductBlockElement = {
3939
primaryProductUrl: 'https://www.aircraft.com/lume',
4040
primaryPrice: '£199.99',
4141
primaryRetailer: 'AirCraft',
42-
primaryCta: '£199.99 at AirCraft',
42+
primaryCta: 'Buy at AirCraft',
4343
starRating: 'none-selected',
4444
secondaryProductUrl:
4545
'https://www.amazon.co.uk/Devola-16-Inch-Desk-Fan/dp/B0B3Z9K5XH?tag=theguardianbookshop-21&ascsubtag=trd-10001-1b2f-00000-00000-a0000-00000-00000-00000',
4646
secondaryCta: '£132.99 at Amazon',
4747
secondaryPrice: '£132.99',
4848
secondaryRetailer: 'Amazon',
4949
statistics: [
50-
{ name: 'Style', value: 'Pedestal (or desk)' },
51-
{ name: 'Dimensions', value: '37 x 28 x 95cm (WDH)' },
52-
{ name: 'Number of speeds', value: '12' },
53-
{ name: 'Remote control', value: 'Yes' },
54-
{ name: 'Peak noise level on test', value: '55dB' },
55-
{ name: 'Power use on top setting', value: '18W' },
50+
{ name: 'We love', value: 'It packs away pretty small' },
5651
{
57-
name: 'Air speed on top setting',
58-
value: '5.9 metres a second (m/s)',
52+
name: 'We dont love',
53+
value: 'there’s nowhere to stow the remote control',
5954
},
6055
],
6156
content: [

dotcom-rendering/src/components/ProductElement.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@ export const ProductElement = ({
7777
brandName={product.brandName}
7878
productName={product.productName}
7979
image={product.image.url}
80-
url={product.primaryProductUrl}
81-
price={product.primaryPrice}
82-
retailer={product.primaryRetailer}
80+
primaryUrl={product.primaryProductUrl}
81+
primaryPrice={product.primaryPrice}
82+
primaryCta={product.primaryCta}
8383
statistics={product.statistics}
8484
format={format}
8585
/>

0 commit comments

Comments
 (0)