frontend: fix mouse event listener

This commit is contained in:
2025-06-29 11:04:31 +03:00
parent 5c9d8de03d
commit ae8a3643a4
3 changed files with 8 additions and 4 deletions

View File

@ -64,4 +64,6 @@ jobs:
context: . context: .
file: Dockerfile file: Dockerfile
push: true push: true
tags: ${{ secrets.DOCKER_REGISTRY }}/taqi/portfolio/my-portfolio-app:latest tags:
- ${{ secrets.DOCKER_REGISTRY }}/taqi/portfolio/my-portfolio-app:latest
- ${{ secrets.DOCKER_REGISTRY }}/taqi/portfolio/my-portfolio-app:1.0.0-${{ gitea.run_number }}

View File

@ -35,11 +35,13 @@ const Navbar: React.FC<NavProps> = ({ toggleDarkMode, darkMode }) => {
} }
} }
if (isMenuOpen) {
document.addEventListener('mousedown', handleClickoutside) document.addEventListener('mousedown', handleClickoutside)
}
return () => { return () => {
document.removeEventListener('mousedown', handleClickoutside) document.removeEventListener('mousedown', handleClickoutside)
} }
}) }, [isMenuOpen])
const menuItem = [ const menuItem = [
{ title: 'Home', href: '/' }, { title: 'Home', href: '/' },

View File

@ -1 +1 @@
{"root":["./src/App.tsx","./src/main.tsx","./src/vite-env.d.ts","./src/components/Introduction.tsx","./src/components/Navbar.tsx","./src/components/Photo.tsx","./src/components/Skills.tsx"],"version":"5.6.2"} {"root":["./src/App.tsx","./src/constants.tsx","./src/main.tsx","./src/vite-env.d.ts","./src/components/Footer.tsx","./src/components/Introduction.tsx","./src/components/Navbar.tsx","./src/components/Photo.tsx","./src/components/Sidebar.tsx","./src/components/Skills.tsx","./src/components/Tooltip.tsx","./src/pages/Experience.tsx","./src/pages/Home.tsx","./src/pages/Interests.tsx","./src/pages/Projects.tsx"],"version":"5.6.2"}