Skip to content

Commit

Permalink
Revert "[#524] Menu 컴포넌트 개선 (#525)"
Browse files Browse the repository at this point in the history
This reverts commit 52687da.
  • Loading branch information
gxxrxn authored Aug 20, 2024
1 parent 40cd0fc commit b782bec
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 49 deletions.
42 changes: 0 additions & 42 deletions src/hooks/useOutsideClickRef.ts

This file was deleted.

9 changes: 2 additions & 7 deletions src/v1/base/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ import {
useMemo,
useState,
} from 'react';

import { IconHamburger } from '@public/icons';
import useOutsideClickRef from '@/hooks/useOutsideClickRef';

import BottomSheet from './BottomSheet';

type MenuContextValue = {
Expand All @@ -26,10 +23,8 @@ const Menu = ({ children }: { children?: React.ReactNode }) => {
const toggle = useCallback(() => setOpen(prev => !prev), []);
const value = useMemo(() => ({ isOpen, toggle }), [isOpen, toggle]);

const ref = useOutsideClickRef<HTMLDivElement>(() => setOpen(false));

return (
<div className="relative" ref={ref}>
<div className="relative">
<MenuContext.Provider value={value}>{children}</MenuContext.Provider>
</div>
);
Expand Down Expand Up @@ -62,7 +57,7 @@ const DropdownList = ({ children }: { children?: React.ReactNode }) => {
return (
<>
{isOpen && (
<ul className="absolute right-0 top-[3rem] z-50 min-w-[10rem] rounded-[0.5rem] bg-white py-[0.5rem] shadow-[0_0_15px_rgba(0,0,0,0.05),0_1px_2px_rgba(0,0,0,0.1)]">
<ul className="absolute right-0 top-[3rem] min-w-[10rem] rounded-[0.5rem] py-[0.5rem] shadow-[0_0_15px_rgba(0,0,0,0.05),0_1px_2px_rgba(0,0,0,0.1)]">
{children}
</ul>
)}
Expand Down

0 comments on commit b782bec

Please sign in to comment.