update minor

This commit is contained in:
amd123 2024-03-27 19:23:07 +07:00
parent c1dd47999b
commit df68af4760
4 changed files with 132 additions and 29 deletions

View File

@ -256,7 +256,7 @@ export const ChevronUpIcon = ({
size, size,
height = 24, height = 24,
width = 24, width = 24,
fill = "none", fill = "currentColor",
...props ...props
}: IconSvgProps) => ( }: IconSvgProps) => (
<svg <svg

View File

@ -865,7 +865,7 @@ export const Navbar = () => {
<NavbarMenu> <NavbarMenu>
{/* {searchInput} */} {/* {searchInput} */}
<div className="mx-4 mt-2 flex flex-col gap-2 pt-10"> <div className="mx-4 mt-2 flex flex-col gap-2 pt-10">
{siteConfig.navMenuItems.map((item, index) => ( {siteConfig.humasMenuItems.map((item, index) => (
<NavbarMenuItem key={`${item}-${index}`}> <NavbarMenuItem key={`${item}-${index}`}>
<Link <Link
href={item.href} href={item.href}

View File

@ -1,17 +1,22 @@
'use client' 'use client'
import { Input } from '@nextui-org/input'; import { Input } from '@nextui-org/input';
import { Navbar, NavbarContent, NavbarItem, NavbarMenuToggle } from '@nextui-org/navbar'; import { Navbar, NavbarContent, NavbarItem, NavbarMenu, NavbarMenuItem, NavbarMenuToggle } from '@nextui-org/navbar';
import { Button, Dropdown, DropdownItem, DropdownMenu, DropdownSection, DropdownTrigger, autocomplete } from '@nextui-org/react'; import { Button, Dropdown, DropdownItem, DropdownMenu, DropdownSection, DropdownTrigger, autocomplete } from '@nextui-org/react';
import Link from "next/link"; import Link from "next/link";
import { ChevronDownIcon, ChevronRightIcon, ChevronRightWhite, FbIcon, IdnIcon, IgIcon, SearchIcon, TtIcon, TwIcon, YtIcon } from '../icons'; import { ChevronDownIcon, ChevronRightIcon, ChevronRightWhite, ChevronUpIcon, FbIcon, IdnIcon, IgIcon, SearchIcon, TtIcon, TwIcon, YtIcon } from '../icons';
import { ThemeSwitch } from '../theme-switch'; import { ThemeSwitch } from '../theme-switch';
import Image from 'next/image'; import Image from 'next/image';
import { siteConfig } from '@/config/site';
import { useState } from 'react';
export default function NavbarHumas() { export default function NavbarHumas() {
const handleClick = () => { const [dropdownOpen, setDropdownOpen] = useState(false);
console.log('Link clicked!');
const toggleDropdown = () => {
setDropdownOpen(!dropdownOpen);
}; };
const searchInput = ( const searchInput = (
<Input <Input
aria-label="Search" aria-label="Search"
@ -241,6 +246,40 @@ export default function NavbarHumas() {
<NavbarContent className="sm:hidden basis-1 pl-4" justify="end"> <NavbarContent className="sm:hidden basis-1 pl-4" justify="end">
<ThemeSwitch /> <ThemeSwitch />
<NavbarMenuToggle /> <NavbarMenuToggle />
<NavbarMenu>
{/* {searchInput} */}
<div className="mt-1 flex flex-col gap-1">
{siteConfig.humasMenuItems.map((item, index) => (
<NavbarMenuItem key={`${item}-${index}`}>
{item.submenu ? (
<div>
<button onClick={toggleDropdown} className="flex items-center gap-2">
<span>{item.label}</span>
{dropdownOpen ? (
<ChevronUpIcon />
) : (
<ChevronDownIcon />
)}
</button>
{dropdownOpen && (
<div className="flex flex-col mt-1 ml-2 text-medium gap-1">
{item.submenu.map((subItem, subIndex) => (
<Link key={`${subItem}-${subIndex}`} href={subItem.href}>
{subItem.label}
</Link>
))}
</div>
)}
</div>
) : (
<Link href={item.href} >
{item.label}
</Link>
)}
</NavbarMenuItem>
))}
</div>
</NavbarMenu>
</NavbarContent> </NavbarContent>
</div> </div>
</Navbar> </Navbar>

View File

@ -25,40 +25,104 @@ export const siteConfig = {
href: "/about", href: "/about",
} }
], ],
navMenuItems: [ humasMenuItems: [
{ {
label: "Profile", key: "home",
href: "/profile", label: "Beranda",
href: "/",
}, },
{ {
label: "Dashboard", key: "about",
href: "/dashboard", label: "Tentang",
submenu: [
{
label: "Tentang Humas POLRI",
href: "/tentang-humas-polri"
}, },
{ {
label: "Projects", label: "Profile Pimpinan POLRI",
href: "/projects", href: "/visi-misi"
}, },
{ {
label: "Team", label: "Struktur Organisasi",
href: "/team", href: "/struktur-organisasi"
}, },
{ {
label: "Calendar", label: "Visi dan Misi",
href: "/calendar", href: "/visi-misi"
}, },
{ {
label: "Settings", label: "Tugas dan Fungsi",
href: "/settings", href: "/tugas-dan-fungsi"
}, },
{ {
label: "Help & Feedback", label: "Logo",
href: "/help-feedback", href: "#"
}
]
}, },
{ {
label: "Logout", key: "ppid",
href: "/logout", label: "Portal PPID",
href: "/portal-ppid",
},
{
key: "service",
label: "Pelayanan Masyarakat",
submenu: [
{
label: "Formulir Permohonan Informasi",
href: "/form-permohonan-informasi"
},
{
label: "Pelayanan SIM",
href: "/visi-misi"
},
{
label: "Pelayanan e-Rikkes SIM",
href: "/struktur-organisasi"
},
{
label: "Pelayanan Tes Psikologi SIM",
href: "/visi-misi"
},
{
label: "Pelayanan e-Avis",
href: "/tugas-dan-fungsi"
},
{
label: "Pelayanan Samsat Digital",
href: "#"
},
{
label: "Pelayanan SKCK",
href: "#"
},
{
label: "Pelayanan Propam Presisi",
href: "#"
},
{
label: "Pelayanan Dumas Presisi",
href: "#"
},
{
label: "Pelayanan Binmas",
href: "#"
},
{
label: "Wistle Blower System",
href: "#"
},
]
},
{
key: "contact",
label: "Kontak",
href: "/kontak-kami",
}, },
], ],
links: { links: {
github: "https://github.com/nextui-org/nextui", github: "https://github.com/nextui-org/nextui",
twitter: "https://twitter.com/getnextui", twitter: "https://twitter.com/getnextui",