Skip to content

Commit

Permalink
move heading out of example children
Browse files Browse the repository at this point in the history
  • Loading branch information
phryneas committed Jan 23, 2024
1 parent 1d05b70 commit a4dbbb2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
2 changes: 0 additions & 2 deletions docs/shared/ApiDoc/DocBlock.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ export function Example({
canonicalReference,
collapsible = false,
index = 0,
children,
}) {
const getItem = useApiDocContext();
const item = getItem(canonicalReference);
Expand All @@ -120,7 +119,6 @@ export function Example({
if (!value) return null;
return (
<>
{children}
<MaybeCollapsible collapsible={collapsible}>
{value && <MDX.MDXRenderer>{value}</MDX.MDXRenderer>}
</MaybeCollapsible>
Expand Down
19 changes: 11 additions & 8 deletions docs/shared/ApiDoc/Function.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,17 @@ export function FunctionDetails({
since
/>
<DocBlock canonicalReference={canonicalReference} deprecated remarks />
<Example canonicalReference={canonicalReference}>
<SubHeading
canonicalReference={canonicalReference}
headingLevel={headingLevel + 1}
>
Example
</SubHeading>
</Example>
{item.comment?.examples.length == 0 ? null : (
<>
<SubHeading
canonicalReference={canonicalReference}
headingLevel={headingLevel + 1}
>
Example
</SubHeading>
<Example canonicalReference={canonicalReference} />
</>
)}
<SubHeading
canonicalReference={canonicalReference}
headingLevel={headingLevel + 1}
Expand Down

0 comments on commit a4dbbb2

Please sign in to comment.