Skip to content

Commit

Permalink
feat(docs): added summary
Browse files Browse the repository at this point in the history
  • Loading branch information
TrofimovAnton85 committed Oct 2, 2024
1 parent 108d571 commit b7b3921
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
11 changes: 10 additions & 1 deletion src/components/ParserOpenRPC/DetailsBox/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ interface TagItem {
interface DetailsBoxProps {
method: string;
description: string | null;
summary: string | null;
params: MethodParam[];
components: SchemaComponents;
result: any;
Expand All @@ -28,6 +29,7 @@ interface DetailsBoxProps {
export default function DetailsBox({
method,
description,
summary,
params,
components,
result,
Expand All @@ -46,7 +48,14 @@ export default function DetailsBox({
</div>
)}
<Heading as="h1">{method}</Heading>
<MDContent content={description} />
{summary !== null && (
<p style={{ marginBottom: "0.5rem" }}>
<MDContent content={summary} />
</p>
)}
{description !== null && (
<MDContent content={description} />
)}
{extraContent && <div className="padding-top--lg">{extraContent}</div>}
<Heading
as="h2"
Expand Down
4 changes: 3 additions & 1 deletion src/components/ParserOpenRPC/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ export default function ParserOpenRPC({
);

return {
description: currentMethod.description || currentMethod.summary || null,
description: currentMethod.description || null,
summary: currentMethod.summary || null,
params: currentMethod.params || [],
result: currentMethod.result || null,
components: currentNetwork.data.components || null,
Expand Down Expand Up @@ -282,6 +283,7 @@ export default function ParserOpenRPC({
<DetailsBox
method={method}
description={currentMethodData.description}
summary={currentMethodData.summary}
params={currentMethodData.params}
components={currentMethodData.components.schemas}
result={currentMethodData.result}
Expand Down

0 comments on commit b7b3921

Please sign in to comment.