import { noop } from "lodash"; import { Button, Text, View, VStack } from "native-base"; import React, { FC, ReactNode, useCallback } from "react"; import { Platform } from "react-native"; import { Dialog as NBModal } from "react-native-paper"; export interface BasicModalProps { modalVisible: boolean; header?: ReactNode; body: ReactNode; footer?: ReactNode; actionText?: string; closeText?: string; hasCloseButton?: boolean; hasTopBorder?: boolean; hasBottomBorder?: boolean; bgColor?: string; type?: string; withOverlay?: string; onClose?: () => void; onAction?: () => void; _modal?: any; _modalContainer?: any; _body?: any; _footer?: any; _header?: any; } const BasicModal: FC = ({ modalVisible, header, body, footer, actionText, closeText, hasCloseButton = !!closeText, hasTopBorder = false, hasBottomBorder = true, onClose = noop, onAction = noop, // eslint-disable-next-line @typescript-eslint/no-unused-vars withOverlay = false, bgColor = "white", _modal = {}, _modalContainer = {}, _header, _body = {}, _footer }) => { const onActionButtonPress = useCallback(() => { onAction(); onClose(); }, [onAction, onClose]); const actionButton = actionText ? : null; return modalVisible ? ( {hasCloseButton ? ( ) : null} {header ? ( {header} ) : null} {body} {footer ? ( {footer} {actionButton ? {actionButton} : null} ) : null} ) : null; }; export default BasicModal;