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

System-wide awareness of viewport state #1568

Closed
CarlosNZ opened this issue Oct 31, 2023 · 1 comment · Fixed by #1571
Closed

System-wide awareness of viewport state #1568

CarlosNZ opened this issue Oct 31, 2023 · 1 comment · Fixed by #1571
Assignees

Comments

@CarlosNZ
Copy link
Collaborator

Part of Epic #1548

We'll need our React components to have awareness of the current viewport.

I'm thinking we take the useWindowDimensions hook I made for #1564 and turn it into a Global context (so we're not calling the same hook multiple times simultaneously). Then made the following additions to it:

  • returns an "isMobile" boolean for other components to quickly know whether to display as mobile or not.
  • add a little debouncing to the event listener so it doesn't fire off like crazy while window is being resized (as that'll cause a lot of re-renders)
  • Anything else?
@CarlosNZ
Copy link
Collaborator Author

CarlosNZ commented Nov 5, 2023

Closed by #1571

@CarlosNZ CarlosNZ closed this as completed Nov 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant