Skip to content

Commit

Permalink
BottomSheet useClickOutside 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
baegofda committed Nov 2, 2024
1 parent d615d83 commit 41c0ccc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/core/components/BottomSheet/index.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { X } from '@phosphor-icons/react';
import clsx from 'clsx';
import { PropsWithChildren, forwardRef } from 'react';
import { forwardRef, PropsWithChildren } from 'react';

import { useBlockScrollingEffect } from '@/hooks/effects/useBlockScrollingEffect';
import ModalBase from '../Modal/ModalBase';
import { VARIANTS } from '../Modal/ModalBase/constants';
import Section from '../Section';
import { BottomSheetProps } from './types';
import useClickOutside from '@/hooks/useClickOutSide';

const BottomSheet = forwardRef(
(
Expand All @@ -19,6 +20,7 @@ const BottomSheet = forwardRef(
}: PropsWithChildren<BottomSheetProps>,
ref: React.Ref<HTMLDialogElement>,
) => {
const { contentRef } = useClickOutside<HTMLDivElement>(onClose);
const { target, className, ...rest } = props;
const CloseIcon = <X size='24' fill='#343330' />;

Expand All @@ -38,6 +40,7 @@ const BottomSheet = forwardRef(
'h-full animate-bottom-sheet rounded-t-xl p-4',
className,
)}
ref={contentRef}
hasRounded={false}
hasShadow
>
Expand Down

0 comments on commit 41c0ccc

Please sign in to comment.