Skip to content

Commit 0a1ca60

Browse files
committed
Remove unnecessary hideMediaOverlay prop
1 parent 8064164 commit 0a1ca60

File tree

2 files changed

+15
-26
lines changed

2 files changed

+15
-26
lines changed

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -917,7 +917,6 @@ export const Card = ({
917917
mediaType={media.type}
918918
mediaPositionOnDesktop={mediaPositionOnDesktop}
919919
mediaPositionOnMobile={mediaPositionOnMobile}
920-
hideMediaOverlay={media.type === 'slideshow'}
921920
padMedia={isMediaCardOrNewsletter && isBetaContainer}
922921
isBetaContainer={isBetaContainer}
923922
isSmallCard={isSmallCard}

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

Lines changed: 15 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,6 @@ type Props = {
3232
mediaType?: CardMediaType;
3333
mediaPositionOnDesktop: MediaPositionType;
3434
mediaPositionOnMobile: MediaPositionType;
35-
/**
36-
* Forces hiding the image overlay added to pictures & slideshows on hover.
37-
* This is to allow hiding the overlay on slideshow carousels where we don't
38-
* want it to be shown whilst retaining it for existing slideshows.
39-
*/
40-
hideMediaOverlay?: boolean;
4135
isBetaContainer: boolean;
4236
isSmallCard: boolean;
4337
padMedia?: boolean;
@@ -207,7 +201,6 @@ export const MediaWrapper = ({
207201
mediaType,
208202
mediaPositionOnDesktop,
209203
mediaPositionOnMobile,
210-
hideMediaOverlay,
211204
isBetaContainer,
212205
isSmallCard,
213206
padMedia,
@@ -274,25 +267,22 @@ export const MediaWrapper = ({
274267
<>
275268
{children}
276269
{/* This overlay is styled when the CardLink is hovered */}
277-
{(mediaType === 'picture' ||
278-
mediaType === 'slideshow' ||
279-
mediaType === 'cinemagraph') &&
280-
!hideMediaOverlay && (
281-
<div
282-
css={[
283-
mediaOverlayContainerStyles,
284-
padMedia &&
285-
mediaPaddingStyles(
286-
mediaPositionOnDesktop,
287-
mediaPositionOnMobile,
288-
),
289-
]}
290-
>
291-
{/* This child div is needed as the hover background colour covers the padded
270+
{(mediaType === 'picture' || mediaType === 'cinemagraph') && (
271+
<div
272+
css={[
273+
mediaOverlayContainerStyles,
274+
padMedia &&
275+
mediaPaddingStyles(
276+
mediaPositionOnDesktop,
277+
mediaPositionOnMobile,
278+
),
279+
]}
280+
>
281+
{/* This child div is needed as the hover background colour covers the padded
292282
area around the image when the hover styles are applied to the top-level div */}
293-
<div className="media-overlay" />
294-
</div>
295-
)}
283+
<div className="media-overlay" />
284+
</div>
285+
)}
296286
</>
297287
</div>
298288
);

0 commit comments

Comments
 (0)