import React from 'react'; import { View, Text, ScrollView, TouchableOpacity, ActivityIndicator, StyleSheet, } from 'react-native'; import { useDubsTheme } from './theme'; import { UserProfileCard } from './UserProfileCard'; export interface SettingsSheetProps { walletAddress: string; username?: string; avatarUrl?: string | null; memberSince?: string | null; appVersion?: string; onCopyAddress?: () => void; onSupport?: () => void; onLogout: () => void | Promise; loggingOut?: boolean; } function truncateAddress(address: string, chars = 4): string { if (address.length <= chars * 2 + 3) return address; return `${address.slice(0, chars)}...${address.slice(-chars)}`; } export function SettingsSheet({ walletAddress, username, avatarUrl, memberSince, appVersion, onCopyAddress, onSupport, onLogout, loggingOut = false, }: SettingsSheetProps) { const t = useDubsTheme(); return ( {/* Profile card */} {/* Action rows */} {onCopyAddress ? ( Wallet Address {truncateAddress(walletAddress)} Copy ) : null} {onSupport ? ( <> {onCopyAddress ? ( ) : null} Help & Support {'\u203A'} ) : null} {/* Logout button */} {loggingOut ? ( ) : ( Log Out )} {/* App version */} {appVersion ? ( v{appVersion} ) : null} ); } const styles = StyleSheet.create({ container: { flex: 1, }, content: { padding: 20, paddingTop: 24, gap: 20, }, actionsCard: { borderRadius: 16, borderWidth: 1, overflow: 'hidden', }, actionRow: { flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', paddingHorizontal: 16, paddingVertical: 14, }, actionRowLeft: { flex: 1, gap: 2, }, actionLabel: { fontSize: 15, fontWeight: '600', }, actionValue: { fontSize: 13, fontFamily: 'monospace', }, copyLabel: { fontSize: 14, fontWeight: '600', }, chevron: { fontSize: 22, fontWeight: '300', }, separator: { height: 1, marginHorizontal: 16, }, logoutButton: { height: 52, borderRadius: 16, borderWidth: 1.5, justifyContent: 'center', alignItems: 'center', }, logoutText: { fontSize: 16, fontWeight: '700', }, version: { fontSize: 12, textAlign: 'center', }, });