Skip to content

Commit 3043806

Browse files
committed
Improve container around ScrollableHighlights story
1 parent ff00dc7 commit 3043806

File tree

1 file changed

+40
-14
lines changed

1 file changed

+40
-14
lines changed
Lines changed: 40 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,96 @@
11
import type { Meta, StoryObj } from '@storybook/react';
22
import { defaultCard, trails } from '../../fixtures/manual/highlights-trails';
33
import { ScrollableHighlights } from './ScrollableHighlights.importable';
4+
import { Section } from './Section';
45

5-
export default {
6+
const meta: Meta<typeof ScrollableHighlights> = {
67
title: 'Components/Masthead/ScrollableHighlights',
78
component: ScrollableHighlights,
8-
args: {
9-
trails,
10-
},
11-
} as Meta;
9+
render: ({ ...args }) => (
10+
<Section
11+
shouldCenter={true}
12+
showSideBorders={false}
13+
fullWidth={true}
14+
showTopBorder={false}
15+
padSides={false}
16+
element="section"
17+
>
18+
<ScrollableHighlights {...args} />
19+
</Section>
20+
),
21+
};
1222

23+
export default meta;
1324
type Story = StoryObj<typeof ScrollableHighlights>;
1425

15-
export const Default = {};
26+
export const Default = {
27+
args: {
28+
trails: trails.slice(0, 6),
29+
},
30+
};
31+
32+
export const withEightCards = {
33+
name: 'With Eight Cards',
34+
args: {
35+
trails,
36+
},
37+
};
1638

1739
export const withTwoLineKicker: Story = {
40+
...Default,
41+
name: 'With Two Line Kicker',
1842
args: {
1943
trails: [
2044
{
2145
...defaultCard,
2246
kickerText: 'UK Housing and Mortgages',
2347
},
24-
...trails,
48+
...Default.args.trails,
2549
],
2650
},
27-
name: 'With Two Line Kicker',
2851
};
2952

3053
export const withLiveKicker: Story = {
54+
...Default,
55+
name: 'With Live Kicker',
3156
args: {
3257
trails: [
3358
{
3459
...defaultCard,
3560
kickerText: 'Live',
3661
format: { display: 0, theme: 3, design: 11 },
3762
},
38-
...trails,
63+
...Default.args.trails,
3964
],
4065
},
41-
name: 'With Live Kicker',
4266
};
4367

4468
export const withFourLineHeadline: Story = {
69+
...Default,
70+
name: 'With Four Line Headline',
4571
args: {
4672
trails: [
4773
{
4874
...defaultCard,
4975
headline:
5076
'Really long headline to show what happens when it is long',
5177
},
52-
...trails,
78+
...Default.args.trails,
5379
],
5480
},
55-
name: 'With Four Line Headline',
5681
};
5782

5883
export const withExcessivleyLongHeadline: Story = {
84+
...Default,
85+
name: 'With Excessively Long Headline',
5986
args: {
6087
trails: [
6188
{
6289
...defaultCard,
6390
headline:
6491
'Really long headline to show what happens when there is a really long headline that we will never ever have but we should check how it looks anyway',
6592
},
66-
...trails,
93+
...Default.args.trails,
6794
],
6895
},
69-
name: 'With Four Line Headline',
7096
};

0 commit comments

Comments
 (0)