Skip to content

Commit 8225a93

Browse files
committed
Code tidy, added comment
1 parent 242a131 commit 8225a93

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

dotcom-rendering/src/layouts/FrontLayout.tsx

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,14 @@ export const FrontLayout = ({ front, NAV }: Props) => {
136136

137137
const { absoluteServerTimes = false } = front.config.switches;
138138

139-
const isInOpinionNoAvatarVariant =
140-
abTests.opinionNoAvatarVariant === 'variant' && front.isNetworkFront;
139+
/**
140+
* We are running an AB test which replaces the avatar for the card image
141+
* in the Opinion and More opinion collections on network fronts.
142+
*/
143+
const isInOpinionNoAvatarVariant = (collectionName: string) =>
144+
abTests.opinionNoAvatarVariant === 'variant' &&
145+
front.isNetworkFront &&
146+
(collectionName === 'Opinion' || collectionName === 'More opinion');
141147

142148
const fallbackAspectRatio = (collectionType: DCRContainerType) => {
143149
switch (collectionType) {
@@ -637,12 +643,9 @@ export const FrontLayout = ({ front, NAV }: Props) => {
637643
sectionId={ophanName}
638644
collectionId={index + 1}
639645
containerLevel={collection.containerLevel}
640-
isInOpinionNoAvatarVariant={
641-
(collection.displayName === 'Opinion' ||
642-
collection.displayName ===
643-
'More opinion') &&
644-
isInOpinionNoAvatarVariant
645-
}
646+
isInOpinionNoAvatarVariant={isInOpinionNoAvatarVariant(
647+
collection.displayName,
648+
)}
646649
/>
647650
</FrontSection>
648651

0 commit comments

Comments
 (0)