import React from 'react'; import { View, Text, TouchableOpacity, ActivityIndicator, StyleSheet, Image, } from 'react-native'; import { useDubsTheme } from './theme'; export interface ConnectWalletScreenProps { /** Called when the user taps Connect Wallet */ onConnect: () => void | Promise; /** Show a loading spinner on the button while connecting */ connecting?: boolean; /** Error message to display (e.g. "User rejected the request") */ error?: string | null; /** App name shown in the header. Defaults to "Dubs" */ appName?: string; /** Override accent color (e.g. from developer UI config) */ accentColor?: string; /** URL to app icon — renders as Image instead of the default letter circle */ appIcon?: string; /** Override subtitle text below app name */ tagline?: string; } export function ConnectWalletScreen({ onConnect, connecting = false, error = null, appName = 'Dubs', accentColor, appIcon, tagline, }: ConnectWalletScreenProps) { const t = useDubsTheme(); const accent = accentColor || t.accent; return ( {/* Branding */} {appIcon ? ( ) : ( {appName.charAt(0).toUpperCase()} )} {appName} {tagline || 'Connect your Solana wallet to get started'} {/* Action */} {error ? ( {error} ) : null} {connecting ? ( ) : ( Connect Wallet )} Phantom, Solflare, or any Solana wallet ); } const styles = StyleSheet.create({ container: { flex: 1, justifyContent: 'center', }, content: { flex: 1, justifyContent: 'space-between', paddingHorizontal: 32, paddingTop: 120, paddingBottom: 80, }, brandingSection: { alignItems: 'center', gap: 12, }, logoCircle: { width: 80, height: 80, borderRadius: 40, justifyContent: 'center', alignItems: 'center', marginBottom: 8, }, logoImage: { width: 80, height: 80, borderRadius: 16, marginBottom: 8, }, logoText: { fontSize: 36, fontWeight: '800', color: '#FFFFFF', }, appName: { fontSize: 32, fontWeight: '800', }, subtitle: { fontSize: 16, textAlign: 'center', lineHeight: 22, }, actionSection: { gap: 16, }, errorBox: { borderWidth: 1, borderRadius: 12, paddingHorizontal: 16, paddingVertical: 12, }, errorText: { fontSize: 14, textAlign: 'center', }, connectButton: { height: 56, borderRadius: 16, justifyContent: 'center', alignItems: 'center', }, connectButtonText: { color: '#FFFFFF', fontSize: 18, fontWeight: '700', }, hint: { fontSize: 13, textAlign: 'center', }, });