Add ads in galleries on both web and app#14396
Conversation
Co-authored-by: Marjan Kalanaki <marjan.kalanaki@guardian.co.uk>
|
Hello 👋! When you're ready to run Chromatic, please apply the You will need to reapply the label each time you want to run Chromatic. |
Jakeii
left a comment
There was a problem hiding this comment.
Looks great! just one suggestion for a variable name
JamieB-gu
left a comment
There was a problem hiding this comment.
Looks good, a few comments.
| <Hide until="tablet"> | ||
| <DesktopAdSlot | ||
| renderAds={renderAds} | ||
| adSlotIndex={index} |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
Thank you @JamieB-gu for you review 🙏🏼 I addressed your comments. |
|
Seen on PROD (created by @marjisound and merged by @deedeeh 9 minutes and 1 second ago) Please check your changes! |
Co-authored-by: Dina Hafez dina.hafez@guardian.co.uk
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
enhanceAdPlaceholdersto 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