Skip to content

Commit 514270d

Browse files
Merge branch 'latest' into WS-2234-address-new-nav-a11y-bugs
2 parents a876e49 + 69ab055 commit 514270d

File tree

10 files changed

+2211
-67
lines changed

10 files changed

+2211
-67
lines changed

scripts/bundleSize/bundleSizeConfig.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@
1010
export const VARIANCE = 5;
1111

1212
export const MIN_SIZE = 939;
13-
export const MAX_SIZE = 1303;
13+
export const MAX_SIZE = 1309;

src/app/legacy/containers/PodcastPromo/Inline.jsx

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ const StyledCardLink = styled(PromoComponent.Card.Link)`
145145
}
146146
`;
147147

148-
const StyledPodcastIconWrapper = styled.div`
148+
const StyledInArticlePromoIconWrapper = styled.div`
149149
position: absolute;
150150
float: bottom;
151151
transform: translateY(-100%);
@@ -162,10 +162,23 @@ const StyledPodcastIconWrapper = styled.div`
162162
}
163163
`;
164164

165+
const icons = {
166+
podcast: mediaIcons.podcast,
167+
youtube: mediaIcons.youtube,
168+
whatsapp: mediaIcons.whatsapp,
169+
};
170+
171+
const getIconFromUrl = url => {
172+
const match = Object.keys(icons).find(key =>
173+
url?.toLowerCase().includes(key),
174+
);
175+
176+
return icons[match] || mediaIcons.communication;
177+
};
178+
165179
const Promo = () => {
166180
const { podcastPromo, dir } = use(ServiceContext);
167181
const { pageType, isLite } = use(RequestContext);
168-
169182
const {
170183
podcastPromoTitle,
171184
podcastBrandTitle,
@@ -201,6 +214,8 @@ const Promo = () => {
201214
'%title%': podcastPromoTitle,
202215
};
203216

217+
const promoIcon = getIconFromUrl(url);
218+
204219
return (
205220
<ResponsivePodcastPromoWrapper
206221
{...viewTrackerRef}
@@ -228,12 +243,12 @@ const Promo = () => {
228243
lazyLoad
229244
/>
230245
</StyledImageWrapper>
231-
<StyledPodcastIconWrapper
246+
<StyledInArticlePromoIconWrapper
232247
className="podcastIconWrapper"
233248
isOptimo={pageType === ARTICLE_PAGE}
234249
>
235-
{mediaIcons.podcast}
236-
</StyledPodcastIconWrapper>
250+
{promoIcon}
251+
</StyledInArticlePromoIconWrapper>
237252
<StyledCardContentWrapper>
238253
<strong>
239254
<StyledCardLink href={url} {...clickTrackerRef}>

0 commit comments

Comments
 (0)