Skip to content

Conversation

marjisound
Copy link
Contributor

@marjisound marjisound commented Aug 13, 2025

Co-authored-by: Dina Hafez [email protected]

What does this change?

This PR adds logic to insert ads in galleries after every fourth image for App. It is a continuation of the previous work on ads for galleries: #14299.

We use the enhanceAdPlaceholders to ensure consistency with how ads are added to other articles in the app.

Since the same logic is required for both Web and App, for the web we also rely on the enhancer’s output, which adds ad placeholders to the article element list.

iOS:

Screen.Recording.2025-08-13.at.10.12.22.mov

Web:

Screen.Recording.2025-08-13.at.10.17.55.mov

This PR fixes part of #12293

Copy link

Hello 👋! When you're ready to run Chromatic, please apply the run_chromatic label to this PR.

You will need to reapply the label each time you want to run Chromatic.

Click here to see the Chromatic project.

@marjisound marjisound changed the title Dina/ads in galleries dcar Add ads in galleries on both web and app Aug 13, 2025
@marjisound marjisound requested review from a team August 13, 2025 09:21
@marjisound marjisound linked an issue Aug 13, 2025 that may be closed by this pull request
Copy link
Member

@Jakeii Jakeii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! just one suggestion for a variable name

Copy link

github-actions bot commented Aug 18, 2025

Copy link
Contributor

@JamieB-gu JamieB-gu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, a few comments.

<Hide until="tablet">
<DesktopAdSlot
renderAds={renderAds}
adSlotIndex={index}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps not one for this PR, but @marjisound we may want to look at abstracting some of this layout file into sub-components? This function is now nearly 300 lines long and hitting 13 levels of indentation in some places, which may make it difficult to read and understand, particularly when looking at a diff?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe it's always better to have less lines of code in a function and refactor when needed but I second you regarding that could be in a separate PR.

@deedeeh
Copy link
Contributor

deedeeh commented Aug 18, 2025

Looks good, a few comments.

Thank you @JamieB-gu for you review 🙏🏼 I addressed your comments.

@deedeeh deedeeh requested a review from JamieB-gu August 18, 2025 15:07
@deedeeh deedeeh added Commercial 💰 run_chromatic Runs chromatic when label is applied labels Aug 19, 2025
@github-actions github-actions bot removed the run_chromatic Runs chromatic when label is applied label Aug 19, 2025
@deedeeh deedeeh merged commit 22ff26d into main Aug 19, 2025
34 checks passed
@deedeeh deedeeh deleted the dina/ads-in-galleries-dcar branch August 19, 2025 08:08
@gu-prout
Copy link

gu-prout bot commented Aug 19, 2025

Seen on PROD (created by @marjisound and merged by @deedeeh 9 minutes and 1 second ago) Please check your changes!

@marjisound marjisound mentioned this pull request Aug 22, 2025
15 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Include Ads On Galleries
4 participants