-
-
Notifications
You must be signed in to change notification settings - Fork 250
Hide top nav on reading docs on mobile #856
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
The top navigation disappears when you scroll down and reappears when you scroll up. Like browsers, and many content services like Medium, This is a necessary feature for mobile readers with a small viewport. Also made some code changes here to add memoization, because the scroll event is highly frequant. `React.useState` preserves the reference of the set dispatcher, but doesn't for the surrounding tuple. Adding a few memo, most children, except for components that are cheap to render, are not re-rendered. Also no deep re-render, the appearance state is propagated via old good CSS cascading rather than React state.
@cometkim is attempting to deploy a commit to the ReScript Association Team on Vercel. A member of the Team first needs to authorize it. |
Screencast.from.2024-04-21.13-40-11.webm |
This works great, nice work! |
Ah, the original intention was to add it to the blog, not the API docs 😂 |
It now works on API, Docs, and Blog articles. Any other place to need it? |
@fhammerschmidt Done. Now it is easily configurable by JSX composition in (note I've removed some unused codes in Hooks) |
The top navigation disappears when you scroll down and reappears when you scroll up. Like browsers, and many content services like Medium,
This is a necessary feature for mobile readers with a small viewport.
Also made some code changes here to add memoization, because the scroll event is highly frequant.
React.useState
preserves the reference of the set dispatcher, but doesn't for the surrounding tuple. Adding a few memo, most children, except for components that are cheap to render, are not re-rendered.Also no deep re-render, the appearance state is propagated via old good CSS cascading rather than React state.