-
Notifications
You must be signed in to change notification settings - Fork 2k
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
AddOns: new design for the storage add-ons card #99433
Conversation
Jetpack Cloud live (direct link)
Automattic for Agencies live (direct link)
|
414725b
to
0fdc665
Compare
|
||
export const getAddOnsList = (): AddOnMeta[] => { |
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.
This function created a new array on every call. I have moved the array outside the function's scope so that the same reference is passed as the return value.
const productSlugs = useMemo( | ||
() => addOnMetas.map( ( { productSlug } ) => productSlug ), | ||
[ addOnMetas ] | ||
); |
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.
.map
creates a new array on every call. So the useMemo
function below, which uses productSlugs
as a dependency, could not memoize the return value since the reference changed on every render.
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.
0fdc665
to
44de9c7
Compare
This PR modifies the release build for the following Calypso Apps: For info about this notification, see here: PCYsg-OT6-p2
To test WordPress.com changes, run |
Here is how your PR affects size of JS and CSS bundles shipped to the user's browser: App Entrypoints (~256 bytes added 📈 [gzipped])
Common code that is always downloaded and parsed every time the app is loaded, no matter which route is used. Sections (~10467 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 (~8 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. |
44de9c7
to
7eb2a1a
Compare
7eb2a1a
to
cf14f6e
Compare
This Pull Request is now available for translation here: https://translate.wordpress.com/deliverables/17235217 Some locales (Hebrew, Japanese) have been temporarily machine-translated due to translator availability. All other translations are usually ready within a few days. Untranslated and machine-translated strings will be sent for translation next Monday and are expected to be completed by the following Friday. Thank you @aneeshd16 for including a screenshot in the description! This is really helpful for our translators. |
Translation for this Pull Request has now been finished. |
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.
Tests well and the code changes LGTM.
Fixes https://github.com/Automattic/martech/issues/3677
Fixes #95416
Proposed Changes
Why are these changes being made?
Testing Instructions
/add-ons/<site slug>
.Select any add-on from the list. Note the price mentioned - this should be the same as the price shown on the checkout page. (Monthly price * 12). Click on the "Buy add-on" button.
In the following examples, the 200GB add-on has been purchased.
Go back to
/add-ons/<site slug>
.Confirm that the space used is
203GB
. (200GB + 53GB platform default) (The site is on a Business plan)Confirm that the dropdown values only contain add-ons till 150GB. (Since the maximum storage possible is 400GB).
The dropdown and CTA should not be shown if the maximum storage has been purchased.
Pre-merge Checklist