Skip to content
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

Migrate SimpleTable.tsx to chakra #8744

Merged
merged 8 commits into from
Jan 5, 2023

Conversation

amit-ksh
Copy link
Contributor

Description

Migrate the SimpleTable component from emotion to chakra using Chakra's Table component.

Related Issue

Closes #8638

@gatsby-cloud
Copy link

gatsby-cloud bot commented Nov 27, 2022

✅ ethereum-org-website-dev deploy preview ready

Copy link
Contributor

@TylerAPfledderer TylerAPfledderer left a comment

Choose a reason for hiding this comment

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

Hey @amit-ksh! 👋🏼

I have a couple of suggestions to instantly make this more accessible with external links. 😄 (Using tables is an instant boost!

If we keep where the Link component is used for the row, then you will have an anchor tag rendered, wrapping td tags... which is not really approved in HTML styling validation, and might create issues with screen readers.

With the original intention of the whole row being clickable, the LinkOverlay component tandem is a great approach!

@pettinarip I would like your thoughts here. 🤘🏼

src/components/SimpleTable.tsx Outdated Show resolved Hide resolved
src/components/SimpleTable.tsx Outdated Show resolved Hide resolved
@amit-ksh
Copy link
Contributor Author

amit-ksh commented Dec 9, 2022

Made all the changes as you said @TylerAPfledderer.

Copy link
Member

@pettinarip pettinarip left a comment

Choose a reason for hiding this comment

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

Left a small question on how we are render the LinkBox.

Overall this is a great improvement on the a11y aspects. GJ

src/components/SimpleTable.tsx Outdated Show resolved Hide resolved
src/components/SimpleTable.tsx Outdated Show resolved Hide resolved
src/components/SimpleTable.tsx Outdated Show resolved Hide resolved
@amit-ksh
Copy link
Contributor Author

Made all the changes as you suggested @pettinarip

@amit-ksh amit-ksh requested a review from pettinarip December 24, 2022 08:06
Copy link
Contributor

@TylerAPfledderer TylerAPfledderer left a comment

Choose a reason for hiding this comment

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

@amit-ksh and @pettinarip: I've provided additional thoughts. :)

src/components/SimpleTable.tsx Outdated Show resolved Hide resolved
src/components/SimpleTable.tsx Outdated Show resolved Hide resolved
}}
isExternal
>
{name}
Copy link
Contributor

@TylerAPfledderer TylerAPfledderer Dec 25, 2022

Choose a reason for hiding this comment

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

This is a personal recommendation, as it is a minor addition for A11y. (For @pettinarip approval 😄 )

Include visually hidden text for the LinkOverlay render only which reads (Opens a new window) (with the parens) since all the link that are ever passed into this table are assumed to be external and the screen-reader user should be notified of that.

Maybe should have this under a translation function too and supplied in the intl/en/common.json file

Suggested change
{name}
{name}
<VisuallyHidden>
<Translation id="sr-link-opens-new-window" />
</VisuallyHidden>

And the json add:
"sr-link-opens-new-window": "(Opens a new window)"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hey @TylerAPfledderer, should I make these changes or wait for @pettinarip approval?

Copy link
Contributor

Choose a reason for hiding this comment

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

@amit-ksh I would wait to make sure it's OK since it is adding to the structure.

Copy link
Member

Choose a reason for hiding this comment

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

I think this is a worthy discussion we can have with the rest of the team on a different issue since I think that if we apply that change we should do the same with the rest of the external links we have on the site, to keep consistency. For that reason, I don't see that change as part of the scope of this PR/migration.

Happy to see this issue created and discussed with more people. I haven't seen this pattern a lot on other sites. I'm curious to hear what others think about it.

Co-authored-by: Tyler Pfledderer <tyler.pfledderer@gmail.com>
Copy link
Member

@pettinarip pettinarip left a comment

Choose a reason for hiding this comment

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

@amit-ksh great job! thanks for the refactor 💪🏼

}}
isExternal
>
{name}
Copy link
Member

Choose a reason for hiding this comment

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

I think this is a worthy discussion we can have with the rest of the team on a different issue since I think that if we apply that change we should do the same with the rest of the external links we have on the site, to keep consistency. For that reason, I don't see that change as part of the scope of this PR/migration.

Happy to see this issue created and discussed with more people. I haven't seen this pattern a lot on other sites. I'm curious to hear what others think about it.

@pettinarip pettinarip merged commit cad1c99 into ethereum:dev Jan 5, 2023
@gitpoap-bot
Copy link

gitpoap-bot bot commented Jan 5, 2023

Congrats, your important contribution to this open-source project has earned you a GitPOAP!

GitPOAP: 2023 Ethereum.org Contributor:

GitPOAP: 2023 Ethereum.org Contributor GitPOAP Badge

Head to gitpoap.io & connect your GitHub account to mint!

Learn more about GitPOAPs here.

@corwintines corwintines mentioned this pull request Jan 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migrate SimpleTable.tsx to Chakra
4 participants