UNPKG

@oxyhq/services

Version:

Reusable OxyHQ module to handle authentication, user management, karma system, device-based session management and more 🚀

837 lines (833 loc) • 34.9 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _react = _interopRequireWildcard(require("react")); var _reactNative = require("react-native"); var _OxyContext = require("../context/OxyContext"); var _Avatar = _interopRequireDefault(require("../components/Avatar")); var _OxyIcon = _interopRequireDefault(require("../components/icon/OxyIcon")); var _sonner = require("../../lib/sonner"); var _jsxRuntime = require("react/jsx-runtime"); function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); } const AccountOverviewScreen = ({ onClose, theme, navigate }) => { const { user, logout, isLoading, sessions, activeSessionId, oxyServices } = (0, _OxyContext.useOxy)(); const [showMoreAccounts, setShowMoreAccounts] = (0, _react.useState)(false); const [additionalAccountsData, setAdditionalAccountsData] = (0, _react.useState)([]); const [loadingAdditionalAccounts, setLoadingAdditionalAccounts] = (0, _react.useState)(false); const isDarkTheme = theme === 'dark'; const textColor = isDarkTheme ? '#FFFFFF' : '#000000'; const backgroundColor = isDarkTheme ? '#121212' : '#FFFFFF'; const secondaryBackgroundColor = isDarkTheme ? '#222222' : '#F5F5F5'; const borderColor = isDarkTheme ? '#444444' : '#E0E0E0'; const primaryColor = '#d169e5'; const dangerColor = '#D32F2F'; const iconColor = isDarkTheme ? '#BBBBBB' : '#666666'; // Get additional accounts from sessions (excluding current user) const additionalAccounts = sessions.filter(session => session.sessionId !== activeSessionId && session.userId !== user?.id); // Load user profiles for additional accounts _react.default.useEffect(() => { const loadAdditionalAccountsData = async () => { if (!oxyServices || additionalAccounts.length === 0) { setAdditionalAccountsData([]); return; } setLoadingAdditionalAccounts(true); try { const accountsData = await Promise.all(additionalAccounts.map(async session => { try { const userProfile = await oxyServices.getUserBySession(session.sessionId); return { id: session.sessionId, sessionId: session.sessionId, username: userProfile.username, email: userProfile.email, name: userProfile.name, avatar: userProfile.avatar, userProfile }; } catch (error) { console.error(`Failed to load profile for session ${session.sessionId}:`, error); return { id: session.sessionId, sessionId: session.sessionId, username: session.username || 'Unknown User', email: 'No email available', avatar: null, userProfile: null }; } })); setAdditionalAccountsData(accountsData); } catch (error) { console.error('Failed to load additional accounts:', error); setAdditionalAccountsData([]); } finally { setLoadingAdditionalAccounts(false); } }; loadAdditionalAccountsData(); }, [sessions, activeSessionId, user?.id, oxyServices]); // Feature settings (with mock values) const features = { safeSearch: false, language: 'English' }; const handleLogout = async () => { try { await logout(); if (onClose) { onClose(); } } catch (error) { console.error('Logout failed:', error); _sonner.toast.error('There was a problem signing you out. Please try again.'); } }; const confirmLogout = () => { _reactNative.Alert.alert('Sign Out', 'Are you sure you want to sign out?', [{ text: 'Cancel', style: 'cancel' }, { text: 'Sign Out', onPress: handleLogout, style: 'destructive' }], { cancelable: true }); }; const handleAddAccount = () => { _sonner.toast.info('Add another account feature coming soon!'); }; const handleSignOutAll = () => { _reactNative.Alert.alert('Sign Out of All Accounts', 'Are you sure you want to sign out of all accounts?', [{ text: 'Cancel', style: 'cancel' }, { text: 'Sign Out All', onPress: handleLogout, style: 'destructive' }], { cancelable: true }); }; if (!user) { return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, { style: [styles.container, { backgroundColor }], children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, { style: [styles.message, { color: textColor }], children: "Not signed in" }) }); } if (isLoading) { return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, { style: [styles.container, { backgroundColor, justifyContent: 'center' }], children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ActivityIndicator, { size: "large", color: primaryColor }) }); } return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, { style: [styles.container, { backgroundColor: '#f2f2f2' }], children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, { style: styles.header, children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, { style: styles.headerTitle, children: "Account" }), onClose && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, { style: styles.closeButton, onPress: onClose, children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, { style: styles.closeButtonText, children: "\xD7" }) })] }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.ScrollView, { style: styles.content, children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, { style: styles.section, children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, { style: styles.sectionTitle, children: "Profile" }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, { style: [styles.settingItem, styles.firstSettingItem, styles.lastSettingItem], children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, { style: styles.userIcon, children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Avatar.default, { uri: user?.avatar?.url, name: user?.name?.full, size: 40, theme: theme }) }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, { style: styles.settingInfo, children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, { children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, { style: styles.settingLabel, children: typeof user.name === 'string' ? user.name : user.name?.full || user.name?.first || user.username }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, { style: styles.settingDescription, children: user.email || user.username })] }) }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, { style: styles.manageButton, onPress: () => _sonner.toast.info('Manage your Oxy Account feature coming soon!'), children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, { style: styles.manageButtonText, children: "Manage" }) })] })] }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, { style: styles.section, children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, { style: styles.sectionTitle, children: "Account Settings" }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, { style: [styles.settingItem, styles.firstSettingItem], onPress: () => navigate?.('AccountSettings', { activeTab: 'profile' }), children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, { style: styles.settingInfo, children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_OxyIcon.default, { name: "person-circle", size: 20, color: "#007AFF", style: styles.settingIcon }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, { children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, { style: styles.settingLabel, children: "Edit Profile" }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, { style: styles.settingDescription, children: "Update your personal information" })] })] }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_OxyIcon.default, { name: "chevron-forward", size: 16, color: "#ccc" })] }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, { style: styles.settingItem, onPress: () => navigate?.('AccountSettings', { activeTab: 'password' }), children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, { style: styles.settingInfo, children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_OxyIcon.default, { name: "shield-checkmark", size: 20, color: "#30D158", style: styles.settingIcon }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, { children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, { style: styles.settingLabel, children: "Security & Privacy" }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, { style: styles.settingDescription, children: "Password, 2FA, and privacy settings" })] })] }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_OxyIcon.default, { name: "chevron-forward", size: 16, color: "#ccc" })] }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, { style: styles.settingItem, onPress: () => navigate?.('AccountSettings', { activeTab: 'notifications' }), children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, { style: styles.settingInfo, children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_OxyIcon.default, { name: "notifications", size: 20, color: "#FF9500", style: styles.settingIcon }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, { children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, { style: styles.settingLabel, children: "Notifications" }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, { style: styles.settingDescription, children: "Manage your notification preferences" })] })] }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_OxyIcon.default, { name: "chevron-forward", size: 16, color: "#ccc" })] }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, { style: [styles.settingItem], onPress: () => navigate?.('PremiumSubscription'), children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, { style: styles.settingInfo, children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_OxyIcon.default, { name: "star", size: 20, color: "#FFD700", style: styles.settingIcon }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, { children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, { style: styles.settingLabel, children: "Oxy+ Subscriptions" }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, { style: styles.settingDescription, children: user.isPremium ? 'Manage your premium plan' : 'Upgrade to premium features' })] })] }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_OxyIcon.default, { name: "chevron-forward", size: 16, color: "#ccc" })] }), user.isPremium && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, { style: [styles.settingItem, styles.lastSettingItem], onPress: () => navigate?.('BillingManagement'), children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, { style: styles.settingInfo, children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_OxyIcon.default, { name: "card", size: 20, color: "#34C759", style: styles.settingIcon }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, { children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, { style: styles.settingLabel, children: "Billing Management" }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, { style: styles.settingDescription, children: "Payment methods and invoices" })] })] }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_OxyIcon.default, { name: "chevron-forward", size: 16, color: "#ccc" })] })] }), showMoreAccounts && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, { style: styles.section, children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, { style: styles.sectionTitle, children: ["Additional Accounts", additionalAccountsData.length > 0 ? ` (${additionalAccountsData.length})` : ''] }), loadingAdditionalAccounts ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, { style: [styles.settingItem, styles.firstSettingItem, styles.lastSettingItem], children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, { style: styles.loadingContainer, children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ActivityIndicator, { size: "small", color: "#007AFF" }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, { style: styles.loadingText, children: "Loading accounts..." })] }) }) : additionalAccountsData.length > 0 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, { children: additionalAccountsData.map((account, index) => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, { style: [styles.settingItem, index === 0 && styles.firstSettingItem, index === additionalAccountsData.length - 1 && styles.lastSettingItem], onPress: () => { _sonner.toast.info(`Switch to ${account.username}?`); // TODO: Implement account switching logic // switchSession(account.sessionId); }, children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, { style: styles.userIcon, children: account.avatar?.url ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Image, { source: { uri: account.avatar.url }, style: styles.accountAvatarImage }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, { style: styles.accountAvatarFallback, children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, { style: styles.accountAvatarText, children: account.username?.charAt(0).toUpperCase() || '?' }) }) }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, { style: styles.settingInfo, children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, { children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, { style: styles.settingLabel, children: typeof account.name === 'object' ? account.name?.full || account.name?.first || account.username : account.name || account.username }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, { style: styles.settingDescription, children: account.email || account.username })] }) }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_OxyIcon.default, { name: "chevron-forward", size: 16, color: "#ccc" })] }, account.id)) }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, { style: [styles.settingItem, styles.firstSettingItem, styles.lastSettingItem], children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, { style: styles.settingInfo, children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_OxyIcon.default, { name: "person-outline", size: 20, color: "#ccc", style: styles.settingIcon }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, { children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, { style: styles.settingLabel, children: "No other accounts" }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, { style: styles.settingDescription, children: "Add another account to switch between them" })] })] }) })] }), showMoreAccounts && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, { style: styles.section, children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, { style: styles.sectionTitle, children: "Account Management" }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, { style: [styles.settingItem, styles.firstSettingItem], onPress: handleAddAccount, children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, { style: styles.settingInfo, children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_OxyIcon.default, { name: "add", size: 20, color: "#007AFF", style: styles.settingIcon }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, { children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, { style: styles.settingLabel, children: "Add another account" }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, { style: styles.settingDescription, children: "Sign in with a different account" })] })] }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_OxyIcon.default, { name: "chevron-forward", size: 16, color: "#ccc" })] }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, { style: [styles.settingItem, styles.lastSettingItem], onPress: handleSignOutAll, children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, { style: styles.settingInfo, children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_OxyIcon.default, { name: "log-out", size: 20, color: "#FF3B30", style: styles.settingIcon }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, { children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, { style: styles.settingLabel, children: "Sign out of all accounts" }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, { style: styles.settingDescription, children: "Remove all accounts from this device" })] })] }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_OxyIcon.default, { name: "chevron-forward", size: 16, color: "#ccc" })] })] }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, { style: styles.section, children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, { style: styles.sectionTitle, children: "Quick Actions" }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, { style: [styles.settingItem, styles.firstSettingItem], onPress: () => setShowMoreAccounts(!showMoreAccounts), children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, { style: styles.settingInfo, children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_OxyIcon.default, { name: "people", size: 20, color: "#5856D6", style: styles.settingIcon }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, { children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, { style: styles.settingLabel, children: [showMoreAccounts ? 'Hide' : 'Show', " Account Switcher"] }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, { style: styles.settingDescription, children: showMoreAccounts ? 'Hide account switcher' : additionalAccountsData.length > 0 ? `Switch between ${additionalAccountsData.length + 1} accounts` : loadingAdditionalAccounts ? 'Loading additional accounts...' : 'Manage multiple accounts' })] })] }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_OxyIcon.default, { name: "chevron-forward", size: 16, color: "#ccc" })] }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, { style: styles.settingItem, onPress: () => _sonner.toast.info('Download account data feature coming soon!'), children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, { style: styles.settingInfo, children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_OxyIcon.default, { name: "download", size: 20, color: "#34C759", style: styles.settingIcon }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, { children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, { style: styles.settingLabel, children: "Download My Data" }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, { style: styles.settingDescription, children: "Export your account information" })] })] }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_OxyIcon.default, { name: "chevron-forward", size: 16, color: "#ccc" })] }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, { style: [styles.settingItem, styles.lastSettingItem], onPress: () => _sonner.toast.info('Delete account feature coming soon!'), children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, { style: styles.settingInfo, children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_OxyIcon.default, { name: "trash", size: 20, color: "#FF3B30", style: styles.settingIcon }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, { children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, { style: styles.settingLabel, children: "Delete Account" }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, { style: styles.settingDescription, children: "Permanently delete your account" })] })] }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_OxyIcon.default, { name: "chevron-forward", size: 16, color: "#ccc" })] })] }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, { style: styles.section, children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, { style: styles.sectionTitle, children: "Support & Settings" }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, { style: [styles.settingItem, styles.firstSettingItem], onPress: () => _sonner.toast.info('Account preferences coming soon!'), children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, { style: styles.settingInfo, children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_OxyIcon.default, { name: "settings", size: 20, color: "#8E8E93", style: styles.settingIcon }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, { children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, { style: styles.settingLabel, children: "Account Preferences" }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, { style: styles.settingDescription, children: "Customize your account experience" })] })] }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_OxyIcon.default, { name: "chevron-forward", size: 16, color: "#ccc" })] }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, { style: styles.settingItem, onPress: () => _sonner.toast.info('Help & support feature coming soon!'), children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, { style: styles.settingInfo, children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_OxyIcon.default, { name: "help-circle", size: 20, color: "#007AFF", style: styles.settingIcon }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, { children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, { style: styles.settingLabel, children: "Help & Support" }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, { style: styles.settingDescription, children: "Get help with your account" })] })] }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_OxyIcon.default, { name: "chevron-forward", size: 16, color: "#ccc" })] }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, { style: styles.settingItem, onPress: () => _sonner.toast.info('Connected apps feature coming soon!'), children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, { style: styles.settingInfo, children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_OxyIcon.default, { name: "link", size: 20, color: "#32D74B", style: styles.settingIcon }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, { children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, { style: styles.settingLabel, children: "Connected Apps" }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, { style: styles.settingDescription, children: "Manage third-party app access" })] })] }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_OxyIcon.default, { name: "chevron-forward", size: 16, color: "#ccc" })] }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, { style: styles.settingItem, onPress: () => _sonner.toast.info('Privacy Policy feature coming soon!'), children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, { style: styles.settingInfo, children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_OxyIcon.default, { name: "document-lock", size: 20, color: "#FF9F0A", style: styles.settingIcon }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, { children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, { style: styles.settingLabel, children: "Privacy Policy" }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, { style: styles.settingDescription, children: "Learn about data protection" })] })] }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_OxyIcon.default, { name: "chevron-forward", size: 16, color: "#ccc" })] }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, { style: [styles.settingItem, styles.lastSettingItem], onPress: () => _sonner.toast.info('Terms of Service feature coming soon!'), children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, { style: styles.settingInfo, children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_OxyIcon.default, { name: "document-text", size: 20, color: "#5856D6", style: styles.settingIcon }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, { children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, { style: styles.settingLabel, children: "Terms of Service" }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, { style: styles.settingDescription, children: "Read our terms and conditions" })] })] }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_OxyIcon.default, { name: "chevron-forward", size: 16, color: "#ccc" })] })] }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, { style: styles.section, children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, { style: [styles.settingItem, styles.firstSettingItem, styles.lastSettingItem, styles.signOutButton], onPress: confirmLogout, children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, { style: styles.settingInfo, children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_OxyIcon.default, { name: "log-out", size: 20, color: "#ff4757", style: styles.settingIcon }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, { children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, { style: [styles.settingLabel, { color: '#ff4757' }], children: "Sign Out" }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, { style: styles.settingDescription, children: "Sign out of your account" })] })] }) }) })] })] }); }; const styles = _reactNative.StyleSheet.create({ container: { flex: 1, backgroundColor: '#f2f2f2' }, header: { paddingHorizontal: 20, paddingTop: 60, paddingBottom: 16, backgroundColor: '#fff', borderBottomWidth: 1, borderBottomColor: '#e0e0e0', flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center' }, headerTitle: { fontSize: 24, fontWeight: 'bold', color: '#000' }, closeButton: { padding: 8 }, closeButtonText: { fontSize: 24, color: '#000', fontWeight: '300' }, content: { flex: 1, padding: 16 }, section: { marginBottom: 24 }, sectionTitle: { fontSize: 16, fontWeight: '600', color: '#333', marginBottom: 12 }, settingItem: { backgroundColor: '#fff', padding: 16, flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', marginBottom: 2 }, firstSettingItem: { borderTopLeftRadius: 24, borderTopRightRadius: 24 }, lastSettingItem: { borderBottomLeftRadius: 24, borderBottomRightRadius: 24, marginBottom: 8 }, settingInfo: { flexDirection: 'row', alignItems: 'center', flex: 1 }, settingIcon: { marginRight: 12 }, settingLabel: { fontSize: 16, fontWeight: '500', color: '#333', marginBottom: 2 }, settingDescription: { fontSize: 14, color: '#666' }, userIcon: { marginRight: 12 }, manageButton: { backgroundColor: '#007AFF', paddingHorizontal: 16, paddingVertical: 8, borderRadius: 16 }, manageButtonText: { color: '#fff', fontSize: 14, fontWeight: '500' }, accountAvatarImage: { width: 40, height: 40, borderRadius: 20 }, accountAvatarFallback: { width: 40, height: 40, borderRadius: 20, backgroundColor: '#d169e5', alignItems: 'center', justifyContent: 'center' }, accountAvatarText: { color: 'white', fontSize: 18, fontWeight: 'bold' }, signOutButton: { borderWidth: 1, borderColor: '#ff4757' }, message: { fontSize: 16, textAlign: 'center', marginTop: 24, color: '#333' }, loadingContainer: { flexDirection: 'row', alignItems: 'center', justifyContent: 'center', paddingVertical: 20, gap: 12 }, loadingText: { fontSize: 16, color: '#666' } }); var _default = exports.default = AccountOverviewScreen; //# sourceMappingURL=AccountOverviewScreen.js.map