mirror of
https://github.com/GiriNeko/YesPlayMusic.git
synced 2025-12-17 05:38:04 +00:00
feat: updates
This commit is contained in:
parent
0b4baa3eff
commit
222fb02355
77 changed files with 654 additions and 551 deletions
|
|
@ -1,18 +1,37 @@
|
|||
import { css, cx } from '@emotion/css'
|
||||
import Router from './Router'
|
||||
import useIntersectionObserver from '@/web/hooks/useIntersectionObserver'
|
||||
import uiStates from '@/web/states/uiStates'
|
||||
import { useEffect, useRef } from 'react'
|
||||
|
||||
const Main = () => {
|
||||
// Show/hide topbar background
|
||||
const observePoint = useRef<HTMLDivElement | null>(null)
|
||||
const { onScreen } = useIntersectionObserver(observePoint)
|
||||
useEffect(() => {
|
||||
uiStates.hideTopbarBackground = onScreen
|
||||
return () => {
|
||||
uiStates.hideTopbarBackground = false
|
||||
}
|
||||
}, [onScreen])
|
||||
|
||||
return (
|
||||
<main
|
||||
className={cx(
|
||||
'no-scrollbar overflow-y-auto pb-16 pr-6 pl-10',
|
||||
css`
|
||||
padding-top: 132px;
|
||||
grid-area: main;
|
||||
`
|
||||
)}
|
||||
>
|
||||
<Router />
|
||||
<div ref={observePoint}></div>
|
||||
<div
|
||||
className={css`
|
||||
margin-top: 132px;
|
||||
`}
|
||||
>
|
||||
<Router />
|
||||
</div>
|
||||
</main>
|
||||
)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue