Skip to content

Commit

Permalink
feat(docs): added needed categories to sidebar
Browse files Browse the repository at this point in the history
  • Loading branch information
aednikanov committed Sep 19, 2024
1 parent 1a201e6 commit 095aff6
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/components/CustomReferencePage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,16 @@ const CustomReferencePage = (props) => {
...item,
items: item.items.map(referenceItem => {
if (referenceItem?.label === upperFirst(NETWORK_NAMES.linea) && referenceItem?.items) {
return { ...referenceItem, items: [...referenceItem.items, ...siteConfig.customFields.dynamicData] };
return { ...referenceItem, items: [...referenceItem.items, ...siteConfig.customFields.dynamicData.map(dynamicItem => {
const jsonRpcCategory = referenceItem.items.find(({ label }) => label === 'JSON-RPC APIs');
if (jsonRpcCategory) {
return {
...dynamicItem,
...{ items: [...dynamicItem.items, ...jsonRpcCategory.items.filter(refItem => refItem.type === "category")] }
};
}
return dynamicItem;
})] };
}
return referenceItem;
})
Expand Down
8 changes: 8 additions & 0 deletions src/lib/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -526,4 +526,12 @@ export const lineaSidebarNames = [
old: "api-reference",
new: "API reference"
},
{
old: "subscription-methods",
new: "Subscription methods"
},
{
old: "trace-methods",
new: "Trace methods"
},
]

0 comments on commit 095aff6

Please sign in to comment.