ethereum-org-website
ethereum-org-website copied to clipboard
Create NetworkUpgradeSummary component for history page
Description
This PR refactors repeating elements in the History markdown page into a 'NetworkUpgradesComponent'.
Some issues with the previous implementation.
- Even for a minor update, the Crowdin progress gets reset to near zero every time we upload changes to this file due to the complex nature of the syntax.
- Translators must translate the same information many times.
- The first Emoji component breaks almost every time it gets uploaded from Crowdin.
- It uses HTML within markdown, which we'd like to avoid.
Additional context
Currently, I've only updated a few to test there are no visual regressions. We should update the entire history page to use the component if we want to use this approach.
We could also quite quickly create these JSON strings manually for the languages that already have the history page translated if we felt that would be worthwhile.
Related Issue
Ongoing translation efforts
:white_check_mark: ethereum-org-website-dev deploy preview ready
- Deploy preview
- Build logs · 27m build time
@minimalsm I like this overall! One thought I had, what about storing all of the data we're passing as props in a historical data file, then import that into the
NetworkUpgradeSummary.tsxcomponent, and just pass some type of id (upgradenamewould work) to then grab the available data and render the component?ie:
<NetworkUpgradeSummary name="altair" />...then all of this is fetched within
NetworkUpgradeSummary.tsx:dateTimeAsString="Oct-27-2021 10:56:23 AM +UTC" epochNumber={74240} ethPriceInUSD={4024} waybackLink="https://web.archive.org/web/20211026174951/https://ethereum.org/en/"I think it would help clean up the props and reduce chances of markdown formatting issues with translations.
Awesome idea @wackerow!
This approach is much cleaner, should help eliminate accidental translations, and lets us keep the markdown component to one line ❤️
@minimalsm Any update here? Seems to have gone stall, perhaps we open this up for the community?