import React, { useState } from 'react'; import { View, Text, StyleSheet, TouchableOpacity, SafeAreaView, TextInput, Alert, } from 'react-native'; import { Ionicons } from '@expo/vector-icons'; import { LinearGradient } from 'expo-linear-gradient'; import { usePolkadot } from '../../contexts/PolkadotContext'; export default function WalletSetupScreen({ navigation }: any) { const { connectWallet, setSelectedAccount } = usePolkadot(); const [walletAddress, setWalletAddress] = useState(''); const handleConnectWithAddress = () => { if (!walletAddress.trim()) { Alert.alert('Error', 'Please enter a valid wallet address'); return; } // Set the account manually setSelectedAccount({ address: walletAddress.trim(), name: 'My Wallet', }); navigation.navigate('MainTabs'); }; const handleConnectWithExtension = async () => { await connectWallet(); // After successful connection, navigate to main app navigation.navigate('MainTabs'); }; return ( {/* Header */} Connect Your Wallet View your PezkuwiChain assets and transactions {/* Option 1: Enter Address */} Enter Wallet Address Enter your wallet address to view balances and transactions Continue Read-only mode. To send transactions, you'll be guided to SubWallet. {/* Option 2: Connect with Extension (Web only) */} Connect Polkadot.js Extension {/* Footer */} Your keys stay secure. We never access private keys. ); } const styles = StyleSheet.create({ container: { flex: 1, }, gradient: { flex: 1, }, content: { flex: 1, padding: 20, justifyContent: 'space-between', }, header: { alignItems: 'center', marginTop: 40, }, title: { fontSize: 28, fontWeight: 'bold', color: '#FFF', marginTop: 20, textAlign: 'center', }, subtitle: { fontSize: 16, color: '#FFF', marginTop: 12, textAlign: 'center', opacity: 0.9, paddingHorizontal: 20, }, card: { backgroundColor: '#FFF', borderRadius: 24, padding: 24, shadowColor: '#000', shadowOffset: { width: 0, height: 4 }, shadowOpacity: 0.15, shadowRadius: 12, elevation: 8, }, optionHeader: { flexDirection: 'row', alignItems: 'center', gap: 12, marginBottom: 12, }, optionTitle: { fontSize: 20, fontWeight: '700', color: '#333', }, optionDescription: { fontSize: 14, color: '#666', marginBottom: 16, lineHeight: 20, }, input: { backgroundColor: '#F5F5F5', borderRadius: 12, padding: 16, fontSize: 14, color: '#333', marginBottom: 16, }, primaryButton: { backgroundColor: '#F08080', borderRadius: 12, padding: 16, flexDirection: 'row', alignItems: 'center', justifyContent: 'center', gap: 8, }, primaryButtonText: { color: '#FFF', fontSize: 18, fontWeight: '600', }, infoBox: { backgroundColor: '#F0F9F7', borderRadius: 12, padding: 12, flexDirection: 'row', alignItems: 'center', gap: 8, marginTop: 16, borderWidth: 1, borderColor: '#D0F0E8', }, infoText: { flex: 1, fontSize: 12, color: '#5DBEA3', lineHeight: 16, }, secondaryButton: { backgroundColor: 'rgba(255,255,255,0.2)', borderRadius: 12, padding: 16, flexDirection: 'row', alignItems: 'center', justifyContent: 'center', gap: 8, borderWidth: 2, borderColor: 'rgba(255,255,255,0.3)', }, secondaryButtonText: { color: '#FFF', fontSize: 16, fontWeight: '600', }, footer: { flexDirection: 'row', alignItems: 'center', justifyContent: 'center', gap: 8, marginBottom: 20, }, footerText: { fontSize: 12, color: '#FFF', opacity: 0.9, }, });