web-humas-fe/components/navbar.tsx

130 lines
3.1 KiB
TypeScript
Raw Normal View History

2024-01-29 10:19:46 +00:00
import { Input } from "@nextui-org/input";
import { Kbd } from "@nextui-org/kbd";
import { Link } from "@nextui-org/link";
2024-01-05 06:57:30 +00:00
import {
NavbarBrand,
2024-01-29 10:19:46 +00:00
NavbarContent,
2024-01-05 06:57:30 +00:00
NavbarItem,
2024-01-29 10:19:46 +00:00
NavbarMenu,
2024-01-05 06:57:30 +00:00
NavbarMenuItem,
2024-01-29 10:19:46 +00:00
NavbarMenuToggle,
Navbar as NextUINavbar
2024-01-05 06:57:30 +00:00
} from "@nextui-org/navbar";
import {
2024-01-29 06:38:26 +00:00
ChevronDownIcon,
FbIcon,
IgIcon,
2024-01-29 10:19:46 +00:00
SearchIcon,
2024-01-29 06:38:26 +00:00
TtIcon,
2024-01-29 10:19:46 +00:00
TwIcon,
YtIcon
2024-01-05 06:57:30 +00:00
} from "@/components/icons";
2024-01-29 10:19:46 +00:00
import { ThemeSwitch } from "@/components/theme-switch";
2024-01-05 06:57:30 +00:00
2024-01-29 10:19:46 +00:00
import { Button, Dropdown, DropdownItem, DropdownMenu, DropdownTrigger, Image } from "@nextui-org/react";
import { siteConfig } from "@/config/site";
2024-01-05 06:57:30 +00:00
export const Navbar = () => {
const searchInput = (
<Input
aria-label="Search"
classNames={{
inputWrapper: "bg-default-100",
input: "text-sm",
}}
endContent={
<Kbd className="hidden lg:inline-block" keys={["command"]}>
K
</Kbd>
}
labelPlacement="outside"
placeholder="Search..."
startContent={
<SearchIcon className="text-base text-default-400 pointer-events-none flex-shrink-0" />
}
type="search"
/>
);
return (
2024-01-29 10:19:46 +00:00
<NextUINavbar className="h-28 md:h-36"
2024-01-29 06:38:26 +00:00
classNames={{
2024-01-29 10:19:46 +00:00
wrapper: "max-w-full h-[90%]",
2024-01-29 06:38:26 +00:00
}}>
2024-01-29 10:19:46 +00:00
<NavbarBrand className="min-w-max">
2024-01-29 06:38:26 +00:00
<Image
src="/logohumas.png"
/>
</NavbarBrand>
2024-01-29 10:19:46 +00:00
<NavbarContent className="hidden md:flex basis-3/5 gap-0 md:gap-4 lg:gap-12 px-auto lg:px-10" justify="center">
2024-01-29 06:38:26 +00:00
<NavbarItem>
<Link color="foreground" href="#">
<p className="mr-1 font-semibold">Pelayanan Masyarakat</p>
<ChevronDownIcon />
2024-01-05 06:57:30 +00:00
</Link>
2024-01-29 06:38:26 +00:00
</NavbarItem>
<NavbarItem >
<Link href="#" color="foreground">
<p className="mr-1 font-semibold">Portal PPID</p>
2024-01-05 06:57:30 +00:00
</Link>
2024-01-29 06:38:26 +00:00
</NavbarItem>
<NavbarItem>
<Link color="foreground" href="#">
<p className="mr-1 font-semibold">Publikasi</p>
<ChevronDownIcon />
2024-01-05 06:57:30 +00:00
</Link>
</NavbarItem>
2024-01-29 06:38:26 +00:00
<NavbarItem>
<Link color="foreground" href="#">
<p className="mr-1 font-semibold">Tentang</p>
<ChevronDownIcon />
</Link>
</NavbarItem>
<NavbarItem>
<Link color="foreground" href="#">
<p className="mr-1 font-semibold">Aplikasi Terkait</p>
<ChevronDownIcon />
</Link>
</NavbarItem>
<NavbarItem>
<ThemeSwitch />
2024-01-05 06:57:30 +00:00
</NavbarItem>
</NavbarContent>
2024-01-29 10:19:46 +00:00
<NavbarContent className="hidden sm:hidden md:hidden lg:flex basis-1/5 flex-col items-center ">
2024-01-29 06:38:26 +00:00
<div className="flex gap-3">
<div><FbIcon /></div>
<div><IgIcon /></div>
<div><YtIcon /></div>
<div><TwIcon /></div>
<div><TtIcon /></div>
2024-01-05 06:57:30 +00:00
</div>
2024-01-29 06:38:26 +00:00
<div className="font-bold">{searchInput}</div>
</NavbarContent>
2024-01-29 10:19:46 +00:00
<NavbarContent className="sm:hidden basis-1 pl-4" justify="end">
<ThemeSwitch />
<NavbarMenuToggle />
</NavbarContent>
<NavbarMenu>
{/* {searchInput} */}
<div className="mx-4 mt-2 flex flex-col gap-2 pt-10">
{siteConfig.navMenuItems.map((item, index) => (
<NavbarMenuItem key={`${item}-${index}`}>
<Link
href={item.href}
size="lg"
>
{item.label}
</Link>
</NavbarMenuItem>
))}
</div>
</NavbarMenu>
2024-01-05 06:57:30 +00:00
</NextUINavbar>
);
};