import React, { FC, ReactNode } from 'react' import { css } from 'styled-components' import { ZIndexNodeName, zIndexValue } from '@monorail/helpers/zIndex' import { PopOverChildProps } from '@monorail/metaComponents/popOver/PopOver' import { IconType } from '@monorail/visualComponents/icon/IconType' import { BBModalBackground, BBModalHeader, fullScreenModalCloseAnimation, fullScreenModalOpenAnimation, modalAnimationDuration, useModalAnimation, } from '@monorail/visualComponents/modals/Modals' import { ModalSize } from '@monorail/visualComponents/modals/modalTypes' import { Overlay } from '@monorail/visualComponents/toggle/Overlay' type Props = Omit & { customCloseButton?: ReactNode headerChildren?: ReactNode title?: string escToClose?: boolean iconLeft?: IconType noHeader?: boolean zIndex?: number } export const FullScreenModal: FC = props => { const { children, customCloseButton, escToClose = true, headerChildren, iconLeft = '', isOpen, noHeader = false, onClick, title = '', togglePopOver, closingAnimationCompleted, zIndex = zIndexValue(ZIndexNodeName.Modal), ...otherProps } = props const { modalBackgroundRef, isRendered } = useModalAnimation({ closingAnimationCompleted, isOpen, }) return ( {!noHeader && ( )} {children} ) }