import { router } from 'expo-router'; import { StatusBar } from 'expo-status-bar'; import { X, Zap } from 'lucide-react'; import React, { useState } from 'react'; import { Alert, Pressable, ScrollView, StyleSheet, Text, View, } from 'react-native'; import { SafeAreaView, useSafeAreaInsets } from 'react-native-safe-area-context'; import { ThemedView } from '@/components/themed-view'; const pointBundles = [ { id: 'bundle-500', amount: 500, price: 35 }, { id: 'bundle-2000', amount: 2000, price: 140 }, { id: 'bundle-5000', amount: 5000, price: 350 }, { id: 'bundle-10000', amount: 10000, price: 700 }, ]; export default function RechargeScreen() { const insets = useSafeAreaInsets(); const [selectedBundleId, setSelectedBundleId] = useState(null); const handleBundleSelection = (bundleId: string) => { setSelectedBundleId(bundleId); }; const handlePurchase = () => { if (!selectedBundleId) { Alert.alert( 'Choose a pack', 'Select the points pack that fits your journey before proceeding.' ); return; } const selectedBundle = pointBundles.find(bundle => bundle.id === selectedBundleId); if (!selectedBundle) { Alert.alert('Unavailable pack', 'The chosen points pack is no longer available.'); return; } Alert.alert( 'Purchase in progress', `Preparing ${selectedBundle.amount} points for ¥${selectedBundle.price}.` ); }; return ( router.back()} style={styles.dismissButton} > router.push('/points')} style={styles.pointsDetails} > Points Details 60 No active subscription plans Subscription points pack {pointBundles.map(bundle => ( handleBundleSelection(bundle.id)} style={({ pressed }) => [ styles.bundleCard, selectedBundleId === bundle.id && styles.bundleCardActive, pressed && styles.bundleCardPressed, ]} > {bundle.amount} ¥ {bundle.price} ))} [ styles.purchaseButton, pressed && styles.purchaseButtonPressed, ]} > Purchase points ); } const styles = StyleSheet.create({ canvas: { flex: 1, }, safeArea: { flex: 1, }, frame: { flex: 1, paddingHorizontal: 20, }, scrollContent: { paddingBottom: 32, }, headerRow: { marginTop: 12, flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center', }, dismissButton: { width: 40, height: 40, alignItems: 'center', justifyContent: 'center', }, pointsDetails: { backgroundColor: '#181818', borderRadius: 20, borderWidth: 1, borderColor: '#2C2C2C', paddingHorizontal: 16, paddingVertical: 8, }, pointsDetailsText: { color: '#F1F1F1', fontSize: 14, fontWeight: '500', letterSpacing: 0.3, }, balanceBlock: { marginTop: 32, alignItems: 'center', }, balanceRow: { flexDirection: 'row', alignItems: 'center', }, balanceValue: { marginLeft: 12, fontSize: 48, fontWeight: '700', color: '#FFFFFF', letterSpacing: 0.5, }, balanceCaption: { marginTop: 12, fontSize: 16, color: '#8E8E8E', letterSpacing: 0.2, }, tabStrip: { marginTop: 40, flexDirection: 'row', justifyContent: 'center', alignItems: 'flex-end', }, tabInactive: { marginRight: 32, fontSize: 16, color: '#555555', fontWeight: '500', textTransform: 'capitalize', }, tabActive: { alignItems: 'center', }, tabActiveText: { fontSize: 16, color: '#FFFFFF', fontWeight: '600', textTransform: 'capitalize', }, tabIndicator: { marginTop: 10, height: 2, width: 70, backgroundColor: '#FFD84E', borderRadius: 2, }, bundleGrid: { marginTop: 32, flexDirection: 'row', flexWrap: 'wrap', justifyContent: 'space-between', }, bundleCard: { width: '47%', backgroundColor: '#111111', borderRadius: 24, paddingVertical: 24, paddingHorizontal: 18, borderWidth: 1, borderColor: '#1F1F1F', justifyContent: 'space-between', marginBottom: 20, }, bundleCardActive: { borderColor: '#FFD84E', }, bundleCardPressed: { transform: [{ scale: 0.98 }], }, bundleHeader: { flexDirection: 'row', alignItems: 'center', }, bundleAmount: { marginLeft: 12, fontSize: 22, fontWeight: '600', color: '#FFFFFF', letterSpacing: 0.3, }, bundleAmountActive: { color: '#FFD84E', }, bundlePrice: { marginTop: 24, fontSize: 18, fontWeight: '500', color: '#A4A4A4', letterSpacing: 0.2, }, bundlePriceActive: { color: '#FFD84E', }, footer: { paddingTop: 16, }, purchaseButton: { height: 56, borderRadius: 28, backgroundColor: '#CFFF21', alignItems: 'center', justifyContent: 'center', }, purchaseButtonPressed: { opacity: 0.9, }, purchaseButtonText: { fontSize: 18, fontWeight: '700', color: '#101010', letterSpacing: 0.4, }, });