Skip to content

Commit

Permalink
Merge pull request #25157 from kripod/patch-1
Browse files Browse the repository at this point in the history
Blocks: Fix Subtitle block for unattached docs pages
(cherry picked from commit c82e136)
  • Loading branch information
shilman authored and storybook-bot committed Dec 14, 2023
1 parent e45642c commit bda6a8d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 3 additions & 1 deletion code/addons/docs/template/stories/docs2/Title.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { Meta } from '@storybook/addon-docs';
import { Meta, Subtitle } from '@storybook/addon-docs';

<Meta title="Yabbadabbadooo" />

# Docs with title

<Subtitle>Subtitle</Subtitle>

hello docs
3 changes: 1 addition & 2 deletions code/ui/blocks/src/blocks/Subtitle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ interface SubtitleProps {

export const Subtitle: FunctionComponent<SubtitleProps> = ({ children }) => {
const docsContext = useContext(DocsContext);
const { parameters } = docsContext.storyById();
const content = children || parameters?.componentSubtitle;
const content = children || docsContext.storyById().parameters?.componentSubtitle;

return content ? (
<PureSubtitle className="sbdocs-subtitle sb-unstyled">{content}</PureSubtitle>
Expand Down

0 comments on commit bda6a8d

Please sign in to comment.