Bug report
nhsz opened this issue · comments
Describe the bug
We have some issues related to the styles of DocLink
and ButtonLink
components
To reproduce
- for
DocLink
check/community/support
page - for
ButtonLink
check/guides/how-to-swap-tokens
page
Expected behavior
Proper styling
Screenshots
Desktop (please complete the following information)
No response
Smartphone (please complete the following information)
No response
Additional context
No response
Would you like to work on this issue?
- Yes
- No
This problem is related to the new version of mdx that we are using here, v2.
The current syntax that we are using works with mdx v1. Since we have upgraded it to v2, a few things have changed. For example, content that is inside jsx is now considered markdown, so:
<Button>
See our other guides
</Button>
// in v1, this is converted to:
<button>
See our other guides
</button>
// in v2, the new line will means that this is a new paragraph:
<button>
<p>See our other guides</p>
</button>
Then what we should do to keep the previous form in mdx v2, would be:
// avoid the new line
<Button>See our other guides</Button>
// or we could use this form to avoid being parsed as markdown
// https://mdxjs.com/migrating/v2/#expressions
{
<Button>
See our other guides
</Button>
}
More about changes in v2: https://mdxjs.com/migrating/v2/#update-mdx-files
IMO given that fixing this issue would imply changes in a lot of md pages (and a lot of sync conflicts with upstream), I'd propose not doing this mdx migration now and creating its own epic/task to be tackled after we finish the current NextJS migration.
This would mean to downgrade mdx to v1, which means that we'd need to downgrade next-mdx-remote
to v3.
If we all agree then I will reopen ethereum#9160 to keep track of that.
IMO given that fixing this issue would imply changes in a lot of md pages (and a lot of sync conflicts with upstream), I'd propose not doing this mdx migration now and creating its own epic/task to be tackled after we finish the current NextJS migration.
@pettinarip thanks for the research. Agree to downgrade next-mdx-remote
to v3 for now and migrate to mdx v2 later. We would need to test that next-mdx-remote
v3 doesnt break the build or introduce other bugs
@nhsz cool, I can tackle that. Will create a new card.
On the other hand, I'll reopen the mentioned issue.
@pettinarip re-opening as there's still a minor difference with the styling of DocLink
component, maybe related to the updated Link
component
now rendering
![Screen Shot 2023-09-05 at 10 49 34](https://private-user-images.githubusercontent.com/948922/265720564-c413235d-2edd-4a11-b8ed-0e5d88739d4a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTg3ODc5NDYsIm5iZiI6MTcxODc4NzY0NiwicGF0aCI6Ii85NDg5MjIvMjY1NzIwNTY0LWM0MTMyMzVkLTJlZGQtNGExMS1iOGVkLTBlNWQ4ODczOWQ0YS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNjE5JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDYxOVQwOTAwNDZaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0yOTFlMDM4M2I1MGI3OTZiZTdlZGFmOWRiMjc0NTMxODIzMzQ4OGM1ZDg0YmQwODUyODU3NmFkMjg2NjljZTExJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.kgNFCeNuOfiUsa3ES4T37R3zPlzL1Kju6X4jWz4weMc)
should be
![Screen Shot 2023-09-05 at 10 51 59](https://private-user-images.githubusercontent.com/948922/265720885-37a23968-45f7-4696-8ce1-082d6bdc719f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTg3ODc5NDYsIm5iZiI6MTcxODc4NzY0NiwicGF0aCI6Ii85NDg5MjIvMjY1NzIwODg1LTM3YTIzOTY4LTQ1ZjctNDY5Ni04Y2UxLTA4MmQ2YmRjNzE5Zi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ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