Skip to content

Commit 57e098c

Browse files
shilmanstorybook-bot
authored andcommitted
Merge pull request #25157 from kripod/patch-1
Blocks: Fix Subtitle block for unattached docs pages (cherry picked from commit c82e136)
1 parent 09df1e8 commit 57e098c

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
import { Meta } from '@storybook/addon-docs';
1+
import { Meta, Subtitle } from '@storybook/addon-docs';
22

33
<Meta title="Yabbadabbadooo" />
44

55
# Docs with title
66

7+
<Subtitle>Subtitle</Subtitle>
8+
79
hello docs

code/ui/blocks/src/blocks/Subtitle.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ interface SubtitleProps {
99

1010
export const Subtitle: FunctionComponent<SubtitleProps> = ({ children }) => {
1111
const docsContext = useContext(DocsContext);
12-
const { parameters } = docsContext.storyById();
13-
const content = children || parameters?.componentSubtitle;
12+
const content = children || docsContext.storyById().parameters?.componentSubtitle;
1413

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

0 commit comments

Comments
 (0)