Skip to content

Commit 4a1d168

Browse files
committed
Prevent Waveform from encroaching sublinks
1 parent 17939b2 commit 4a1d168

File tree

2 files changed

+60
-40
lines changed

2 files changed

+60
-40
lines changed

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

Lines changed: 59 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ import {
99
Pillar,
1010
} from '../../lib/articleFormat';
1111
import type { Branding } from '../../types/branding';
12-
import type { DCRContainerPalette } from '../../types/front';
12+
import type {
13+
DCRContainerPalette,
14+
DCRSupportingContent,
15+
} from '../../types/front';
1316
import type { MainMedia } from '../../types/mainMedia';
1417
import { ContainerOverrides } from '../ContainerOverrides';
1518
import { FrontSection } from '../FrontSection';
@@ -80,6 +83,19 @@ const mainGallery: MainMedia = {
8083
count: '5',
8184
};
8285

86+
const twoSublinks: DCRSupportingContent[] = [
87+
{
88+
...aBasicLink,
89+
headline: 'Headline 1',
90+
kickerText: 'Kicker',
91+
},
92+
{
93+
...aBasicLink,
94+
headline: 'Headline 2',
95+
kickerText: 'Kicker',
96+
},
97+
];
98+
8399
const CardWrapper = ({ children }: { children: React.ReactNode }) => {
84100
return (
85101
<div
@@ -345,23 +361,48 @@ export const WithMediaTypeAndSublinks = () => {
345361
design: ArticleDesign.Video,
346362
theme: Pillar.Sport,
347363
}}
348-
containerType="flexible/general"
349364
mainMedia={{ ...mainVideo, duration: 30 }}
350365
headlineText="Video"
351-
imagePositionOnDesktop="top"
352-
imagePositionOnMobile="left"
353-
supportingContent={[
354-
{
355-
...aBasicLink,
356-
headline: 'Headline 1',
357-
kickerText: 'Kicker',
358-
},
359-
{
360-
...aBasicLink,
361-
headline: 'Headline 2',
362-
kickerText: 'Kicker',
363-
},
364-
]}
366+
supportingContent={twoSublinks}
367+
/>
368+
</CardWrapper>
369+
<CardWrapper>
370+
<Card
371+
{...basicCardProps}
372+
format={{
373+
display: ArticleDisplay.Standard,
374+
design: ArticleDesign.Video,
375+
theme: Pillar.Sport,
376+
}}
377+
mainMedia={{ ...mainVideo, duration: 0 }}
378+
headlineText="Video without duration"
379+
supportingContent={twoSublinks}
380+
/>
381+
</CardWrapper>
382+
<CardWrapper>
383+
<Card
384+
{...basicCardProps}
385+
format={{
386+
display: ArticleDisplay.Standard,
387+
design: ArticleDesign.Audio,
388+
theme: Pillar.Sport,
389+
}}
390+
mainMedia={mainAudio}
391+
headlineText="Audio"
392+
supportingContent={twoSublinks}
393+
/>
394+
</CardWrapper>
395+
<CardWrapper>
396+
<Card
397+
{...basicCardProps}
398+
format={{
399+
display: ArticleDisplay.Standard,
400+
design: ArticleDesign.Gallery,
401+
theme: Pillar.Sport,
402+
}}
403+
mainMedia={mainGallery}
404+
headlineText="Gallery"
405+
supportingContent={twoSublinks}
365406
/>
366407
</CardWrapper>
367408
</CardGroup>
@@ -1764,18 +1805,7 @@ export const WithBetaContainerAndSublinks = () => {
17641805
{...basicCardProps}
17651806
containerType="flexible/general"
17661807
imagePositionOnMobile="bottom"
1767-
supportingContent={[
1768-
{
1769-
...aBasicLink,
1770-
headline: 'Headline 1',
1771-
kickerText: 'Kicker',
1772-
},
1773-
{
1774-
...aBasicLink,
1775-
headline: 'Headline 2',
1776-
kickerText: 'Kicker',
1777-
},
1778-
]}
1808+
supportingContent={twoSublinks}
17791809
/>
17801810
</CardWrapper>
17811811
</CardGroup>
@@ -1791,18 +1821,7 @@ export const WithBetaContainerAndSublinksNoImage = () => {
17911821
image={undefined}
17921822
containerType="flexible/general"
17931823
imagePositionOnMobile="bottom"
1794-
supportingContent={[
1795-
{
1796-
...aBasicLink,
1797-
headline: 'Headline 1',
1798-
kickerText: 'Kicker',
1799-
},
1800-
{
1801-
...aBasicLink,
1802-
headline: 'Headline 2',
1803-
kickerText: 'Kicker',
1804-
},
1805-
]}
1824+
supportingContent={twoSublinks}
18061825
/>
18071826
</CardWrapper>
18081827
</CardGroup>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ type Props = {
2323

2424
const containerStyles = css`
2525
display: flex;
26+
position: relative;
2627
flex-basis: 100%;
2728
`;
2829

0 commit comments

Comments
 (0)