Skip to content

Commit

Permalink
Merge pull request #33 from denlove/FM-32
Browse files Browse the repository at this point in the history
FM-32: fix NavBar desappearing when relocate
  • Loading branch information
denlove authored Jun 19, 2024
2 parents eb62345 + 25091f7 commit c38b7c5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/components/NavBar/NavBar.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
'use client'

import { useState } from 'react'
import { useEffect, useState } from 'react'
import c from 'classnames'
import { usePathname } from 'next/navigation'
import { navLinks } from './helpers/navLinks'
import ListItem from '@/ui/ListItem/ListItem'
import BurgerButton from './components/BurgerButton/BurgerButton'
Expand All @@ -10,6 +11,11 @@ import style from './NavBar.module.scss'

const NavBar = () => {
const [toggleMenu, setToggleMenu] = useState<boolean>(false)
const pathname = usePathname()

useEffect(() => {
setToggleMenu(false)
}, [pathname])

return (
<div className={style['navbar-wrapper']}>
Expand Down

0 comments on commit c38b7c5

Please sign in to comment.