Skip to content

Commit 4ace7ea

Browse files
authored
Merge pull request #13600 from guardian/doml/maybe-remove-grey-box
Don't show Card grey bounding box when no image
2 parents dbcc619 + 1eda515 commit 4ace7ea

File tree

2 files changed

+57
-2
lines changed

2 files changed

+57
-2
lines changed

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

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { css } from '@emotion/react';
2-
import { from } from '@guardian/source/foundations';
2+
import { breakpoints, from } from '@guardian/source/foundations';
33
import React from 'react';
44
import { splitTheme } from '../../../.storybook/decorators/splitThemeDecorator';
55
import {
@@ -208,6 +208,11 @@ export default {
208208
decorators: [
209209
splitTheme([basicCardProps.format], { orientation: 'vertical' }),
210210
],
211+
parameters: {
212+
chromatic: {
213+
viewports: [breakpoints.mobile, breakpoints.wide],
214+
},
215+
},
211216
};
212217

213218
/** TODO : Update stories once initial chromatic check has passed on new font size scale */
@@ -1714,3 +1719,51 @@ export const WithAVerticalGapWhenScrollableSmallContainer = () => {
17141719
</>
17151720
);
17161721
};
1722+
1723+
export const WithBetaContainerAndSublinks = () => {
1724+
return (
1725+
<CardGroup>
1726+
{/* With an image */}
1727+
<CardWrapper>
1728+
<Card
1729+
{...basicCardProps}
1730+
image={undefined}
1731+
containerType="flexible/general"
1732+
imagePositionOnMobile="bottom"
1733+
supportingContent={[
1734+
{
1735+
...aBasicLink,
1736+
headline: 'Headline 1',
1737+
kickerText: 'Kicker',
1738+
},
1739+
{
1740+
...aBasicLink,
1741+
headline: 'Headline 2',
1742+
kickerText: 'Kicker',
1743+
},
1744+
]}
1745+
/>
1746+
</CardWrapper>
1747+
{/* Without an image */}
1748+
<CardWrapper>
1749+
<Card
1750+
{...basicCardProps}
1751+
containerType="flexible/general"
1752+
imagePositionOnMobile="bottom"
1753+
supportingContent={[
1754+
{
1755+
...aBasicLink,
1756+
headline: 'Headline 1',
1757+
kickerText: 'Kicker',
1758+
},
1759+
{
1760+
...aBasicLink,
1761+
headline: 'Headline 2',
1762+
kickerText: 'Kicker',
1763+
},
1764+
]}
1765+
/>
1766+
</CardWrapper>
1767+
</CardGroup>
1768+
);
1769+
};

dotcom-rendering/src/components/Card/Card.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,9 @@ export const Card = ({
693693
isDynamo={isDynamo}
694694
fillBackgroundOnMobile={
695695
!!isFlexSplash ||
696-
(isBetaContainer && imagePositionOnMobile === 'bottom')
696+
(isBetaContainer &&
697+
!!image &&
698+
imagePositionOnMobile === 'bottom')
697699
}
698700
/>
699701
);

0 commit comments

Comments
 (0)