-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
394 additions
and
68 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import { Bars3Icon, BellIcon, ChevronDownIcon } from "@heroicons/react/24/outline"; | ||
import { Link } from "react-router-dom"; | ||
import { Menu } from "@headlessui/react"; // Import from Headless UI | ||
import logo from "../assets/logo.png"; | ||
import profile from "../assets/profile.png"; | ||
|
||
const Navbar = ({ onSidebarToggle }) => { | ||
const userNavigation = [ | ||
{ name: "Profile", href: "#" }, | ||
{ name: "Settings", href: "#" }, | ||
{ name: "Log out", href: "/login" }, | ||
]; | ||
|
||
return ( | ||
<header className="bg-white border-b border-gray-200"> | ||
<div className="flex justify-between items-center px-4 py-4"> | ||
<div className="flex items-center"> | ||
<button onClick={onSidebarToggle} className="lg:hidden"> | ||
<Bars3Icon className="h-6 w-6" /> | ||
</button> | ||
<img src={logo} alt="Logo" className="h-8 w-auto ml-4" /> | ||
</div> | ||
<div className="flex items-center gap-4"> | ||
<button> | ||
<BellIcon className="h-6 w-6 text-gray-500" /> | ||
</button> | ||
<Menu as="div" className="relative"> | ||
<div> | ||
<Menu.Button className="flex items-center space-x-2"> | ||
<img src={profile} alt="Profile" className="h-8 w-8 rounded-full" /> | ||
<ChevronDownIcon className="h-5 w-5 text-gray-500" /> | ||
</Menu.Button> | ||
</div> | ||
<Menu.Items className="absolute right-0 mt-2 w-48 bg-white shadow-lg"> | ||
{userNavigation.map((item) => ( | ||
<Menu.Item key={item.name}> | ||
{({ active }) => ( | ||
<Link | ||
to={item.href} | ||
className={`block px-4 py-2 text-gray-700 ${ | ||
active ? "bg-gray-100" : "" | ||
}`} | ||
> | ||
{item.name} | ||
</Link> | ||
)} | ||
</Menu.Item> | ||
))} | ||
</Menu.Items> | ||
</Menu> | ||
</div> | ||
</div> | ||
</header> | ||
); | ||
}; | ||
|
||
export default Navbar; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
// // Sidebar.jsx | ||
// import { Link } from "react-router-dom"; | ||
// import { ChevronDownIcon, ChevronUpIcon } from "@heroicons/react/24/outline"; | ||
// import { useState } from "react"; | ||
// import logo from "../assets/logo.png"; | ||
// import { navigation } from "../pages/navigationData"; // Externalized navigation data | ||
|
||
// const Sidebar = ({ isOpen }) => { | ||
// const [openDropdown, setOpenDropdown] = useState(null); | ||
|
||
// const toggleDropdown = (name) => { | ||
// setOpenDropdown(openDropdown === name ? null : name); | ||
// }; | ||
|
||
// return ( | ||
// <div className={`lg:flex ${isOpen ? "block" : "hidden"} w-72 bg-white`}> | ||
// <div className="flex flex-col h-screen border-r border-gray-200 px-6"> | ||
// <div className="flex items-center h-16"> | ||
// <img src={logo} alt="Logo" className="h-8 w-auto" /> | ||
// </div> | ||
// <nav className="flex-1 overflow-y-auto"> | ||
// <ul className="space-y-7"> | ||
// {navigation.map((item) => ( | ||
// <li key={item.name}> | ||
// <Link to={item.href} className="flex items-center gap-x-3 p-2 rounded-md hover:bg-gray-100"> | ||
// <img src={item.icon} alt={item.name} className="h-6 w-6" /> | ||
// <span>{item.name}</span> | ||
// {item.hasDropdown && ( | ||
// <button onClick={() => toggleDropdown(item.name)}> | ||
// {openDropdown === item.name ? ( | ||
// <ChevronUpIcon className="w-5 h-5" /> | ||
// ) : ( | ||
// <ChevronDownIcon className="w-5 h-5" /> | ||
// )} | ||
// </button> | ||
// )} | ||
// </Link> | ||
// {item.hasDropdown && openDropdown === item.name && ( | ||
// <ul className="ml-8 mt-2 space-y-1"> | ||
// {item.children.map((subItem) => ( | ||
// <li key={subItem.name}> | ||
// <Link to={subItem.href} className="block p-2 hover:bg-gray-100"> | ||
// {subItem.name} | ||
// </Link> | ||
// </li> | ||
// ))} | ||
// </ul> | ||
// )} | ||
// </li> | ||
// ))} | ||
// </ul> | ||
// </nav> | ||
// </div> | ||
// </div> | ||
// ); | ||
// }; | ||
|
||
// export default Sidebar; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.