Skip to content

Commit

Permalink
Remove unused state and event listener in Header component
Browse files Browse the repository at this point in the history
  • Loading branch information
YousifAbozid committed Feb 29, 2024
1 parent 6e373d5 commit 784506f
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions components/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,15 @@ import links from '@/data/linksArray'
*/
const Header = () => {
const [showMenu, setShowMenu] = useState(false)
const [isToggling, setIsToggling] = useState(false)
const menuRef = useRef(null)

const handleLinkClick = () => {
setShowMenu(false) // Close menu when a link is clicked
}

const toggleMenu = () => {
if (!isToggling) {
setIsToggling(true)
setShowMenu((prevState) => !prevState)

setTimeout(() => {
setIsToggling(false)
}, 500)
}
setShowMenu((prevState) => !prevState)
document.removeEventListener('touchstart', handleClickOutside)
}

useEffect(() => {
Expand Down

0 comments on commit 784506f

Please sign in to comment.