|
1 | | -"use client" |
2 | | -import Image from "next/image" |
3 | | -import { Button } from "../ui/button" |
4 | | -import Link from "next/link" |
5 | | -import { useState, useEffect } from "react" |
6 | | -import { Menu, X } from "lucide-react" |
| 1 | +"use client"; |
| 2 | +import Image from "next/image"; |
| 3 | +import { Button } from "../ui/button"; |
| 4 | +import Link from "next/link"; |
| 5 | +import { useState, useEffect } from "react"; |
| 6 | +import { Menu, X } from "lucide-react"; |
7 | 7 |
|
8 | 8 | const Header = () => { |
9 | | - const [scroll, setScroll] = useState(false) |
10 | | - const [isOpen, setIsOpen] = useState(false) |
| 9 | + const [scroll, setScroll] = useState(false); |
| 10 | + const [isOpen, setIsOpen] = useState(false); |
11 | 11 |
|
12 | 12 | useEffect(() => { |
13 | 13 | const handleScroll = () => { |
14 | | - setScroll(window.scrollY > 20) |
15 | | - } |
16 | | - document.addEventListener("scroll", handleScroll) |
17 | | - return () => document.removeEventListener("scroll", handleScroll) |
18 | | - }, []) |
| 14 | + setScroll(window.scrollY > 20); |
| 15 | + }; |
| 16 | + document.addEventListener("scroll", handleScroll); |
| 17 | + return () => document.removeEventListener("scroll", handleScroll); |
| 18 | + }, []); |
19 | 19 |
|
20 | 20 | return ( |
21 | 21 | <header |
@@ -114,7 +114,7 @@ const Header = () => { |
114 | 114 | </div> |
115 | 115 | )} |
116 | 116 | </header> |
117 | | - ) |
118 | | -} |
| 117 | + ); |
| 118 | +}; |
119 | 119 |
|
120 | | -export default Header |
| 120 | +export default Header; |
0 commit comments