diff --git a/src/components/Modal.tsx b/src/components/Modal.tsx index b662750b..f8522a4d 100644 --- a/src/components/Modal.tsx +++ b/src/components/Modal.tsx @@ -1,12 +1,6 @@ // this is just styling, actual modal logic is in ModalWrapper -import { - type ReactNode, - type Ref, - forwardRef, - useCallback, - useEffect, -} from 'react' +import { type ReactNode, type Ref, forwardRef, useCallback } from 'react' import styled, { type StyledComponentPropsWithRef, @@ -19,15 +13,13 @@ import * as Dialog from '@radix-ui/react-dialog' import { type ColorKey, type Nullable, type SeverityExt } from '../types' -import useLockedBody from '../hooks/useLockedBody' - +import Card from './Card' import CheckRoundedIcon from './icons/CheckRoundedIcon' import type createIcon from './icons/createIcon' import ErrorIcon from './icons/ErrorIcon' import InfoIcon from './icons/InfoIcon' import WarningIcon from './icons/WarningIcon' import { ModalWrapper, type ModalWrapperProps } from './ModalWrapper' -import Card from './Card' export const SEVERITIES = [ 'info', @@ -49,7 +41,6 @@ type ModalPropsType = ModalWrapperProps & { header?: ReactNode actions?: ReactNode severity?: ModalSeverity - lockBody?: boolean asForm?: boolean formProps?: StyledComponentPropsWithRef<'form'> } @@ -151,7 +142,6 @@ function ModalRef( size = form ? 'large' : 'medium', onClose, severity, - lockBody = true, asForm = false, formProps = {}, scrollable = true, @@ -163,12 +153,6 @@ function ModalRef( const HeaderIcon = severityToIcon[severity ?? 'default'] const iconColorKey = severityToIconColorKey[severity ?? 'default'] - const [, setBodyLocked] = useLockedBody(open && lockBody) - - useEffect(() => { - setBodyLocked(lockBody && open) - }, [lockBody, open, setBodyLocked]) - const triggerClose = useCallback( (open: boolean) => { if (!open) onClose?.()