import React from 'react'; import { Modal, SafeAreaView, StyleSheet } from 'react-native'; import { Paywall } from './Paywall.js'; import type { PaywallProps } from './Paywall.js'; // --------------------------------------------------------------------------- // Props // --------------------------------------------------------------------------- export interface PaywallModalProps extends PaywallProps { /** Controls modal visibility */ visible: boolean; /** Called when the modal should close (via the close button or back gesture) */ onClose: () => void; } // --------------------------------------------------------------------------- // PaywallModal // --------------------------------------------------------------------------- /** * Wraps in a React Native Modal for convenience. * * @example * ```tsx * const [showPaywall, setShowPaywall] = useState(false); * const { subscribe, restore, isLoading } = useOneSub(); * * setShowPaywall(false)} * config={paywallConfig} * onSubscribe={subscribe} * onRestore={restore} * isLoading={isLoading} * /> * ``` */ export function PaywallModal({ visible, onClose, config, onSubscribe, onRestore, isLoading, }: PaywallModalProps) { return ( ); } // --------------------------------------------------------------------------- // Styles // --------------------------------------------------------------------------- const styles = StyleSheet.create({ safeArea: { flex: 1, backgroundColor: '#ffffff', }, });