Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
"@babel/plugin-transform-private-methods": "^7.25.4",
"@eslint/config-array": "^0.18.0",
"@eslint/object-schema": "^2.1.4",
"@fortawesome/free-solid-svg-icons": "^6.7.1",
"@fortawesome/react-fontawesome": "^0.2.2",
"@headlessui/react": "^2.1.8",
"@heroicons/react": "^2.1.5",
"@hookform/error-message": "^2.0.1",
Expand All @@ -14,6 +16,7 @@
"@testing-library/react": "^16.0.1",
"@testing-library/user-event": "^14.5.2",
"amqplib": "^0.10.4",
"aos": "^2.3.4",
"bootstrap": "^5.3.3",
"cookie": "^0.7.1",
"glob": "^11.0.0",
Expand Down
Binary file added src/images/Logo_transparentbg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
96 changes: 50 additions & 46 deletions src/shared/components/Navigation/MainNavigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,74 +5,78 @@
import { useAuth } from "../../../context/AuthContext.tsx";

export default function MainNavigation() {

const { auth } = useAuth();

const location = useLocation().pathname;

const routes = auth.isAuthenticated
? [
{ name: "Jobs", href: "/jobs", current: true },
{ name: "Create", href: "/create", current: false },
{ name: "Staff", href: "/staff", current: false },
{ name: "Profile", href: "/profile", current: false },
{ name: "Sign Out", href: "/signout", current: false },
]
{ name: "Jobs", href: "/jobs", current: location === "/jobs" },
{ name: "Create", href: "/create", current: location === "/create" },
{ name: "Staff", href: "/staff", current: location === "/staff" },
{ name: "Profile", href: "/profile", current: location === "/profile" },
{ name: "Sign Out", href: "/signout", current: false },
]
: [{ name: "Sign In", href: "/signin", current: false }];

return (
<Disclosure as="nav" className="bg-slate-100">
<Disclosure as="nav" className="bg-white shadow-md sticky top-0 z-50">
{({ open }) => (
<>
<div className="mainnav sm:px-6 lg:px-8">
<div className="mainnav-header">
<div className="mainnav-desc sm:hidden">
{/* Mobile menu button*/}
<Disclosure.Button className="btn-disclosure hover:bg-gray-700 hover:text-white focus:outline-none focus:ring-2 focus:ring-inset focus:ring-white">
<span className="absolute -inset-0.5" />
<div className="container mx-auto px-4 sm:px-6 lg:px-8">
<div className="flex justify-between items-center h-16">
{/* Logo */}
<div className="flex-shrink-0">
<Link to="/" className="text-2xl font-bold text-blue-600 hover:text-blue-800 transition-all duration-200">
LabConnect
</Link>
</div>

{/* Desktop Navigation */}
<div className="hidden sm:flex sm:items-center">
<div className="flex space-x-8">
{routes.map((item) => (
<NavLink
key={item.name}
to={item.href}
className={({ isActive }) =>

Check failure on line 41 in src/shared/components/Navigation/MainNavigation.tsx

View workflow job for this annotation

GitHub Actions / eslint

'isActive' is defined but never used
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like it's missing isActive

location === item.href
? "text-blue-600 font-semibold border-b-2 border-blue-600"
: "text-gray-600 hover:text-blue-600 transition-all duration-200"
}
>
{item.name}
</NavLink>
))}
</div>
</div>

{/* Mobile Menu Button */}
<div className="flex sm:hidden">
<Disclosure.Button className="inline-flex items-center justify-center p-2 rounded-md text-gray-600 hover:text-white hover:bg-blue-600 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-blue-500 transition-all duration-200">
<span className="sr-only">Open main menu</span>
{open ? (
<XMarkIcon className="blck66" aria-hidden="true" />
<XMarkIcon className="block h-6 w-6" aria-hidden="true" />
) : (
<Bars3Icon className="blck66" aria-hidden="true" />
<Bars3Icon className="block h-6 w-6" aria-hidden="true" />
)}
</Disclosure.Button>
</div>
<div className="mainnav-desc2 sm:items-stretch sm:justify-start">
<div className="mainnav-title-link">
<Link to="/" className="blue-link hover:text-blue-900 focus:text-blue-900">
LabConnect
</Link>
</div>
<div className="hidden sm:ml-6 sm:block">
<div className="flex space-x-4 ">
{routes.map((item) => (
<NavLink
key={item.name}
to={item.href}
className={`${location === item.href
? "text-black"
: "text-gray-600"
} hover:text-gray-800 hover:bg-gray-200 mainnav-link`}
aria-current={item.current}
>
{item.name}
</NavLink>
))}
</div>
</div>
</div>
</div>
</div>

{/* Mobile Navigation */}
<Disclosure.Panel className="sm:hidden">
<div className="space-y-1 px-2 pb-3 pt-2">
<div className="space-y-1 px-4 pt-2 pb-3">
{routes.map((item) => (
<Disclosure.Button
key={item.name}
as="a"
href={item.href}
className="btn-disclosure2 hover:bg-gray-200"
aria-current={item.current ? "page" : undefined}
as={Link}
to={item.href}
className={`${
location === item.href
? "block text-blue-600 font-semibold py-2 border-l-4 border-blue-600 pl-4 transition-all duration-200"
: "block text-gray-600 hover:text-blue-600 py-2 pl-4 transition-all duration-200"
}`}
>
{item.name}
</Disclosure.Button>
Expand Down
Loading
Loading