Skip to content

Commit 8dd7b42

Browse files
committed
Add camera and video icon to galleries caption
1 parent 890a0ca commit 8dd7b42

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

dotcom-rendering/src/components/Caption.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ type Props = {
3535

3636
type IconProps = {
3737
format: ArticleFormat;
38+
isMainMedia: boolean;
3839
};
3940

4041
const captionStyle = (isMainMedia: boolean) => css`
@@ -169,8 +170,10 @@ const hideIconBelowLeftCol = css`
169170
const pictureRatio = (13 / 18) * 100;
170171
const videoRatio = (23 / 36) * 100;
171172

172-
const iconStyle = css`
173-
fill: ${palette('--caption-text')};
173+
const iconStyle = (format: ArticleFormat, isMainMedia: boolean) => css`
174+
fill: ${format.design === ArticleDesign.Gallery && isMainMedia
175+
? palette('--caption-main-media-text')
176+
: palette('--caption-text')};
174177
margin-right: ${space[1]}px;
175178
display: inline-block;
176179
position: relative;
@@ -262,11 +265,11 @@ const CameraIcon = ({ format }: IconProps) => {
262265
);
263266
};
264267

265-
const VideoIcon = ({ format }: IconProps) => {
268+
const VideoIcon = ({ format, isMainMedia }: IconProps) => {
266269
return (
267270
<span
268271
css={[
269-
iconStyle,
272+
iconStyle(format, isMainMedia),
270273
format.display === ArticleDisplay.Immersive &&
271274
hideIconBelowLeftCol,
272275
videoIconStyle,

0 commit comments

Comments
 (0)