Responsive done for computer screens
This commit is contained in:
+18
-11
@@ -74,13 +74,18 @@ export interface MenuItem {
|
||||
// },
|
||||
// ];
|
||||
|
||||
const Navbar = () => {
|
||||
interface NavbarProps {
|
||||
collapseHeight: number;
|
||||
}
|
||||
|
||||
const Navbar: React.FC<NavbarProps> = ({ collapseHeight }) => {
|
||||
const [isScrolled, setIsScrolled] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
const handleScroll = () => {
|
||||
const subtractedHeight = window.innerHeight - 80;
|
||||
if (window.scrollY > subtractedHeight) {
|
||||
// const subtractedHeight = window.innerHeight - 80;
|
||||
const subtractedHeight = window.innerHeight - collapseHeight;
|
||||
if (window.scrollY > collapseHeight) {
|
||||
setIsScrolled(true);
|
||||
} else {
|
||||
setIsScrolled(false);
|
||||
@@ -105,12 +110,14 @@ const Navbar = () => {
|
||||
>
|
||||
<div className="w-full px-3 justify-between items-center flex">
|
||||
<div className={classnames('rounded-b-2xl bg-deepcove w-72', {"hidden" : isScrolled})}>
|
||||
<Image
|
||||
src="/images/bbstpa-forsite.png"
|
||||
alt="Britton Logo"
|
||||
width={205}
|
||||
height={60}
|
||||
/>
|
||||
<Link href="/">
|
||||
<Image
|
||||
src="/images/bbstpa-forsite.png"
|
||||
alt="Britton Logo"
|
||||
width={205}
|
||||
height={60}
|
||||
/>
|
||||
</Link>
|
||||
</div>
|
||||
<div className={classnames('rounded-b-2xl py-2 mb-1 bg-deepcove font-semibold text-platinum text-center text-lg uppercase w-72', {"hidden" : !isScrolled})}>
|
||||
<Link href="/">
|
||||
@@ -129,12 +136,12 @@ const Navbar = () => {
|
||||
</Link>
|
||||
</li>
|
||||
<li>
|
||||
<Link href="/" className="hover:text-bluemana">
|
||||
<Link href="/providers" className="hover:text-bluemana">
|
||||
Providers
|
||||
</Link>
|
||||
</li>
|
||||
<li>
|
||||
<Link href="/" className="hover:text-bluemana">
|
||||
<Link href="/brokers" className="hover:text-bluemana">
|
||||
Brokers
|
||||
</Link>
|
||||
</li>
|
||||
|
||||
Reference in New Issue
Block a user