import { Images } from '@/constants/images'; import { Image } from 'expo-image'; import React, { forwardRef, useImperativeHandle, useState } from 'react'; import { ImageBackground, Modal, StyleSheet, TouchableOpacity, View } from 'react-native'; export interface WishRuleModalRef { show: () => void; close: () => void; } export const WishRuleModal = forwardRef((props, ref) => { const [visible, setVisible] = useState(false); useImperativeHandle(ref, () => ({ show: () => setVisible(true), close: () => setVisible(false), })); if (!visible) return null; return ( setVisible(false)}> setVisible(false)}> ); }); export default WishRuleModal; const styles = StyleSheet.create({ overlay: { flex: 1, backgroundColor: 'rgba(0,0,0,0.7)', justifyContent: 'center', alignItems: 'center', }, contentContainer: { width: 300, height: 400, alignItems: 'center', justifyContent: 'center', }, content: { width: '100%', height: '100%', alignItems: 'center', justifyContent: 'center', }, titleBox: { position: 'absolute', top: -20, zIndex: 1, }, title: { width: 200, height: 50, }, closeBox: { position: 'absolute', top: 0, right: -10, zIndex: 2, }, close: { width: 30, height: 30, }, ruleImage: { width: 260, height: 300, marginTop: 20, }, });