-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
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(theme-common): allow optional desktopBreakpoint param in useWindowSize #9335
Merged
Merged
Changes from 11 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
9f90240
feat(theme-common): Get desktopThresholdWidth from docusaurus config,…
jgarrow c629834
Update example to dogfood custom desktopThresholdWidth
jgarrow d3feed9
Revert "Update example to dogfood custom desktopThresholdWidth"
jgarrow 7bb3c9c
dogfooding: Add custom desktop breakpoint to theme config
jgarrow 6535c04
Handle falsey value
jgarrow 480684c
Update ThemeConfig type
jgarrow 19f9abe
Allow optional desktopThresholdWidth param for useWindowSize hook
jgarrow 18d0edb
Remove dogfooding from previous implementation
jgarrow 18ace77
Change useWindowSize hook param to object
jgarrow 0a09563
Update docs
jgarrow df7ffbf
Change arg shape for getWindowSize instead of useWindowSize
jgarrow 9436389
Update useWindowSize docs as per feedback
jgarrow 1584349
Merge branch 'main' into main
Josh-Cena 63369d3
Use object param in the right place
Josh-Cena 4f3ab26
Update website/docs/styling-layout.mdx
Josh-Cena c063b18
minor refactors
slorber File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Not fan of using a single arg there, please use a flexible object instead because we don't want to do a breaking change if we later introduce a new breakpoint some day or if you or someone else come with the need for 3 different sizes. If we add flexibility for your use case, let's make it flexible enough for other use cases as well.
This lib has a decent API to copy imho: https://github.com/iiroj/use-breakpoint
(by the way you could as well use this lib directly in your code, similar behavior to what we implemented here).