Skip to content

Commit

Permalink
[fix] 네비게이션 아이콘 수정 및 채팅 삭제
Browse files Browse the repository at this point in the history
  • Loading branch information
zestlee1106 committed Oct 19, 2023
1 parent 99e1802 commit 53fb47c
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 20 deletions.
20 changes: 7 additions & 13 deletions components/Nav/Nav.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -17,40 +16,35 @@ const menus = [
{
name: 'Rooms',
icon: Home,
},
{
name: 'Chat',
icon: Chat,
router: '/',
},
{
name: 'Liked',
icon: Like,
router: '/liked',
},
{
name: 'My',
icon: Me,
router: '/userInfo',
},
];

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 (
<div className={`${styles.container} grid grid-cols-4 bg-g0 w-full h-[66px] text-center`}>
<div className={`${styles.container} grid grid-cols-${menus.length} bg-g0 w-full h-[66px] text-center`}>
{menus.map((menu, index) => {
const IconComponent = menu.icon;

return (
<div
className="my-[9px] align-middle items-center cursor-pointer"
Expand Down
5 changes: 3 additions & 2 deletions public/icons/home.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions public/icons/like.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions public/icons/me.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 53fb47c

Please sign in to comment.