-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
fixed 4025 - allow setting background via name #4081
fixed 4025 - allow setting background via name #4081
Conversation
2e540b8
to
61b4dba
Compare
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.
LGTM 👍 nice change.
@@ -99,8 +99,12 @@ export default class BackgroundPanel extends Component { | |||
|
|||
// debugger; | |||
|
|||
if (current && backgrounds.find(bg => bg.value === current)) { | |||
this.updateIframe(current); | |||
const foundBackground = current && backgrounds.find( |
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.
Doesn't the line 97 ☝️ used to get the background
from the url?
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.
Afaik this hasn't changed. On line 97 we get the value of the query param background
. This value is checked against the name
and value
of the background. I used decodeURI
to convert URI encoded spaces back to a real space for example.
Or did I misunderstand your question? 🙃
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.
Ahh, my fault 🤦♂️
Can you please merge from master, it should fix all the CI things |
61b4dba
to
ee89527
Compare
Codecov Report
@@ Coverage Diff @@
## master #4081 +/- ##
==========================================
+ Coverage 40.57% 40.58% +0.01%
==========================================
Files 469 469
Lines 5641 5642 +1
Branches 748 749 +1
==========================================
+ Hits 2289 2290 +1
Misses 2984 2984
Partials 368 368
Continue to review full report at Codecov.
|
I hope it works now 👌 |
ee89527
to
cbd7741
Compare
I wonder why I haven't seen that before 🤔 Should be fixed now. |
Issue: #4025
What I did
I updated the backgrounds addon so I can choose my background by name as well and not just by value.
How to test
Is this testable with Jest or Chromatic screenshots?
Does this need a new example in the kitchen sink apps?
Does this need an update to the documentation? Yes.
If you run a storybook which includes the backgrounds addon you can set
?background={valueOrName}
to choose the backgroundIf your answer is yes to any of these, please make sure to include it in your PR.
For maintainers only: Please tag your pull request with at least one of the following:
["cleanup", "BREAKING CHANGE", "feature request", "bug", "documentation", "maintenance", "dependencies", "other"]