Skip to content

Commit 8ae44f4

Browse files
committed
tweak story and mobile image height
1 parent eb13822 commit 8ae44f4

2 files changed

Lines changed: 21 additions & 11 deletions

File tree

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

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -62,16 +62,22 @@ const meta = {
6262
component: CustomSubNav,
6363
title: 'Components/Masthead/Titlepiece/CustomSubNav',
6464
decorators: [
65-
(Story) => (
66-
<div
67-
css={css`
68-
background-color: ${sourcePalette.brand[400]};
69-
padding: ${space[3]}px;
70-
`}
71-
>
72-
<Story />
73-
</div>
74-
),
65+
(Story, context) => {
66+
const hasImage =
67+
(context.args.customSubNav.images?.length ?? 0) > 0;
68+
return (
69+
<div
70+
css={css`
71+
background-color: ${hasImage
72+
? sourcePalette.neutral[100]
73+
: sourcePalette.brand[400]};
74+
padding: ${hasImage ? 0 : space[2]}px;
75+
`}
76+
>
77+
<Story />
78+
</div>
79+
);
80+
},
7581
],
7682
render: (args) => <CustomSubNav {...args} />,
7783
args: {

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,12 @@ const imageWrapperStyles = css`
118118
const headerImageStyles = css`
119119
display: block;
120120
width: 100%;
121-
height: 140px;
121+
height: 210px;
122122
object-fit: cover;
123+
124+
${from.tablet} {
125+
height: 140px;
126+
}
123127
`;
124128

125129
const imageHeaderTextStyles = css`

0 commit comments

Comments
 (0)