Skip to content

Commit

Permalink
Remove unused media meta components and styles
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesmockett committed Dec 23, 2024
1 parent 3dc0ffa commit 02e45c9
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 57 deletions.
2 changes: 1 addition & 1 deletion dotcom-rendering/src/components/Card/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ export const Card = ({
const showPlayIcon =
mainMedia?.type === 'Video' && !canPlayInline && showMainVideo;

// Check media type to determine if we should show a pill or media icon
// Check media type to determine if we show a pill or article metadata
const showPill =
mainMedia?.type === 'Audio' || mainMedia?.type === 'Gallery';

Expand Down
56 changes: 0 additions & 56 deletions dotcom-rendering/src/components/MediaMeta.tsx
Original file line number Diff line number Diff line change
@@ -1,44 +1,10 @@
import { css } from '@emotion/react';
import {
SvgAudio,
SvgCamera,
SvgVideo,
} from '@guardian/source/react-components';
import { palette as themePalette } from '../palette';
import type { MediaType } from '../types/layout';

type Props = {
mediaType: MediaType;
hasKicker: boolean;
};

const iconWrapperStyles = (hasKicker: boolean) => css`
width: 24px;
height: 24px;
/* We’re using the text colour for the icon badge */
background-color: ${hasKicker
? themePalette('--card-kicker-text')
: themePalette('--card-footer-text')};
border-radius: 50%;
display: inline-block;
> svg {
width: 20px;
height: 20px;
margin-left: auto;
margin-right: auto;
margin-top: 2px;
display: block;
fill: ${themePalette('--card-media-icon')};
}
`;

const wrapperStyles = css`
display: flex;
align-items: center;
margin-top: 4px;
`;

export const Icon = ({ mediaType }: { mediaType: MediaType }) => {
switch (mediaType) {
case 'Gallery':
Expand All @@ -49,25 +15,3 @@ export const Icon = ({ mediaType }: { mediaType: MediaType }) => {
return <SvgAudio />;
}
};

const MediaIcon = ({
mediaType,
hasKicker,
}: {
mediaType: MediaType;
hasKicker: boolean;
}) => {
return (
<span css={iconWrapperStyles(hasKicker)}>
<Icon mediaType={mediaType} />
</span>
);
};

export const MediaMeta = ({ mediaType, hasKicker }: Props) => {
return (
<div css={wrapperStyles}>
<MediaIcon mediaType={mediaType} hasKicker={hasKicker} />
</div>
);
};

0 comments on commit 02e45c9

Please sign in to comment.