-
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
feat(hooks): build local useBreakpointValue
and useMediaQuery
hooks
#13695
feat(hooks): build local useBreakpointValue
and useMediaQuery
hooks
#13695
Conversation
✅ Deploy Preview for ethereumorg ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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 is great @TylerAPfledderer. Works perfectly in the current instances.
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.
Nice!
|
||
const breakpointMap = { | ||
// Essentially to query from no width if smaller than "sm" | ||
base: "0px", |
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.
👍🏼
Description
Creates the
useBreakpointValue
anduseMediaQuery
hooks locally.useBreakpointValue
references the Chakra UI useBreakpointValue as is simplified.useMediaQuery
is an amalgamation of the hooks from usehooks-ts and from Chakra UI to account for an array of media queries.This should be scrutinized in knowing how simple or complex this pair need to be for the project's purposes.