Skip to content

Prevent OpenRPC-generated pages from using the @theme/ApiItem component#720

Merged
ElliotFriend merged 2 commits into
mainfrom
fix-apiitem-rpc
Jun 27, 2024
Merged

Prevent OpenRPC-generated pages from using the @theme/ApiItem component#720
ElliotFriend merged 2 commits into
mainfrom
fix-apiitem-rpc

Conversation

@ElliotFriend
Copy link
Copy Markdown
Contributor

As pointed out in #709 (here is the exact comment), the @theme/ApiItem component from the docusaurus-theme-openapi-docs package (as well as our swizzled /src/theme/ApiItem/Layout component) adds some styling/layout that we don't really want to see in the pages generated using the open-rpc-docs-react component. Namely, as pointed out in #709, any <CodeBlock> components are floated to the right-hand side of the screen (wrapping the code block component in a <div> seems to do the trick to workaround it, btw).

This PR aims to ensure that the URL of a page rendered with @theme/ApiItem doesn't include rpc, and will use the default @theme/DocItem component, instead.

@ElliotFriend ElliotFriend changed the title Prevent OpenRPC-generated pages from using the @theme/ApiItem page Prevent OpenRPC-generated pages from using the @theme/ApiItem component Jun 25, 2024
@stellar-jenkins
Copy link
Copy Markdown

1 similar comment
@stellar-jenkins
Copy link
Copy Markdown

@ElliotFriend
Copy link
Copy Markdown
Contributor Author

Relevant preview pages: The getTransaction and sendTransaction pages are the only two pages which should be affected by this PR (at the moment). I've also remove the <div> workarounds on both of those pages.

@ElliotFriend ElliotFriend requested a review from briwylde08 June 25, 2024 14:22
Copy link
Copy Markdown
Contributor

@briwylde08 briwylde08 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ElliotFriend ElliotFriend merged commit 780f600 into main Jun 27, 2024
@ElliotFriend ElliotFriend deleted the fix-apiitem-rpc branch June 27, 2024 10:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants