Skip to content

Commit 22383f4

Browse files
committed
add image story
1 parent 12ed628 commit 22383f4

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

dotcom-rendering/src/components/Masthead/Titlepiece/CustomSubNav.stories.tsx

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,31 @@ const customSubNav: CustomSubnav = {
3333
pages: [],
3434
};
3535

36+
/** Distinct images per breakpoint so it's obvious which one is being served. */
37+
const customSubNavWithImages: CustomSubnav = {
38+
...customSubNav,
39+
images: [
40+
{
41+
breakpoint: 'mobile',
42+
platforms: ['web'],
43+
imageSrc:
44+
'https://media.guim.co.uk/6537e163c9164d25ec6102641f6a04fa5ba76560/0_210_5472_3283/master/5472.jpg?width=740&height=140&quality=85&fit=crop&s=none',
45+
},
46+
{
47+
breakpoint: 'tablet',
48+
platforms: ['web'],
49+
imageSrc:
50+
'https://media.guim.co.uk/56b42eef576bc04c820da710459acd91082bb37b/0_0_6720_4480/6720.jpg?width=980&height=140&quality=85&fit=crop&s=none',
51+
},
52+
{
53+
breakpoint: 'desktop',
54+
platforms: ['web'],
55+
imageSrc:
56+
'https://media.guim.co.uk/c981848745e482e03e23b2ec9402e1f5c5bee6a6/102_73_3282_1848/2000.jpg?width=1300&height=140&quality=85&fit=crop&s=none',
57+
},
58+
],
59+
};
60+
3661
const meta = {
3762
component: CustomSubNav,
3863
title: 'Components/Masthead/Titlepiece/CustomSubNav',
@@ -64,6 +89,14 @@ export const Front = {
6489
args: { renderingPage: 'front' },
6590
} satisfies Story;
6691

92+
/** On fronts, a web image is shown per breakpoint; resize the viewport to switch between mobile/tablet/desktop. */
93+
export const FrontWithImage = {
94+
args: {
95+
renderingPage: 'front',
96+
customSubNav: customSubNavWithImages,
97+
},
98+
} satisfies Story;
99+
67100
export const Article = {
68101
args: { renderingPage: 'article' },
69102
parameters: {

0 commit comments

Comments
 (0)