2025-06-30 15:54:10 -04:00
|
|
|
"use client";
|
|
|
|
|
|
|
|
|
|
import React, { useState, useEffect } from 'react';
|
|
|
|
|
import classnames from 'classnames';
|
|
|
|
|
import Link from 'next/link';
|
|
|
|
|
import Button from './Button';
|
|
|
|
|
import Image from 'next/image';
|
2025-07-02 16:39:16 -04:00
|
|
|
import Dropdown from "./Dropdown";
|
|
|
|
|
|
|
|
|
|
export interface MenuItem {
|
|
|
|
|
title: string;
|
|
|
|
|
route?: string;
|
|
|
|
|
children?: MenuItem[];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const menuItems: MenuItem[] = [
|
|
|
|
|
{
|
|
|
|
|
title: "Employers",
|
|
|
|
|
children: [
|
|
|
|
|
{
|
|
|
|
|
title: "Employer Services",
|
|
|
|
|
route: "",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: "Self-Funded Plans",
|
|
|
|
|
route: "",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: "Control Health Care Costs",
|
|
|
|
|
route: "",
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: "Members",
|
|
|
|
|
children: [
|
|
|
|
|
{
|
|
|
|
|
title: "Find a Medical Provider",
|
|
|
|
|
route: "",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: "Obtain Rx Information",
|
|
|
|
|
route: "",
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: "Providers",
|
|
|
|
|
children: [
|
|
|
|
|
{
|
|
|
|
|
title: "Eligibility Lookup",
|
|
|
|
|
route: "",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: "Contact BBS",
|
|
|
|
|
route: "",
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: "Brokers",
|
|
|
|
|
route: "",
|
|
|
|
|
},
|
|
|
|
|
];
|
2025-06-30 15:54:10 -04:00
|
|
|
|
|
|
|
|
const Navbar = () => {
|
|
|
|
|
|
|
|
|
|
const [isScrolled, setIsScrolled] = useState(false);
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
const handleScroll = () => {
|
2025-07-01 14:17:13 -04:00
|
|
|
// Find pixels from top to bottom of "tag line" div
|
2025-07-01 16:56:24 -04:00
|
|
|
if (window.scrollY > 280) {
|
2025-06-30 15:54:10 -04:00
|
|
|
setIsScrolled(true);
|
|
|
|
|
} else {
|
|
|
|
|
setIsScrolled(false);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
window.addEventListener('scroll', handleScroll);
|
|
|
|
|
|
|
|
|
|
return () => {
|
|
|
|
|
window.removeEventListener('scroll', handleScroll);
|
|
|
|
|
};
|
|
|
|
|
}, []);
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<nav className="sticky top-0 left-0 z-50 hidden lg:flex justify-center">
|
|
|
|
|
<div className={classnames(
|
2025-07-01 16:56:24 -04:00
|
|
|
"w-11/12 bg-britton-neutral px-1 text-britton-dark rounded-b-3xl", {
|
|
|
|
|
"min-h-6 pb-1 border-b-2 border-x-2 border-britton-dark" : isScrolled,
|
|
|
|
|
"min-h-20 pb-4" : !isScrolled
|
2025-06-30 15:54:10 -04:00
|
|
|
}
|
|
|
|
|
)}
|
|
|
|
|
>
|
|
|
|
|
<div className="container mx-auto justify-between items-center flex">
|
2025-07-01 16:56:24 -04:00
|
|
|
<div className={classnames('rounded-b-3xl bg-britton-dark w-72', {"hidden" : isScrolled})}>
|
2025-06-30 15:54:10 -04:00
|
|
|
<Image
|
|
|
|
|
src="/images/bbstpa-forsite.png"
|
|
|
|
|
alt="Britton Logo"
|
|
|
|
|
width={273}
|
|
|
|
|
height={80}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
2025-07-02 16:39:16 -04:00
|
|
|
<div className={classnames('rounded-b-3xl py-2 bg-britton-dark font-semibold text-britton-neutral text-center text-lg uppercase w-72', {"hidden" : !isScrolled})}>
|
2025-07-01 16:56:24 -04:00
|
|
|
<Link href="/">
|
|
|
|
|
Britton Benefit Services
|
|
|
|
|
</Link>
|
|
|
|
|
</div>
|
2025-07-02 16:39:16 -04:00
|
|
|
{/* <ul className={classnames("flex space-x-4 font-semibold text-lg uppercase", {"pl-2" : isScrolled})}>
|
2025-06-30 15:54:10 -04:00
|
|
|
<li>
|
|
|
|
|
<Link href="/services" className="hover:text-britton-light">
|
|
|
|
|
Employers
|
|
|
|
|
</Link>
|
|
|
|
|
</li>
|
|
|
|
|
<li>
|
|
|
|
|
<Link href="/contact" className="hover:text-britton-light">
|
|
|
|
|
Members
|
|
|
|
|
</Link>
|
|
|
|
|
</li>
|
|
|
|
|
<li>
|
|
|
|
|
<Link href="/contact" className="hover:text-britton-light">
|
|
|
|
|
Providers
|
|
|
|
|
</Link>
|
|
|
|
|
</li>
|
|
|
|
|
<li>
|
|
|
|
|
<Link href="/contact" className="hover:text-britton-light">
|
|
|
|
|
Brokers
|
|
|
|
|
</Link>
|
|
|
|
|
</li>
|
|
|
|
|
<li>
|
|
|
|
|
<Link href="/contact" className="hover:text-britton-light">
|
|
|
|
|
Contact Us
|
|
|
|
|
</Link>
|
|
|
|
|
</li>
|
2025-07-02 16:39:16 -04:00
|
|
|
</ul> */}
|
|
|
|
|
<div className={classnames("flex space-x-4 font-semibold text-lg uppercase", {"pl-2" : isScrolled})}>
|
|
|
|
|
{menuItems.map((item) => {
|
|
|
|
|
return item.hasOwnProperty("children") ?
|
|
|
|
|
(
|
|
|
|
|
<Dropdown item={item} />
|
|
|
|
|
) : (
|
|
|
|
|
<Link className="hover:text-britton-light" href={item?.route || ""}>
|
|
|
|
|
{item.title}
|
|
|
|
|
</Link>
|
|
|
|
|
);
|
|
|
|
|
})}
|
|
|
|
|
</div>
|
2025-07-01 16:56:24 -04:00
|
|
|
<div className={classnames("flex space-x-2 font-semibold", {"pt-1" : isScrolled})}>
|
|
|
|
|
<Button className="bg-britton-neutral text-britton-accent2 hover:text-britton-accent py-1 px-4 rounded border-1 border-britton-accent2 hover:border-britton-accent">
|
2025-06-30 15:54:10 -04:00
|
|
|
Sign In
|
|
|
|
|
</Button>
|
|
|
|
|
<Button className="bg-britton-dark hover:bg-britton-medium text-britton-light py-1 px-4 rounded">
|
|
|
|
|
Get a Quote
|
|
|
|
|
</Button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</nav>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default Navbar;
|