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
Implment the GA promo banner in /stats #77037
Conversation
Here is how your PR affects size of JS and CSS bundles shipped to the user's browser: App Entrypoints (~37 bytes added 📈 [gzipped])
Common code that is always downloaded and parsed every time the app is loaded, no matter which route is used. Sections (~1137 bytes added 📈 [gzipped])
Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to. Async-loaded Components (~925 bytes removed 📉 [gzipped])
React components that are loaded lazily, when a certain part of UI is displayed for the first time. Legend What is parsed and gzip size?Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory. Generated by performance advisor bot at iscalypsofastyet.com. |
5126850
to
67494e7
Compare
and use it in the mini carousell component.
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.
Works well! I left some minor code comments below.
Regarding the auto-scroll, I feel the scrolling should pause if the mouse is within the banner area, and this feature is present in most carousel implementations. I'm not sure of the dev-lift to implement this, so please consider this a non-blocking comment.
|
||
return () => clearTimeout( timerId ); | ||
} | ||
}, [ currentPage ] ); |
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.
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.
Added in bd2b441. I think I need to update my linter :)
@@ -97,6 +98,16 @@ export const DotPager = ( { | |||
} | |||
}, [ numPages, currentPage ] ); | |||
|
|||
useEffect( () => { | |||
if ( rotateTime > 0 ) { |
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.
Small optimization: We can run the following lines only if numPages > 1
.
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.
Good call. Added in bd2b441
when there are more than 1 page.
Great suggestion, @aneeshd16 . For this PR, I'll deploy it as it is; the pause-on-hovering functionality is tracked here: #77837 and will be worked on separately :) |
This Pull Request is now available for translation here: https://translate.wordpress.com/deliverables/8028455 Hi @southp, could you please edit the description of this PR and add a screenshot for our translators? Ideally it'd include this string: Thank you in advance! |
Translation for this Pull Request has now been finished. |
Fixes to Automattic/martech#1718
Proposed Changes
This PR implements the requested changes in the linked issue above regarding the banner carousell in
/stats
:The automatical rotation mechanism is lifted into the underlying
<DotPager>
component, since it's a general functionality that the rest of the codebase can be benefited from as well.Screencast:
2023-06-05.2.12.34.mov
Testing Instructions
/stats
and confirm that the GA promo banner exists./stats
and confirm that the GA promo banner exists.Pre-merge Checklist