-
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
refactor(page staking): replace styled components with chakra ui #9398
refactor(page staking): replace styled components with chakra ui #9398
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.
Good start on this one @mlCode111 thanks for the PR!
As part of this migration, we also want to remove the SharedStyledComponents
dependency. As you will see, a bunch of components are imported from there (Page
, Content
, etc). We need to migrate those as well.
src/pages/staking/index.tsx
Outdated
import { Box, Flex, Grid, Heading } from "@chakra-ui/react" | ||
import theme from "../../@chakra-ui/gatsby-plugin/theme" |
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.
import order
3rd party imports need to be at the top of the imports, along with react
and react-intl
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. I updated this in the new commit
src/pages/staking/index.tsx
Outdated
return ( | ||
<Flex | ||
flex="1 1" | ||
flexBasis={theme.breakpoints.md} |
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.
Lets use the following form to access the breakpoint value:
import { useToken } from "@chakra-ui/react"
const ContentContainer = props => {
const mdBp = useToken("breakpoints", "md")
...
}
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 updated in the new commit.
Just realized there is also merge conflicts. LMK in case you have problems fixing those :) |
e16f237
to
418a6e3
Compare
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 so much for this PR @mlCode111! 🎉
I've refactored a few things on the button dropdown to simplify it a bit.
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! Be sure to join the Ethereum.org discord if you are interested in contributing further to the project or have any questions for the team. GitPOAP: 2023 Ethereum.org Contributor: Head to gitpoap.io & connect your GitHub account to mint! Learn more about GitPOAPs here. |
@all-contributors please add @mlCode111 for code |
I've put up a pull request to add @mlCode111! 🎉 |
Description
This PR replaces styled components with Chakra ui components in page/staking/index.tsx
Related Issue
#9353