@oxyhq/services 6.9.27 → 6.9.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/ui/components/SettingsIcon.js +45 -0
- package/lib/commonjs/ui/components/SettingsIcon.js.map +1 -0
- package/lib/commonjs/ui/components/index.js +7 -0
- package/lib/commonjs/ui/components/index.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountCenterScreen.js +127 -126
- package/lib/commonjs/ui/screens/AccountCenterScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountOverviewScreen.js +203 -191
- package/lib/commonjs/ui/screens/AccountOverviewScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AppInfoScreen.js +209 -205
- package/lib/commonjs/ui/screens/AppInfoScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/HelpSupportScreen.js +66 -63
- package/lib/commonjs/ui/screens/HelpSupportScreen.js.map +1 -1
- package/lib/module/ui/components/SettingsIcon.js +40 -0
- package/lib/module/ui/components/SettingsIcon.js.map +1 -0
- package/lib/module/ui/components/index.js +1 -0
- package/lib/module/ui/components/index.js.map +1 -1
- package/lib/module/ui/screens/AccountCenterScreen.js +127 -126
- package/lib/module/ui/screens/AccountCenterScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountOverviewScreen.js +204 -192
- package/lib/module/ui/screens/AccountOverviewScreen.js.map +1 -1
- package/lib/module/ui/screens/AppInfoScreen.js +210 -206
- package/lib/module/ui/screens/AppInfoScreen.js.map +1 -1
- package/lib/module/ui/screens/HelpSupportScreen.js +67 -64
- package/lib/module/ui/screens/HelpSupportScreen.js.map +1 -1
- package/lib/typescript/commonjs/ui/components/SettingsIcon.d.ts +14 -0
- package/lib/typescript/commonjs/ui/components/SettingsIcon.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/index.d.ts +1 -0
- package/lib/typescript/commonjs/ui/components/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/AccountCenterScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/AccountOverviewScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/AppInfoScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/HelpSupportScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/SettingsIcon.d.ts +14 -0
- package/lib/typescript/module/ui/components/SettingsIcon.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/index.d.ts +1 -0
- package/lib/typescript/module/ui/components/index.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/AccountCenterScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/AccountOverviewScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/AppInfoScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/HelpSupportScreen.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/ui/components/SettingsIcon.tsx +43 -0
- package/src/ui/components/index.ts +1 -0
- package/src/ui/screens/AccountCenterScreen.tsx +97 -145
- package/src/ui/screens/AccountOverviewScreen.tsx +154 -220
- package/src/ui/screens/AppInfoScreen.tsx +177 -248
- package/src/ui/screens/HelpSupportScreen.tsx +53 -76
|
@@ -2,11 +2,9 @@ import type React from 'react';
|
|
|
2
2
|
import {
|
|
3
3
|
View,
|
|
4
4
|
Text,
|
|
5
|
-
TouchableOpacity,
|
|
6
5
|
StyleSheet,
|
|
7
6
|
ActivityIndicator,
|
|
8
7
|
ScrollView,
|
|
9
|
-
Alert,
|
|
10
8
|
Platform,
|
|
11
9
|
} from 'react-native';
|
|
12
10
|
import { useCallback, useMemo } from 'react';
|
|
@@ -14,13 +12,11 @@ import type { BaseScreenProps } from '../types/navigation';
|
|
|
14
12
|
import { packageInfo } from '@oxyhq/core';
|
|
15
13
|
import { toast } from '../../lib/sonner';
|
|
16
14
|
import { confirmAction } from '../utils/confirmAction';
|
|
17
|
-
import { Ionicons } from '@expo/vector-icons';
|
|
18
15
|
import { fontFamilies } from '../styles/fonts';
|
|
19
16
|
import ProfileCard from '../components/ProfileCard';
|
|
20
17
|
import Section from '../components/Section';
|
|
21
18
|
import QuickActions from '../components/QuickActions';
|
|
22
|
-
import
|
|
23
|
-
import GroupedItem from '../components/GroupedItem';
|
|
19
|
+
import { SettingsIcon } from '../components/SettingsIcon';
|
|
24
20
|
import { useI18n } from '../hooks/useI18n';
|
|
25
21
|
import { useThemeStyles } from '../hooks/useThemeStyles';
|
|
26
22
|
import { useColorScheme } from '../hooks/useColorScheme';
|
|
@@ -28,6 +24,7 @@ import { Colors } from '../constants/theme';
|
|
|
28
24
|
import { normalizeColorScheme, normalizeTheme } from '../utils/themeUtils';
|
|
29
25
|
import { useOxy } from '../context/OxyContext';
|
|
30
26
|
import { screenContentStyle } from '../constants/spacing';
|
|
27
|
+
import { SettingsListGroup, SettingsListItem } from '@oxyhq/bloom/settings-list';
|
|
31
28
|
|
|
32
29
|
const AccountCenterScreen: React.FC<BaseScreenProps> = ({
|
|
33
30
|
onClose,
|
|
@@ -43,7 +40,7 @@ const AccountCenterScreen: React.FC<BaseScreenProps> = ({
|
|
|
43
40
|
// AccountCenterScreen uses a slightly different light background
|
|
44
41
|
const backgroundColor = themeStyles.isDarkTheme ? themeStyles.backgroundColor : '#f2f2f2';
|
|
45
42
|
// Extract commonly used colors for readability - ensure colors is always defined
|
|
46
|
-
const { textColor,
|
|
43
|
+
const { textColor, primaryColor, dangerColor, colors: themeColors } = themeStyles;
|
|
47
44
|
const colors = themeColors || Colors[normalizeColorScheme(colorScheme, normalizedTheme)];
|
|
48
45
|
|
|
49
46
|
// Memoized logout handler - prevents unnecessary re-renders
|
|
@@ -116,166 +113,121 @@ const AccountCenterScreen: React.FC<BaseScreenProps> = ({
|
|
|
116
113
|
</Section>
|
|
117
114
|
|
|
118
115
|
{/* Account Management */}
|
|
119
|
-
<
|
|
120
|
-
<
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
iconColor: colors.iconSecurity,
|
|
126
|
-
title: t('accountCenter.items.accountOverview.title') || 'Account Overview',
|
|
127
|
-
subtitle: t('accountCenter.items.accountOverview.subtitle') || 'Complete account information',
|
|
128
|
-
onPress: () => navigate?.('AccountOverview'),
|
|
129
|
-
},
|
|
130
|
-
{
|
|
131
|
-
id: 'settings',
|
|
132
|
-
icon: 'cog',
|
|
133
|
-
iconColor: colors.iconData,
|
|
134
|
-
title: t('accountCenter.items.editProfile.title') || 'Edit Profile',
|
|
135
|
-
subtitle: t('accountCenter.items.editProfile.subtitle') || 'Manage your profile and preferences',
|
|
136
|
-
onPress: () => navigate?.('AccountSettings'),
|
|
137
|
-
},
|
|
138
|
-
{
|
|
139
|
-
id: 'sessions',
|
|
140
|
-
icon: 'shield-check',
|
|
141
|
-
iconColor: colors.iconSecurity,
|
|
142
|
-
title: t('accountCenter.items.manageSessions.title') || 'Manage Sessions',
|
|
143
|
-
subtitle: t('accountCenter.items.manageSessions.subtitle') || 'Security and active devices',
|
|
144
|
-
onPress: () => navigate?.('SessionManagement'),
|
|
145
|
-
},
|
|
146
|
-
{
|
|
147
|
-
id: 'files',
|
|
148
|
-
icon: 'folder',
|
|
149
|
-
iconColor: colors.iconStorage,
|
|
150
|
-
title: t('accountCenter.items.fileManagement.title') || 'File Management',
|
|
151
|
-
subtitle: t('accountCenter.items.fileManagement.subtitle') || 'Upload, download, and manage your files',
|
|
152
|
-
onPress: () => navigate?.('FileManagement'),
|
|
153
|
-
},
|
|
154
|
-
{
|
|
155
|
-
id: 'premium',
|
|
156
|
-
icon: 'star',
|
|
157
|
-
iconColor: colors.iconPayments,
|
|
158
|
-
title: t('accountCenter.items.premium.title') || 'Oxy+ Subscriptions',
|
|
159
|
-
subtitle: user?.isPremium ? (t('accountCenter.items.premium.manage') || 'Manage your premium plan') : (t('accountCenter.items.premium.upgrade') || 'Upgrade to premium features'),
|
|
160
|
-
onPress: () => navigate?.('PremiumSubscription'),
|
|
161
|
-
},
|
|
162
|
-
...(user?.isPremium ? [{
|
|
163
|
-
id: 'billing',
|
|
164
|
-
icon: 'card',
|
|
165
|
-
iconColor: colors.iconPersonalInfo,
|
|
166
|
-
title: t('accountCenter.items.billing.title') || 'Billing Management',
|
|
167
|
-
subtitle: t('accountCenter.items.billing.subtitle') || 'Payment methods and invoices',
|
|
168
|
-
onPress: () => navigate?.('PaymentGateway'),
|
|
169
|
-
}] : []),
|
|
170
|
-
], [user?.isPremium, navigate, t, colors])}
|
|
171
|
-
|
|
116
|
+
<SettingsListGroup title={t('accountCenter.sections.accountManagement') || 'Account Management'}>
|
|
117
|
+
<SettingsListItem
|
|
118
|
+
icon={<SettingsIcon name="account-circle" color={colors.iconSecurity} />}
|
|
119
|
+
title={t('accountCenter.items.accountOverview.title') || 'Account Overview'}
|
|
120
|
+
description={t('accountCenter.items.accountOverview.subtitle') || 'Complete account information'}
|
|
121
|
+
onPress={() => navigate?.('AccountOverview')}
|
|
172
122
|
/>
|
|
173
|
-
|
|
123
|
+
<SettingsListItem
|
|
124
|
+
icon={<SettingsIcon name="cog" color={colors.iconData} />}
|
|
125
|
+
title={t('accountCenter.items.editProfile.title') || 'Edit Profile'}
|
|
126
|
+
description={t('accountCenter.items.editProfile.subtitle') || 'Manage your profile and preferences'}
|
|
127
|
+
onPress={() => navigate?.('AccountSettings')}
|
|
128
|
+
/>
|
|
129
|
+
<SettingsListItem
|
|
130
|
+
icon={<SettingsIcon name="shield-check" color={colors.iconSecurity} />}
|
|
131
|
+
title={t('accountCenter.items.manageSessions.title') || 'Manage Sessions'}
|
|
132
|
+
description={t('accountCenter.items.manageSessions.subtitle') || 'Security and active devices'}
|
|
133
|
+
onPress={() => navigate?.('SessionManagement')}
|
|
134
|
+
/>
|
|
135
|
+
<SettingsListItem
|
|
136
|
+
icon={<SettingsIcon name="folder" color={colors.iconStorage} />}
|
|
137
|
+
title={t('accountCenter.items.fileManagement.title') || 'File Management'}
|
|
138
|
+
description={t('accountCenter.items.fileManagement.subtitle') || 'Upload, download, and manage your files'}
|
|
139
|
+
onPress={() => navigate?.('FileManagement')}
|
|
140
|
+
/>
|
|
141
|
+
<SettingsListItem
|
|
142
|
+
icon={<SettingsIcon name="star" color={colors.iconPayments} />}
|
|
143
|
+
title={t('accountCenter.items.premium.title') || 'Oxy+ Subscriptions'}
|
|
144
|
+
description={user?.isPremium ? (t('accountCenter.items.premium.manage') || 'Manage your premium plan') : (t('accountCenter.items.premium.upgrade') || 'Upgrade to premium features')}
|
|
145
|
+
onPress={() => navigate?.('PremiumSubscription')}
|
|
146
|
+
/>
|
|
147
|
+
{user?.isPremium ? (
|
|
148
|
+
<SettingsListItem
|
|
149
|
+
icon={<SettingsIcon name="credit-card" color={colors.iconPersonalInfo} />}
|
|
150
|
+
title={t('accountCenter.items.billing.title') || 'Billing Management'}
|
|
151
|
+
description={t('accountCenter.items.billing.subtitle') || 'Payment methods and invoices'}
|
|
152
|
+
onPress={() => navigate?.('PaymentGateway')}
|
|
153
|
+
/>
|
|
154
|
+
) : null}
|
|
155
|
+
</SettingsListGroup>
|
|
174
156
|
|
|
175
157
|
{/* Multi-Account Management */}
|
|
176
158
|
{sessions && sessions.length > 1 && (
|
|
177
|
-
<
|
|
178
|
-
<
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
id: 'add',
|
|
190
|
-
icon: 'account-plus',
|
|
191
|
-
iconColor: colors.iconPersonalInfo,
|
|
192
|
-
title: t('accountCenter.items.addAccount.title') || 'Add Another Account',
|
|
193
|
-
subtitle: t('accountCenter.items.addAccount.subtitle') || 'Sign in with a different account',
|
|
194
|
-
onPress: () => navigate?.('OxyAuth'),
|
|
195
|
-
},
|
|
196
|
-
], [sessions.length, navigate, t, colors])}
|
|
197
|
-
|
|
159
|
+
<SettingsListGroup title={t('accountCenter.sections.multiAccount') || 'Multi-Account'}>
|
|
160
|
+
<SettingsListItem
|
|
161
|
+
icon={<SettingsIcon name="account-group" color={colors.iconStorage} />}
|
|
162
|
+
title={t('accountCenter.items.switchAccount.title') || 'Switch Account'}
|
|
163
|
+
description={t('accountCenter.items.switchAccount.subtitle', { count: sessions.length }) || `${sessions.length} accounts available`}
|
|
164
|
+
onPress={() => navigate?.('AccountSwitcher')}
|
|
165
|
+
/>
|
|
166
|
+
<SettingsListItem
|
|
167
|
+
icon={<SettingsIcon name="account-plus" color={colors.iconPersonalInfo} />}
|
|
168
|
+
title={t('accountCenter.items.addAccount.title') || 'Add Another Account'}
|
|
169
|
+
description={t('accountCenter.items.addAccount.subtitle') || 'Sign in with a different account'}
|
|
170
|
+
onPress={() => navigate?.('OxyAuth')}
|
|
198
171
|
/>
|
|
199
|
-
</
|
|
172
|
+
</SettingsListGroup>
|
|
200
173
|
)}
|
|
201
174
|
|
|
202
175
|
{/* Single Account Setup */}
|
|
203
176
|
{(!sessions || sessions.length <= 1) && (
|
|
204
|
-
<
|
|
205
|
-
<
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
iconColor: colors.iconPersonalInfo,
|
|
211
|
-
title: t('accountCenter.items.addAccount.title') || 'Add Another Account',
|
|
212
|
-
subtitle: t('accountCenter.items.addAccount.subtitle') || 'Sign in with a different account',
|
|
213
|
-
onPress: () => navigate?.('OxyAuth'),
|
|
214
|
-
},
|
|
215
|
-
], [navigate, t, colors])}
|
|
216
|
-
|
|
177
|
+
<SettingsListGroup title={t('accountCenter.sections.addAccount') || 'Add Account'}>
|
|
178
|
+
<SettingsListItem
|
|
179
|
+
icon={<SettingsIcon name="account-plus" color={colors.iconPersonalInfo} />}
|
|
180
|
+
title={t('accountCenter.items.addAccount.title') || 'Add Another Account'}
|
|
181
|
+
description={t('accountCenter.items.addAccount.subtitle') || 'Sign in with a different account'}
|
|
182
|
+
onPress={() => navigate?.('OxyAuth')}
|
|
217
183
|
/>
|
|
218
|
-
</
|
|
184
|
+
</SettingsListGroup>
|
|
219
185
|
)}
|
|
220
186
|
|
|
221
187
|
{/* Additional Options */}
|
|
222
|
-
<
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
iconColor: colors.iconPersonalInfo,
|
|
237
|
-
title: t('language.title') || 'Language',
|
|
238
|
-
subtitle: t('language.subtitle') || 'Choose your preferred language',
|
|
239
|
-
onPress: () => navigate?.('LanguageSelector'),
|
|
240
|
-
},
|
|
241
|
-
{
|
|
242
|
-
id: 'help',
|
|
243
|
-
icon: 'help-circle',
|
|
244
|
-
iconColor: colors.iconSecurity,
|
|
245
|
-
title: t('accountOverview.items.help.title') || 'Help & Support',
|
|
246
|
-
subtitle: t('accountOverview.items.help.subtitle') || 'Get help and contact support',
|
|
247
|
-
onPress: () => navigate?.('HelpSupport'),
|
|
248
|
-
},
|
|
249
|
-
{
|
|
250
|
-
id: 'appinfo',
|
|
251
|
-
icon: 'information',
|
|
252
|
-
iconColor: '#8E8E93',
|
|
253
|
-
title: t('accountCenter.items.appInfo.title') || 'App Information',
|
|
254
|
-
subtitle: t('accountCenter.items.appInfo.subtitle') || 'Version and system details',
|
|
255
|
-
onPress: () => navigate?.('AppInfo'),
|
|
256
|
-
},
|
|
257
|
-
], [navigate, t, colors, Platform.OS])}
|
|
258
|
-
|
|
188
|
+
<SettingsListGroup title={t('accountCenter.sections.moreOptions') || 'More Options'}>
|
|
189
|
+
{Platform.OS !== 'web' ? (
|
|
190
|
+
<SettingsListItem
|
|
191
|
+
icon={<SettingsIcon name="bell" color={colors.iconStorage} />}
|
|
192
|
+
title={t('accountCenter.items.notifications.title') || 'Notifications'}
|
|
193
|
+
description={t('accountCenter.items.notifications.subtitle') || 'Manage notification settings'}
|
|
194
|
+
onPress={() => navigate?.('AccountSettings', { activeTab: 'notifications' })}
|
|
195
|
+
/>
|
|
196
|
+
) : null}
|
|
197
|
+
<SettingsListItem
|
|
198
|
+
icon={<SettingsIcon name="translate" color={colors.iconPersonalInfo} />}
|
|
199
|
+
title={t('language.title') || 'Language'}
|
|
200
|
+
description={t('language.subtitle') || 'Choose your preferred language'}
|
|
201
|
+
onPress={() => navigate?.('LanguageSelector')}
|
|
259
202
|
/>
|
|
260
|
-
|
|
203
|
+
<SettingsListItem
|
|
204
|
+
icon={<SettingsIcon name="help-circle" color={colors.iconSecurity} />}
|
|
205
|
+
title={t('accountOverview.items.help.title') || 'Help & Support'}
|
|
206
|
+
description={t('accountOverview.items.help.subtitle') || 'Get help and contact support'}
|
|
207
|
+
onPress={() => navigate?.('HelpSupport')}
|
|
208
|
+
/>
|
|
209
|
+
<SettingsListItem
|
|
210
|
+
icon={<SettingsIcon name="information" color="#8E8E93" />}
|
|
211
|
+
title={t('accountCenter.items.appInfo.title') || 'App Information'}
|
|
212
|
+
description={t('accountCenter.items.appInfo.subtitle') || 'Version and system details'}
|
|
213
|
+
onPress={() => navigate?.('AppInfo')}
|
|
214
|
+
/>
|
|
215
|
+
</SettingsListGroup>
|
|
261
216
|
|
|
262
217
|
{/* Sign Out Section */}
|
|
263
|
-
<
|
|
264
|
-
<
|
|
265
|
-
icon="logout"
|
|
266
|
-
iconColor={dangerColor}
|
|
218
|
+
<SettingsListGroup>
|
|
219
|
+
<SettingsListItem
|
|
220
|
+
icon={<SettingsIcon name="logout" color={dangerColor} />}
|
|
267
221
|
title={isLoading ? (t('accountCenter.signingOut') || 'Signing out...') : (t('common.actions.signOut') || 'Sign Out')}
|
|
268
|
-
|
|
269
222
|
onPress={confirmLogout}
|
|
270
|
-
|
|
271
|
-
isLast={true}
|
|
223
|
+
destructive={true}
|
|
272
224
|
showChevron={false}
|
|
273
225
|
disabled={isLoading}
|
|
274
|
-
|
|
275
|
-
<ActivityIndicator color={dangerColor} size="small"
|
|
276
|
-
) :
|
|
226
|
+
rightElement={isLoading ? (
|
|
227
|
+
<ActivityIndicator color={dangerColor} size="small" />
|
|
228
|
+
) : undefined}
|
|
277
229
|
/>
|
|
278
|
-
</
|
|
230
|
+
</SettingsListGroup>
|
|
279
231
|
|
|
280
232
|
<View style={styles.versionContainer}>
|
|
281
233
|
<Text style={[styles.versionText, { color: themeStyles.isDarkTheme ? '#666666' : '#999999' }]}>
|