A4A: Replace Marketpalce 'Add to cart' to 'Add to referral' button when in referral mode.
During referral mode, the CTA button on the product card should display 'Add to referral' instead of 'Add to cart'. This PR fixes this.
| Regular | Referral mode |
|---|---|
Depends on https://github.com/Automattic/wp-calypso/pull/91090 Closes https://github.com/Automattic/automattic-for-agencies-dev/issues/527
Proposed Changes
- Add new 'asReferral' property to both the Multi-product and product card, and use the property to determine the CTA label the card will render.
Testing Instructions
- Use the A4A live link below and go to
/marketplace/products - Toggle 'Referral mode' at the top right corner.
- Confirm that the product cards display the 'Add to referral' text on the CTA button.
Pre-merge Checklist
- [ ] Has the general commit checklist been followed? (PCYsg-hS-p2)
- [ ] Have you written new tests for your changes?
- [ ] Have you tested the feature in Simple (P9HQHe-k8-p2), Atomic (P9HQHe-jW-p2), and self-hosted Jetpack sites (PCYsg-g6b-p2)?
- [ ] Have you checked for TypeScript, React or other console errors?
- [ ] Have you used memoizing on expensive computations? More info in Memoizing with create-selector and Using memoizing selectors and Our Approach to Data
- [ ] Have we added the "[Status] String Freeze" label as soon as any new strings were ready for translation (p4TIVU-5Jq-p2)?
- [ ] For changes affecting Jetpack: Have we added the "[Status] Needs Privacy Updates" label if this pull request changes what data or activity we track or use (p4TIVU-aUh-p2)?
Jetpack Cloud live (direct link)
|
|
https://calypso.live?image=registry.a8c.com/calypso/app:build-109014&env=jetpack |
Automattic for Agencies live (direct link)
|
|
https://calypso.live?image=registry.a8c.com/calypso/app:build-109014&env=a8c-for-agencies |
This PR modifies the release build for the following Calypso Apps:
For info about this notification, see here: PCYsg-OT6-p2
- wpcom-block-editor
To test WordPress.com changes, run install-plugin.sh $pluginSlug updata/a4a/add-to-cart-button-when-in-referral-mode on your sandbox.
Here is how your PR affects size of JS and CSS bundles shipped to the user's browser:
Sections (~63 bytes added 📈 [gzipped])
name parsed_size gzip_size
a8c-for-agencies-marketplace +226 B (+0.0%) +63 B (+0.0%)
Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to.
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. Gzip Size: Compressed size of the JS and CSS files. This much data needs to be downloaded over network.
Generated by performance advisor bot at iscalypsofastyet.com.
Depends on https://github.com/Automattic/wp-calypso/pull/91090
✅ Approved