forked from solana-foundation/solana-com
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathHeader.tsx
More file actions
37 lines (31 loc) · 915 Bytes
/
Copy pathHeader.tsx
File metadata and controls
37 lines (31 loc) · 915 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
"use client";
import React from "react";
import { NavigationAdapter } from "./NavigationAdapter";
import DevelopersNav from "./developers/DevelopersNav/DevelopersNav";
import { useRouter } from "@@/src/hooks/useRouter";
interface HeaderProps {
className?: string;
containerClassName?: string;
}
const Header: React.FC<HeaderProps> = ({
className = "",
containerClassName = "",
}) => {
const router = useRouter();
// Determine if secondary nav should be shown
const showDevelopersNav =
router.asPath.includes("/developers") || router.asPath.includes("/docs");
return (
<>
<NavigationAdapter
className={className}
containerClassName={containerClassName}
/>
{/* Secondary nav for /developers/* and /docs/* */}
{showDevelopersNav && (
<DevelopersNav containerClassName={containerClassName} />
)}
</>
);
};
export default Header;