-
Notifications
You must be signed in to change notification settings - Fork 212
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
chore(styles): make subscription icon background configurable as metadata #5973
Conversation
@@ -46,6 +46,7 @@ export const SELECTED_PLAN: Plan = { | |||
interval_count: 1, | |||
product_metadata: { | |||
webIconURL: 'http://placekitten.com/49/49?image=2', | |||
webIconBackground: 'purple', |
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.
So i pretty much added a color as mock data anywhere an icon was supplied
There are tests for not including an icon in metadata (for example here)...i may need to add these, but could use a little help if so... |
a8cb7f1
to
ab231fa
Compare
Codecov Report
@@ Coverage Diff @@
## main #5973 +/- ##
==========================================
- Coverage 93.84% 92.81% -1.04%
==========================================
Files 299 250 -49
Lines 14417 10352 -4065
Branches 385 432 +47
==========================================
- Hits 13530 9608 -3922
+ Misses 884 741 -143
Partials 3 3
|
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 looks like it works, but is there a reason why the background can't be a part of the image asset itself? (i.e. we use a shared asset that we can't tailor to subplat pages?)
Also, good job figuring out how to add a product metadata prop (it's tangly 😅) |
<div className="plan-details-logo-wrap"> | ||
<div | ||
className="plan-details-logo-wrap" | ||
style={{ ...setWebIconBackground }} |
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.
I guess if the markup around the icon ever gets more complex, we should consider extracting it out to a shared component that does stuff like the setWebIconBackground
logic. But not worth holding this PR up for
@lmorchard WRT setting the background as color, I did this based on the hunch that lead page design will change far more rapidly than will logo design, so having a color element that is easier to swap than uploading a static asset felt right. It also gives us a little more flexibility about placing an svg on an arbitrarily large background if our page layout changes. |
Because
Icons for mozilla services will be white and will need different bg colors
This pull request
makes bg color configurable as stripe metadata. Any valid CSS color value can be included in metadata (gradients, color names etc)
Issue that this pull request solves
Closes: #5952
Checklist
Put an
x
in the boxes that applyNotes:
Screenshots (Optional)