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

Function useMainBgColor

src/hooks/useMainBgColor.ts:15–22  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

13};
14
15const useMainBgColor = () => {
16 const pathname = usePathname();
17
18 useEffect(() => {
19 const bgColor = CUSTOM_BG_PAGE_MAP[pathname!] || "#fff";
20 document.documentElement.style.setProperty("--main-bg-color", bgColor);
21 }, [pathname]);
22};
23
24export default useMainBgColor;

Callers 1

HeaderFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected