Skip to content

Commit

Permalink
Addon-docs: Fix story description to only show when expanded
Browse files Browse the repository at this point in the history
  • Loading branch information
shilman committed Sep 24, 2020
1 parent 33301ff commit caf2b6b
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions addons/docs/src/blocks/DocsStory.tsx
Expand Up @@ -22,13 +22,18 @@ export const DocsStory: FunctionComponent<DocsStoryProps> = ({
name,
expanded = true,
withToolbar = false,
parameters,
parameters = {},
}) => {
let description = expanded && parameters?.docs?.description?.story;
if (!description) {
description = parameters?.docs?.storyDescription;
if (description) warnStoryDescription();
let description;
const { docs } = parameters;
if (expanded && docs) {
description = docs.description?.story;
if (!description) {
description = docs.storyDescription;
if (description) warnStoryDescription();
}
}

const subheading = expanded && name;

return (
Expand Down

0 comments on commit caf2b6b

Please sign in to comment.