-
-
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
Addon Info: Omit empty inline info header #1306
Addon Info: Omit empty inline info header #1306
Conversation
e4649ac
to
b62b685
Compare
Codecov Report
@@ Coverage Diff @@
## master #1306 +/- ##
=========================================
Coverage ? 13.75%
=========================================
Files ? 202
Lines ? 4623
Branches ? 510
=========================================
Hits ? 636
Misses ? 3547
Partials ? 440
Continue to review full report at Codecov.
|
04385e2
to
d80e1c5
Compare
d80e1c5
to
549e55e
Compare
Looks like this is a duplicate of https://github.com/storybooks/storybook/pull/1297/files Feel free to take whichever approach seems appropriate. |
@duncanbeevers this one is a little cleaner, so I'm going to merge it. thanks for the PR! |
@duncanbeevers NOTE: we are planning to move the info addon into a panel soon: #1147 |
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!
Issue: Creating stories using
addWithInfo
, configured not to show headers, and to render info inline displays a blank header container on each story.What I did
Instead of unconditionally rendering the header container and filling it with the (possibly
null
) result of_getInfoHeader()
, I check the result first, and render the container conditionally.How to test
Check the
'simple usage (no header)'
example. Before this change is applied, it appears with a large empty white area above the example.After this change is applied, the empty white area is absent.