Skip to content

Commit 2cfcb53

Browse files
authored
Remove legacy media meta (#14123)
* Remove meda meta as this is no longer part of the design system and roll out pills to non-beta containers * Remove media icon from palette and container overrides as this is not used elsewhere. * Remove beta logic for duration pill on video cards so that only one pill is ever visible on a card * Show waveform on all audio cards * Use standard design in standard card story
1 parent 47f23d6 commit 2cfcb53

File tree

5 files changed

+23
-131
lines changed

5 files changed

+23
-131
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1565,7 +1565,7 @@ export const WithATinyGap = () => {
15651565
imagePositionOnDesktop="left"
15661566
format={{
15671567
display: ArticleDisplay.Standard,
1568-
design: ArticleDesign.Gallery,
1568+
design: ArticleDesign.Standard,
15691569
theme: Pillar.Sport,
15701570
}}
15711571
/>

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

Lines changed: 22 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ import { CardPicture } from '../CardPicture';
3838
import { Island } from '../Island';
3939
import { LatestLinks } from '../LatestLinks.importable';
4040
import { LoopVideo } from '../LoopVideo.importable';
41-
import { MediaMeta } from '../MediaMeta';
4241
import { Pill } from '../Pill';
4342
import { Slideshow } from '../Slideshow';
4443
import { SlideshowCarousel } from '../SlideshowCarousel.importable';
@@ -554,8 +553,7 @@ export const Card = ({
554553
- */
555554
const isMediaCardOrNewsletter = isMediaCard(format) || isNewsletter;
556555

557-
// Currently pills are only shown within beta containers.
558-
const showPill = isBetaContainer && isMediaCardOrNewsletter;
556+
const showPill = isMediaCardOrNewsletter;
559557

560558
const media = getMedia({
561559
imageUrl: image?.src,
@@ -799,15 +797,6 @@ export const Card = ({
799797
cardHasImage={!!image}
800798
/>
801799
) : null}
802-
{!showPill &&
803-
!!mainMedia &&
804-
mainMedia.type !== 'Video' &&
805-
mainMedia.type !== 'LoopVideo' && (
806-
<MediaMeta
807-
mediaType={mainMedia.type}
808-
hasKicker={!!kickerText}
809-
/>
810-
)}
811800
</div>
812801
)}
813802

@@ -825,7 +814,7 @@ export const Card = ({
825814
* Waveform for podcasts is absolutely positioned at bottom of
826815
* card, behind everything else
827816
*/}
828-
{isBetaContainer && mainMedia?.type === 'Audio' && (
817+
{mainMedia?.type === 'Audio' && (
829818
<div
830819
css={waveformWrapper(
831820
imagePositionOnMobile,
@@ -938,7 +927,6 @@ export const Card = ({
938927
}
939928
index={index}
940929
duration={
941-
isBetaContainer &&
942930
isVideoArticle
943931
? undefined
944932
: media.mainMedia
@@ -1027,28 +1015,26 @@ export const Card = ({
10271015
roundedCorners={isOnwardContent}
10281016
aspectRatio={aspectRatio}
10291017
/>
1030-
{(isVideoMainMedia ||
1031-
(isVideoArticle && !isBetaContainer)) &&
1032-
mainMedia.duration > 0 && (
1033-
<div
1034-
css={css`
1035-
position: absolute;
1036-
top: ${space[2]}px;
1037-
right: ${space[2]}px;
1038-
`}
1039-
>
1040-
<Pill
1041-
content={secondsToDuration(
1042-
mainMedia.duration,
1043-
)}
1044-
icon={
1045-
<SvgMediaControlsPlay
1046-
width={18}
1047-
/>
1048-
}
1049-
/>
1050-
</div>
1051-
)}
1018+
{isVideoMainMedia && mainMedia.duration > 0 && (
1019+
<div
1020+
css={css`
1021+
position: absolute;
1022+
top: ${space[2]}px;
1023+
right: ${space[2]}px;
1024+
`}
1025+
>
1026+
<Pill
1027+
content={secondsToDuration(
1028+
mainMedia.duration,
1029+
)}
1030+
icon={
1031+
<SvgMediaControlsPlay
1032+
width={18}
1033+
/>
1034+
}
1035+
/>
1036+
</div>
1037+
)}
10521038
</>
10531039
)}
10541040
{media.type === 'crossword' && (
@@ -1148,14 +1134,6 @@ export const Card = ({
11481134
cardHasImage={!!image}
11491135
/>
11501136
) : null}
1151-
{!showPill &&
1152-
!!mainMedia &&
1153-
mainMedia.type !== 'Video' && (
1154-
<MediaMeta
1155-
mediaType={mainMedia.type}
1156-
hasKicker={!!kickerText}
1157-
/>
1158-
)}
11591137
</HeadlineWrapper>
11601138
)}
11611139

dotcom-rendering/src/components/ContainerOverrides.tsx

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -585,11 +585,6 @@ const cardMediaBackgroundLight: ContainerFunction = (containerPalette) =>
585585
const cardMediaBackgroundDark: ContainerFunction = (containerPalette) =>
586586
transparentColour(cardHeadlineDark(containerPalette), 0.1);
587587

588-
const cardMediaIconLight: ContainerFunction = (containerPalette) =>
589-
cardBackgroundLight(containerPalette);
590-
const cardMediaIconDark: ContainerFunction = (containerPalette) =>
591-
cardBackgroundDark(containerPalette);
592-
593588
const cardMediaWaveformLight: ContainerFunction = (containerPalette) => {
594589
switch (containerPalette) {
595590
case 'InvestigationPalette':
@@ -1127,10 +1122,6 @@ const containerColours = {
11271122
light: cardMediaBackgroundLight,
11281123
dark: cardMediaBackgroundDark,
11291124
},
1130-
'--card-media-icon': {
1131-
light: cardMediaIconLight,
1132-
dark: cardMediaIconDark,
1133-
},
11341125
'--card-media-waveform': {
11351126
light: cardMediaWaveformLight,
11361127
dark: cardMediaWaveformDark,

dotcom-rendering/src/components/MediaMeta.tsx

Lines changed: 0 additions & 68 deletions
This file was deleted.

dotcom-rendering/src/paletteDeclarations.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2517,11 +2517,6 @@ const cardMediaBackgroundLight: PaletteFunction = () =>
25172517
const cardMediaBackgroundDark: PaletteFunction = () =>
25182518
sourcePalette.neutral[20];
25192519

2520-
const cardMediaIconLight: PaletteFunction = (format) =>
2521-
cardMediaBackgroundLight(format);
2522-
const cardMediaIconDark: PaletteFunction = (format) =>
2523-
cardMediaBackgroundDark(format);
2524-
25252520
const cardMediaWaveformLight: PaletteFunction = () => sourcePalette.neutral[86];
25262521
const cardMediaWaveformDark: PaletteFunction = () => sourcePalette.neutral[38];
25272522

@@ -6280,10 +6275,6 @@ const paletteColours = {
62806275
light: cardMediaBackgroundLight,
62816276
dark: cardMediaBackgroundDark,
62826277
},
6283-
'--card-media-icon': {
6284-
light: cardMediaIconLight,
6285-
dark: cardMediaIconDark,
6286-
},
62876278
'--card-media-sublinks-background': {
62886279
light: cardMediaSublinksBackgroundLight,
62896280
dark: cardMediaSublinksBackgroundDark,

0 commit comments

Comments
 (0)