1import React from 'react'; 2import { StyleSheet, View } from 'react-native'; 3 4export default function Portal({ isVisible, children }) { 5 if (!children) { 6 return null; 7 } 8 9 return ( 10 <View 11 style={[StyleSheet.absoluteFill, styles.container, { opacity: isVisible ? 0.5 : 0 }]} 12 pointerEvents="none"> 13 {children} 14 </View> 15 ); 16} 17 18const styles = StyleSheet.create({ 19 container: { 20 alignItems: 'center', 21 justifyContent: 'center', 22 backgroundColor: 'rgb(255, 255, 255)', 23 }, 24}); 25