-
Couldn't load subscription status.
- Fork 5.3k
[UI] Stablecoin Box Grid: migrate component to chakra UI #8201
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
Conversation
✅ ethereum-org-website-dev deploy preview ready
|
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.
Hey @shariqanwar20! Nice work! I had a chance to look through your PR and left some comments. 😃
I think there are many spots where reusable child components should be recreated (Like what was originally labeled Subtitle, Row, Column, etc. to make sure the code is DRY. 😸
src/components/StablecoinBoxGrid.tsx
Outdated
| gridColumnStart={isOpen ? columnNumber : `auto`} | ||
| color={isOpen ? "black300" : "text"} | ||
| cursor={isOpen ? `auto` : `pointer`} | ||
| background={isOpen ? `${color}` : "background"} |
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.
For consistency throughout the file, I suggest removing the interpolation around the color prop :)
src/components/StablecoinBoxGrid.tsx
Outdated
| <Text | ||
| fontSize={{ base: "2rem", sm: "2.5rem" }} | ||
| fontWeight={700} | ||
| marginTop={0} | ||
| > | ||
| {title} | ||
| </Text> |
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.
Also needs to be Heading with an h3 similar to the previous.
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.
Correct
src/components/StablecoinBoxGrid.tsx
Outdated
| background: `${isOpen ? color : "ednBackground"}`, | ||
| transition: `${isOpen ? "auto" : "transform 0.5s"}`, | ||
| transform: `${isOpen ? "auto" : "skewX(-5deg)"}`, |
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.
Interpolation is not needed here in order for the values to be rendered correctly
src/components/StablecoinBoxGrid.tsx
Outdated
| <Text | ||
| fontSize={{ base: "2rem", sm: "2.5rem" }} | ||
| fontWeight={400} | ||
| marginTop={0} | ||
| > | ||
| {title} | ||
| </Text> |
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.
This should be the Heading component, as it is an h3 (needs as='h3') but is currently being rendered as a p.
Additional props are required in the interim to ensure it still renders as the original.
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.
Correct. Lets fix this
src/components/StablecoinBoxGrid.tsx
Outdated
| <Column> | ||
| <Subtitle> | ||
| <Box w="100%"> | ||
| <Text |
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.
Also should be a Heading with an h4 similar to previous
src/components/StablecoinBoxGrid.tsx
Outdated
| <Column> | ||
| <Subtitle> | ||
| <Box w="100%"> | ||
| <Text |
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.
Also should be a Heading with an h4 similar to previous
src/components/StablecoinBoxGrid.tsx
Outdated
| </Flex> | ||
| <div> | ||
| <Subtitle> | ||
| <Text |
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.
Also should be a Heading with an h4 similar to previous
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.
Same
src/components/StablecoinBoxGrid.tsx
Outdated
| gridTemplateColumns={"3fr 1fr"} | ||
| gridTemplateRows={"3fr 3fr"} | ||
| borderRadius="2px" | ||
| margin={0} |
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.
Should be margin="4rem 0" to have the vertical spacing around the container.
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.
We could just do my={16} in this case to use the chakra spacing values
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.
Good job @shariqanwar20
src/components/StablecoinBoxGrid.tsx
Outdated
| <Text | ||
| fontSize={{ base: "2rem", sm: "2.5rem" }} | ||
| fontWeight={400} | ||
| marginTop={0} | ||
| > | ||
| {title} | ||
| </Text> |
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.
Correct. Lets fix this
src/components/StablecoinBoxGrid.tsx
Outdated
| <Text | ||
| fontSize={{ base: "2rem", sm: "2.5rem" }} | ||
| fontWeight={700} | ||
| marginTop={0} | ||
| > | ||
| {title} | ||
| </Text> |
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.
Correct
src/components/StablecoinBoxGrid.tsx
Outdated
| </Flex> | ||
| <div> | ||
| <Subtitle> | ||
| <Text |
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.
Same
src/components/StablecoinBoxGrid.tsx
Outdated
| gridTemplateColumns={"3fr 1fr"} | ||
| gridTemplateRows={"3fr 3fr"} | ||
| borderRadius="2px" | ||
| margin={0} |
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.
We could just do my={16} in this case to use the chakra spacing values
src/components/StablecoinBoxGrid.tsx
Outdated
| <Container | ||
| gridTemplateColumns={"3fr 1fr"} | ||
| gridTemplateRows={"3fr 3fr"} | ||
| borderRadius="2px" |
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.
| borderRadius="2px" | |
| borderRadius="sm" |
src/components/StablecoinBoxGrid.tsx
Outdated
| <Text | ||
| fontSize={{ base: "1.5rem", sm: "2rem" }} | ||
| fontWeight={600} | ||
| marginTop="0rem" |
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.
| marginTop="0rem" | |
| marginTop="0" |
src/components/StablecoinBoxGrid.tsx
Outdated
| fontSize={{ base: "1.5rem", sm: "2rem" }} | ||
| fontWeight={600} | ||
| marginTop="0rem" | ||
| padding="0.5rem" |
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.
| padding="0.5rem" | |
| padding={2} |
src/components/StablecoinBoxGrid.tsx
Outdated
| fontWeight={600} | ||
| marginTop="0rem" | ||
| padding="0.5rem" | ||
| paddingBottom="1rem" |
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.
| paddingBottom="1rem" | |
| paddingBottom={4} |
|
@pettinarip @TylerAPfledderer Thanks for the feedback. I will start working on the changes right away |
…and use chakra standard values
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.
Thanks @shariqanwar20! I've pushed some minor fixes but overall this looks great.
Be sure to join the discord if you are interested in contributing further to the project or have any questions for the team. And we've just released our 2022 POAPs so remember to claim yours also 🥳!
|
Congrats, your important contribution to this open-source project has earned you a GitPOAP! GitPOAP: 2022 Ethereum.org Contributor: Head to gitpoap.io & connect your GitHub account to mint! Learn more about GitPOAPs here. |
|
@all-contributors please add @shariqanwar20 for code |
|
I've put up a pull request to add @shariqanwar20! 🎉 |

Description
The component has been migrated to chakra UI
The emotion styled component has been removed from the code
Facing issue in centering Cash Emoji when screen size is decreased
Each emotion component is replaced with inline style attributes using chakra UI
Media queries have been handled using breakpoints in chakra
Before
After
Related Issue
Refs: #6374