MCPcopy Create free account
hub / github.com/LevelUpWeb3/app / useCheckCustomNavBarBg

Function useCheckCustomNavBarBg

src/components/Header/useCheckCustomNavBarBg.tsx:15–35  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

13};
14
15const 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
37export default useCheckCustomNavBarBg;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected