-
Notifications
You must be signed in to change notification settings - Fork 30
Add new dispatch event for when no banner is rendered #15053
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
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. |
b9fb250 to
e2d2fdc
Compare
…anner is rendered - adding logic inside of useEffect before returning to prevent lint error
…- wait for pickMessage to complete first before dispatching banner:none
e2d2fdc to
73fdc09
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, I can see introducing hasPickMessageCompleted provides precise control over when to dispatch 'banner:none' and ensures the event only fires once banner selection is truly complete so there's no premature dispatch during initial rendering, looks good 👍
What does this change?
Adds custom event dispatching to the
StickyBottomBannercomponent to signal banner state to the commercial bundle:banner:none- Fired when no banner is selected to displayThese events are dispatched via
document.dispatchEvent()and can be listened to by the commercial bundle to control when mobile sticky ads should show.Why?
The commercial team needs to coordinate mobile sticky ad placement with reader revenue banners. Mobile sticky ads should only show when:
banner:close)banner:none)This prevents ads from showing up in the DOM and going against google ad policy
Related to guardian/commercial#2351 which implements the listening logic.