diff --git a/src/components/Modal/ImageModal.client.tsx b/src/components/Modal/ImageModal.client.tsx deleted file mode 100644 index ca5eb363..00000000 --- a/src/components/Modal/ImageModal.client.tsx +++ /dev/null @@ -1,18 +0,0 @@ -import Image from 'next/image'; - -import ModalWrapper from './ModalWrapper'; - -interface ImageModalProps { - image: string; - onClose: () => void; -} - -export default function ImageModal({ image, onClose }: ImageModalProps) { - return ( - -
- fullImage -
-
- ); -} diff --git a/src/components/Modal/ModalWrapper.tsx b/src/components/Modal/ModalWrapper.tsx deleted file mode 100644 index b7f867ab..00000000 --- a/src/components/Modal/ModalWrapper.tsx +++ /dev/null @@ -1,39 +0,0 @@ -'use client'; -import { motion } from 'framer-motion'; -import { useRef } from 'react'; - -import { useOnClickOutside } from '@/hooks/useOnClickOutside'; -import cn from '@/utils/cn'; - -import type { StrictPropsWithChildren } from '@/types'; - -interface ModalWrapperProps { - onClose?: () => void; - className?: string; -} - -export default function ModalWrapper({ - onClose = () => {}, - className, - children, -}: StrictPropsWithChildren) { - const modalRef = useRef(null); - - useOnClickOutside(modalRef, onClose); - - return ( - -
- {children} -
-
- ); -} diff --git a/src/hooks/useOnClickOutside.ts b/src/hooks/useOnClickOutside.ts deleted file mode 100644 index 44a1d18c..00000000 --- a/src/hooks/useOnClickOutside.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { useEffect } from 'react'; - -export function useOnClickOutside( - ref: React.RefObject, - handler: (event: MouseEvent | TouchEvent) => void -) { - useEffect(() => { - const listener = (event: MouseEvent | TouchEvent) => { - event.stopPropagation(); - if (!ref.current || ref.current.contains(event.target as Node)) { - return; - } - - handler(event); - }; - - document.addEventListener('mousedown', listener); - document.addEventListener('touchstart', listener); - - return () => { - document.removeEventListener('mousedown', listener); - document.removeEventListener('touchstart', listener); - }; - }, [ref, handler]); -}