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 18, 2024
1 parent 9d662c8 commit aea75a3
Showing 1 changed file with 0 additions and 56 deletions.
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 aea75a3

Please sign in to comment.