-
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
Site Setup Design Picker: Recognize individual theme purchases #66279
Conversation
Here is how your PR affects size of JS and CSS bundles shipped to the user's browser: App Entrypoints (~183 bytes added 📈 [gzipped])
Common code that is always downloaded and parsed every time the app is loaded, no matter which route is used. Async-loaded Components (~114 bytes added 📈 [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. |
); | ||
} else if ( hasPurchasedTheme ) { | ||
// Premium, does not need upgrade | ||
// TODO: How to figure out if it's annual or monthly? |
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.
Seems like this is not going to be a problem for the time being: paYKcK-1XV-p2
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 Pull Request is now available for translation here: https://translate.wordpress.com/deliverables/7465145 Thank you @mreishus for including a screenshot in the description! This is really helpful for our translators. |
Translation for this Pull Request has now been finished. |
Proposed Changes
Premium themes can be acquired by purchasing a plan that provides all premium themes, or by buying an individual premium theme directly. The design picker isn't aware of individual purchases yet, this PR adds it.
For example, I have a free plan site where I have purchased the premium theme skivers.
Before PR:
After PR:
Note: Interaction with other changes
This will need further update once #66048 + D84731-code is merged.
I'll have to change the format of
purchasedThemes
. It's currently an array of theme names,[ 'skivers', 'payton' ]
, but it will need to contain both the name and the period. Maybe[ {name: 'skivers', period: 'yearly'}, ... ]
?Note: Duplication of wasThemePurchased()
I tried putting this in
client/landing/stepper/declarative-flow/internals/steps-repository/design-setup/utils
, and importing it from the design-picker, but an eslint rule was triggered saying I shouldn't import from there (no-restricted-imports). I guess there has to be one copy in the design picker package, and one in stepper, unless I'm missing something.Testing Instructions
Part 1
http://calypso.localhost:3000/setup/designSetup?siteSlug=SITE_SLUG_HERE&flags=-signup/design-picker-unified
(note turning the flag off)Part 2
Related to #65704 #65857