diff --git a/components/Nav/Nav.tsx b/components/Nav/Nav.tsx index 1872e30..c868403 100644 --- a/components/Nav/Nav.tsx +++ b/components/Nav/Nav.tsx @@ -1,7 +1,6 @@ import React, { useState } from 'react'; import Like from '@/public/icons/like.svg'; import Home from '@/public/icons/home.svg'; -import Chat from '@/public/icons/chat.svg'; import Me from '@/public/icons/me.svg'; import { useRouter } from 'next/router'; import styles from './Nav.module.scss'; @@ -17,18 +16,17 @@ const menus = [ { name: 'Rooms', icon: Home, - }, - { - name: 'Chat', - icon: Chat, + router: '/', }, { name: 'Liked', icon: Like, + router: '/liked', }, { name: 'My', icon: Me, + router: '/userInfo', }, ]; @@ -36,21 +34,17 @@ export default function Nav({ initMenu }: NavProps) { const [activeMenu, setActiveMenu] = useState(initMenu || 0); // 초기 활성 메뉴 인덱스 const [hoverMenu, setHoverMenu] = useState(-1); // 초기화 const router = useRouter(); + const handleNavClicked = (index: number) => { setActiveMenu(index); - if (index === 0) { - router.push('/'); - } else if (index === 2) { - router.push('/liked'); - } else if (index === 3) { - router.push('userInfo'); - } + router.push(menus[index].router); }; return ( -
+
{menus.map((menu, index) => { const IconComponent = menu.icon; + return (
- + + + diff --git a/public/icons/like.svg b/public/icons/like.svg index e864d85..bad6946 100644 --- a/public/icons/like.svg +++ b/public/icons/like.svg @@ -1,3 +1,3 @@ - - + + diff --git a/public/icons/me.svg b/public/icons/me.svg index d70528c..f5894a6 100644 --- a/public/icons/me.svg +++ b/public/icons/me.svg @@ -1,3 +1,3 @@ - - - + + + \ No newline at end of file