import { StyleSheet, TouchableOpacity, TouchableWithoutFeedback, View, } from "react-native"; import React, { PropsWithChildren } from "react"; interface SafecamModalProps extends PropsWithChildren { open: boolean; onBackgroundPress?: () => void; } const Modal = (props: SafecamModalProps) => { return ( { if (props.onBackgroundPress) { props.onBackgroundPress(); } }} > {(props.open && ( e.stopPropagation()} > {props.children} )) || <>} ); }; export default Modal; const styles = StyleSheet.create({ rootOpen: { width: "100%", height: "100%", position: "absolute", zIndex: 1000, top: 0, left: 0, }, rootClosed: { width: "0%", height: "0%", position: "absolute", zIndex: -10, }, });