diff --git a/src/Header/Component.client.tsx b/src/Header/Component.client.tsx index 6a3403d..e9a4f93 100644 --- a/src/Header/Component.client.tsx +++ b/src/Header/Component.client.tsx @@ -9,55 +9,33 @@ import type { Header } from '@/payload-types' import { Logo } from '@/components/Logo/Logo' import { HeaderNav } from './Nav' import { useThemeMode } from '@/hooks/useThemeMode' +import { Container } from '@/components/ui/Container' // Import your custom container -interface HeaderClientProps { - data: Header -} - -function ToggleButton() { - const { isDark, toggle } = useThemeMode() - return ( - - ) -} +// ... ToggleButton component remains the same ... export const HeaderClient: React.FC = ({ data }) => { const [theme, setTheme] = useState(null) const { headerTheme, setHeaderTheme } = useHeaderTheme() const pathname = usePathname() - useEffect(() => { - setHeaderTheme(null) - // eslint-disable-next-line react-hooks/exhaustive-deps - }, [pathname]) - - useEffect(() => { - if (headerTheme && headerTheme !== theme) setTheme(headerTheme) - // eslint-disable-next-line react-hooks/exhaustive-deps - }, [headerTheme]) + // ... useEffect hooks remain the same ... return ( -
-
- - - -
- - +
+ +
+ + + +
+ + +
-
+
) } diff --git a/src/Header/Component.tsx b/src/Header/Component.tsx index e7beeed..08a84e3 100644 --- a/src/Header/Component.tsx +++ b/src/Header/Component.tsx @@ -1,9 +1,16 @@ import { HeaderClient } from './Component.client' import { getCachedGlobal } from '@/utilities/getGlobals' +import { Container } from '@/components/ui/Container' // Adjust path as needed import React from 'react' export async function Header() { const headerData = await getCachedGlobal('header', 1)() - return + return ( +
+ + + +
+ ) }