SaaSHub
import { useState, useEffect } from "react";
import { Link, useLocation } from "wouter";
import { Button } from "@/components/ui/button";
export function Header() {
const [isScrolled, setIsScrolled] = useState(false);
const [location] = useLocation();
useEffect(() => {
const handleScroll = () => {
setIsScrolled(window.scrollY > 10);
};
window.addEventListener("scroll", handleScroll);
return () => window.removeEventListener("scroll", handleScroll);
}, []);
const isActive = (path: string) => location === path;
return (
);
}
No comments:
Post a Comment