()
| 13 | }; |
| 14 | |
| 15 | const useCheckCustomNavBarBg = () => { |
| 16 | const isScrolling = useScrollTrigger({ |
| 17 | disableHysteresis: true, |
| 18 | threshold: 10, |
| 19 | }); |
| 20 | |
| 21 | const pathname = usePathname(); |
| 22 | const isNoBgPage = useMemo( |
| 23 | () => TRANSPARENT_BG_PAGE_LIST.includes(pathname!), |
| 24 | [pathname], |
| 25 | ); |
| 26 | |
| 27 | const navbarBg = useMemo(() => { |
| 28 | if (isNoBgPage) { |
| 29 | return isScrolling ? "" : "transparent"; |
| 30 | } |
| 31 | return CUSTOM_BG_PAGE_MAP[pathname!] || ""; |
| 32 | }, [isNoBgPage, isScrolling, pathname]); |
| 33 | |
| 34 | return navbarBg; |
| 35 | }; |
| 36 | |
| 37 | export default useCheckCustomNavBarBg; |
nothing calls this directly
no outgoing calls
no test coverage detected