-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TS migrate CardList Component #6564
Conversation
add typed props for the card list and switch from js file to typescript react component Refs: ethereum#6392
the card list components has been migrated to typescript react component. For a given card list item, if the image is provided, then the alt props must be passed as GastbyImage requires the alt props Refs: ethereum#6392
Gatsby Cloud Build Reportethereum-org-website-dev 🎉 Your build was successful! See the Deploy preview here. Build Details🕐 Build time: 26m |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this, will help with our a11y issues. Good job @Mousticke 💯
=====
Not a big fan of the implementation aspects since its a bit hard to understand from a dx point of view but I guess there is not much we can do about that 🤷🏼♂️ will try to keep this in mind for other image implementations in other components.
define the image type in types.ts and set forbid utility type to more a more generic name Refs: ethereum#6392
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Mousticke this is great, thanks for the deep analysis there. While we migrate those other files, those errors are going to pop up and we can fix those missing alts
. Good job 💪🏼
@all-contributors please add @Mousticke for code |
@Mousticke already contributed before to code |
Description
Migrate
CardList
component from js to tsxAnalysis
Components / pages using
⚠️
CardList
componentBeaconChainActions
EthExchanges
❌StableCoinAccordion
✔️UpgradeArticles
✔️bug-bounty
get-eth
deposit-contrat
❌eth
✔️wallets/index
✔️Test new type
Extra
GatsbyImage
requires the alt props provided for an image or at least an empty string. So in the CardList component, if theimage
prop has been provided, then the alt props has to be passed too. I put in this way. If you do not agree with that, I can always give you your preferred way.Related Issue
Related to Epic: TypeScript rollout