Skip to content
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-docs: Fix subcomponents display logic #11415

Merged
merged 2 commits into from
Jul 4, 2020

Conversation

shilman
Copy link
Member

@shilman shilman commented Jul 4, 2020

Issue: #10958

What I did

This change simplifies the Props display logic. Now:

  • Story table are always shown on the first tab
  • The component's component is shown if:
    • There is no story table
    • The user forces it with the showComponent prop
  • Subcomponents tables (if provided) are always shown on more tabs

How to test

See props.stories.mdx in official-storybook

Copy link
Member

@tmeasday tmeasday left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the logic is NQR

if (!story || showComponent) {
allComponents = { [mainLabel]: main };
}
allComponents = { ...allComponents, ...subcomponents };
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't we just check that allComponents is falsy

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated w/ slightly cleaner code. logic is same AFAIK because spreading falsey is allowed

@shilman shilman merged commit da10252 into next Jul 4, 2020
@stof stof deleted the 10958-fix-argstable-subcomponnets branch May 25, 2022 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants