Skip to content

Commit

Permalink
refactor: DrawerMenu 컴포넌트를 범용적으로 사용할 수 있도록 추가 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
ccwnc committed Apr 15, 2024
1 parent 03ae082 commit 8847a63
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/components/header/DrawerMenu/index.tsx
Original file line number Diff line number Diff line change
@@ -1,29 +1,28 @@
import classNames from 'classnames/bind';

import { GAME_NAME_LIST_EN, SVGS } from '@/constants/index';

import { formatGameToLink } from '@/utils/index';
import { SVGS } from '@/constants/index';

import styles from './DrawerMenu.module.scss';

const cx = classNames.bind(styles);
const { url, alt } = SVGS.close.active;

type DrawerMenuProps = {
menuList: string[];
onClick: () => void;
};

const DrawerMenu = ({ onClick }: DrawerMenuProps) => {
const DrawerMenu = ({ menuList, onClick }: DrawerMenuProps) => {
return (
<aside className={cx('drawer-menu')}>
<button className={cx('drawer-menu-close-button')} onClick={onClick}>
<img src={url} alt={alt} width={24} height={24} />
</button>
<nav>
<ul className={cx('drawer-menu-game')}>
{GAME_NAME_LIST_EN.map((game, index) => (
{menuList.map((game, index) => (
<li className={cx('drawer-menu-game-item')} key={`game-${index}`}>
<a className={cx('drawer-menu-game-link')} onClick={onClick} href={`/${formatGameToLink(game)}`}>
<a className={cx('drawer-menu-game-link')} onClick={onClick} href={`/${game}`}>
{game}
</a>
</li>
Expand Down

0 comments on commit 8847a63

Please sign in to comment.