Hide/show header and footer without re-renders, take two (#1849)
* Remove callsites using the state value * Remove unused code * Change shell mode without re-renders * Adjust "write your reply" for mode
This commit is contained in:
parent
bd531f2344
commit
82059b7ee1
7 changed files with 63 additions and 55 deletions
|
@ -33,9 +33,12 @@ export function useOnMainScroll(): [OnScrollCb, boolean, ResetCb] {
|
|||
const dy = y - (lastY.current || 0)
|
||||
lastY.current = y
|
||||
|
||||
if (!minimalShellMode && dy > dyLimitDown && y > Y_LIMIT) {
|
||||
if (!minimalShellMode.value && dy > dyLimitDown && y > Y_LIMIT) {
|
||||
setMinimalShellMode(true)
|
||||
} else if (minimalShellMode && (dy < dyLimitUp * -1 || y <= Y_LIMIT)) {
|
||||
} else if (
|
||||
minimalShellMode.value &&
|
||||
(dy < dyLimitUp * -1 || y <= Y_LIMIT)
|
||||
) {
|
||||
setMinimalShellMode(false)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue