@oxyhq/services 5.13.4 → 5.13.10

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.
Files changed (170) hide show
  1. package/lib/commonjs/core/HttpClient.js +1 -1
  2. package/lib/commonjs/core/HttpClient.js.map +1 -1
  3. package/lib/commonjs/core/OxyServices.js +83 -30
  4. package/lib/commonjs/core/OxyServices.js.map +1 -1
  5. package/lib/commonjs/core/index.js +0 -7
  6. package/lib/commonjs/core/index.js.map +1 -1
  7. package/lib/commonjs/i18n/locales/en-US.json +222 -6
  8. package/lib/commonjs/index.js +0 -7
  9. package/lib/commonjs/index.js.map +1 -1
  10. package/lib/commonjs/lib/sonner.js.map +1 -1
  11. package/lib/commonjs/ui/components/GroupedItem.js +24 -22
  12. package/lib/commonjs/ui/components/GroupedItem.js.map +1 -1
  13. package/lib/commonjs/ui/components/OxyProvider.js +35 -14
  14. package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
  15. package/lib/commonjs/ui/navigation/routes.js +36 -1
  16. package/lib/commonjs/ui/navigation/routes.js.map +1 -1
  17. package/lib/commonjs/ui/screens/AccountOverviewScreen.js +150 -5
  18. package/lib/commonjs/ui/screens/AccountOverviewScreen.js.map +1 -1
  19. package/lib/commonjs/ui/screens/AccountSettingsScreen.js +475 -319
  20. package/lib/commonjs/ui/screens/AccountSettingsScreen.js.map +1 -1
  21. package/lib/commonjs/ui/screens/AccountVerificationScreen.js +217 -0
  22. package/lib/commonjs/ui/screens/AccountVerificationScreen.js.map +1 -0
  23. package/lib/commonjs/ui/screens/FileManagementScreen.js +911 -213
  24. package/lib/commonjs/ui/screens/FileManagementScreen.js.map +1 -1
  25. package/lib/commonjs/ui/screens/HelpSupportScreen.js +131 -0
  26. package/lib/commonjs/ui/screens/HelpSupportScreen.js.map +1 -0
  27. package/lib/commonjs/ui/screens/HistoryViewScreen.js +258 -0
  28. package/lib/commonjs/ui/screens/HistoryViewScreen.js.map +1 -0
  29. package/lib/commonjs/ui/screens/LegalDocumentsScreen.js +211 -0
  30. package/lib/commonjs/ui/screens/LegalDocumentsScreen.js.map +1 -0
  31. package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js +0 -1
  32. package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
  33. package/lib/commonjs/ui/screens/PrivacySettingsScreen.js +307 -0
  34. package/lib/commonjs/ui/screens/PrivacySettingsScreen.js.map +1 -0
  35. package/lib/commonjs/ui/screens/ProfileScreen.js +1 -7
  36. package/lib/commonjs/ui/screens/ProfileScreen.js.map +1 -1
  37. package/lib/commonjs/ui/screens/SavesCollectionsScreen.js +205 -0
  38. package/lib/commonjs/ui/screens/SavesCollectionsScreen.js.map +1 -0
  39. package/lib/commonjs/ui/screens/SearchSettingsScreen.js +239 -0
  40. package/lib/commonjs/ui/screens/SearchSettingsScreen.js.map +1 -0
  41. package/lib/commonjs/ui/screens/SignInScreen.js +14 -29
  42. package/lib/commonjs/ui/screens/SignInScreen.js.map +1 -1
  43. package/lib/commonjs/utils/asyncUtils.js +1 -0
  44. package/lib/commonjs/utils/asyncUtils.js.map +1 -1
  45. package/lib/commonjs/utils/cache.js +4 -4
  46. package/lib/commonjs/utils/cache.js.map +1 -1
  47. package/lib/commonjs/utils/index.js +0 -6
  48. package/lib/commonjs/utils/index.js.map +1 -1
  49. package/lib/module/core/HttpClient.js +1 -1
  50. package/lib/module/core/HttpClient.js.map +1 -1
  51. package/lib/module/core/OxyServices.js +82 -29
  52. package/lib/module/core/OxyServices.js.map +1 -1
  53. package/lib/module/core/index.js +1 -1
  54. package/lib/module/core/index.js.map +1 -1
  55. package/lib/module/i18n/locales/en-US.json +222 -6
  56. package/lib/module/index.js +1 -1
  57. package/lib/module/index.js.map +1 -1
  58. package/lib/module/lib/sonner.js.map +1 -1
  59. package/lib/module/ui/components/GroupedItem.js +24 -22
  60. package/lib/module/ui/components/GroupedItem.js.map +1 -1
  61. package/lib/module/ui/components/OxyProvider.js +40 -17
  62. package/lib/module/ui/components/OxyProvider.js.map +1 -1
  63. package/lib/module/ui/navigation/routes.js +36 -1
  64. package/lib/module/ui/navigation/routes.js.map +1 -1
  65. package/lib/module/ui/screens/AccountOverviewScreen.js +151 -6
  66. package/lib/module/ui/screens/AccountOverviewScreen.js.map +1 -1
  67. package/lib/module/ui/screens/AccountSettingsScreen.js +475 -319
  68. package/lib/module/ui/screens/AccountSettingsScreen.js.map +1 -1
  69. package/lib/module/ui/screens/AccountVerificationScreen.js +212 -0
  70. package/lib/module/ui/screens/AccountVerificationScreen.js.map +1 -0
  71. package/lib/module/ui/screens/FileManagementScreen.js +913 -212
  72. package/lib/module/ui/screens/FileManagementScreen.js.map +1 -1
  73. package/lib/module/ui/screens/HelpSupportScreen.js +126 -0
  74. package/lib/module/ui/screens/HelpSupportScreen.js.map +1 -0
  75. package/lib/module/ui/screens/HistoryViewScreen.js +253 -0
  76. package/lib/module/ui/screens/HistoryViewScreen.js.map +1 -0
  77. package/lib/module/ui/screens/LegalDocumentsScreen.js +206 -0
  78. package/lib/module/ui/screens/LegalDocumentsScreen.js.map +1 -0
  79. package/lib/module/ui/screens/PremiumSubscriptionScreen.js +0 -1
  80. package/lib/module/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
  81. package/lib/module/ui/screens/PrivacySettingsScreen.js +302 -0
  82. package/lib/module/ui/screens/PrivacySettingsScreen.js.map +1 -0
  83. package/lib/module/ui/screens/ProfileScreen.js +1 -7
  84. package/lib/module/ui/screens/ProfileScreen.js.map +1 -1
  85. package/lib/module/ui/screens/SavesCollectionsScreen.js +200 -0
  86. package/lib/module/ui/screens/SavesCollectionsScreen.js.map +1 -0
  87. package/lib/module/ui/screens/SearchSettingsScreen.js +234 -0
  88. package/lib/module/ui/screens/SearchSettingsScreen.js.map +1 -0
  89. package/lib/module/ui/screens/SignInScreen.js +14 -29
  90. package/lib/module/ui/screens/SignInScreen.js.map +1 -1
  91. package/lib/module/utils/asyncUtils.js +1 -0
  92. package/lib/module/utils/asyncUtils.js.map +1 -1
  93. package/lib/module/utils/cache.js +3 -3
  94. package/lib/module/utils/cache.js.map +1 -1
  95. package/lib/module/utils/index.js +1 -1
  96. package/lib/module/utils/index.js.map +1 -1
  97. package/lib/typescript/core/OxyServices.d.ts +30 -24
  98. package/lib/typescript/core/OxyServices.d.ts.map +1 -1
  99. package/lib/typescript/core/index.d.ts +1 -1
  100. package/lib/typescript/core/index.d.ts.map +1 -1
  101. package/lib/typescript/index.d.ts +1 -1
  102. package/lib/typescript/index.d.ts.map +1 -1
  103. package/lib/typescript/lib/sonner.d.ts +1 -0
  104. package/lib/typescript/lib/sonner.d.ts.map +1 -1
  105. package/lib/typescript/types/expo-document-picker.d.ts +36 -0
  106. package/lib/typescript/ui/components/GroupedItem.d.ts.map +1 -1
  107. package/lib/typescript/ui/components/OxyProvider.d.ts.map +1 -1
  108. package/lib/typescript/ui/navigation/routes.d.ts +1 -1
  109. package/lib/typescript/ui/navigation/routes.d.ts.map +1 -1
  110. package/lib/typescript/ui/screens/AccountOverviewScreen.d.ts.map +1 -1
  111. package/lib/typescript/ui/screens/AccountSettingsScreen.d.ts.map +1 -1
  112. package/lib/typescript/ui/screens/AccountVerificationScreen.d.ts +5 -0
  113. package/lib/typescript/ui/screens/AccountVerificationScreen.d.ts.map +1 -0
  114. package/lib/typescript/ui/screens/FileManagementScreen.d.ts.map +1 -1
  115. package/lib/typescript/ui/screens/HelpSupportScreen.d.ts +5 -0
  116. package/lib/typescript/ui/screens/HelpSupportScreen.d.ts.map +1 -0
  117. package/lib/typescript/ui/screens/HistoryViewScreen.d.ts +5 -0
  118. package/lib/typescript/ui/screens/HistoryViewScreen.d.ts.map +1 -0
  119. package/lib/typescript/ui/screens/LegalDocumentsScreen.d.ts +5 -0
  120. package/lib/typescript/ui/screens/LegalDocumentsScreen.d.ts.map +1 -0
  121. package/lib/typescript/ui/screens/PremiumSubscriptionScreen.d.ts.map +1 -1
  122. package/lib/typescript/ui/screens/PrivacySettingsScreen.d.ts +5 -0
  123. package/lib/typescript/ui/screens/PrivacySettingsScreen.d.ts.map +1 -0
  124. package/lib/typescript/ui/screens/ProfileScreen.d.ts.map +1 -1
  125. package/lib/typescript/ui/screens/SavesCollectionsScreen.d.ts +5 -0
  126. package/lib/typescript/ui/screens/SavesCollectionsScreen.d.ts.map +1 -0
  127. package/lib/typescript/ui/screens/SearchSettingsScreen.d.ts +5 -0
  128. package/lib/typescript/ui/screens/SearchSettingsScreen.d.ts.map +1 -0
  129. package/lib/typescript/ui/screens/SignInScreen.d.ts.map +1 -1
  130. package/lib/typescript/utils/asyncUtils.d.ts.map +1 -1
  131. package/lib/typescript/utils/cache.d.ts +3 -3
  132. package/lib/typescript/utils/cache.d.ts.map +1 -1
  133. package/lib/typescript/utils/index.d.ts +1 -1
  134. package/lib/typescript/utils/index.d.ts.map +1 -1
  135. package/package.json +1 -1
  136. package/src/core/HttpClient.ts +1 -1
  137. package/src/core/OxyServices.ts +80 -30
  138. package/src/core/index.ts +1 -1
  139. package/src/i18n/locales/en-US.json +222 -6
  140. package/src/index.ts +1 -1
  141. package/src/lib/sonner.ts +1 -0
  142. package/src/types/expo-document-picker.d.ts +36 -0
  143. package/src/ui/components/GroupedItem.tsx +23 -21
  144. package/src/ui/components/OxyProvider.tsx +33 -11
  145. package/src/ui/navigation/routes.ts +42 -0
  146. package/src/ui/screens/AccountOverviewScreen.tsx +175 -5
  147. package/src/ui/screens/AccountSettingsScreen.tsx +521 -360
  148. package/src/ui/screens/AccountVerificationScreen.tsx +235 -0
  149. package/src/ui/screens/FileManagementScreen.tsx +934 -208
  150. package/src/ui/screens/HelpSupportScreen.tsx +143 -0
  151. package/src/ui/screens/HistoryViewScreen.tsx +280 -0
  152. package/src/ui/screens/LegalDocumentsScreen.tsx +220 -0
  153. package/src/ui/screens/PremiumSubscriptionScreen.tsx +0 -1
  154. package/src/ui/screens/PrivacySettingsScreen.tsx +332 -0
  155. package/src/ui/screens/ProfileScreen.tsx +1 -8
  156. package/src/ui/screens/SavesCollectionsScreen.tsx +222 -0
  157. package/src/ui/screens/SearchSettingsScreen.tsx +219 -0
  158. package/src/ui/screens/SignInScreen.tsx +19 -35
  159. package/src/utils/asyncUtils.ts +1 -0
  160. package/src/utils/cache.ts +3 -3
  161. package/src/utils/index.ts +1 -1
  162. package/lib/commonjs/ui/components/StepBasedScreen.README.md +0 -337
  163. package/lib/commonjs/ui/components/internal/TextField.md +0 -436
  164. package/lib/commonjs/ui/styles/FONTS.md +0 -126
  165. package/lib/module/ui/components/StepBasedScreen.README.md +0 -337
  166. package/lib/module/ui/components/internal/TextField.md +0 -436
  167. package/lib/module/ui/styles/FONTS.md +0 -126
  168. package/src/ui/components/StepBasedScreen.README.md +0 -337
  169. package/src/ui/components/internal/TextField.md +0 -436
  170. package/src/ui/styles/FONTS.md +0 -126
@@ -0,0 +1,235 @@
1
+ import React, { useState, useCallback, useMemo } from 'react';
2
+ import {
3
+ View,
4
+ Text,
5
+ StyleSheet,
6
+ ScrollView,
7
+ TextInput,
8
+ TouchableOpacity,
9
+ ActivityIndicator,
10
+ Alert,
11
+ } from 'react-native';
12
+ import type { BaseScreenProps } from '../navigation/types';
13
+ import { useOxy } from '../context/OxyContext';
14
+ import { toast } from '../../lib/sonner';
15
+ import { Header, Section } from '../components';
16
+ import { useI18n } from '../hooks/useI18n';
17
+
18
+ const AccountVerificationScreen: React.FC<BaseScreenProps> = ({
19
+ onClose,
20
+ theme,
21
+ goBack,
22
+ }) => {
23
+ const { oxyServices, user } = useOxy();
24
+ const { t } = useI18n();
25
+ const [reason, setReason] = useState('');
26
+ const [evidence, setEvidence] = useState('');
27
+ const [isSubmitting, setIsSubmitting] = useState(false);
28
+
29
+ const themeStyles = useMemo(() => {
30
+ const isDarkTheme = theme === 'dark';
31
+ return {
32
+ textColor: isDarkTheme ? '#FFFFFF' : '#000000',
33
+ backgroundColor: isDarkTheme ? '#121212' : '#FFFFFF',
34
+ secondaryBackgroundColor: isDarkTheme ? '#222222' : '#F5F5F5',
35
+ borderColor: isDarkTheme ? '#444444' : '#E0E0E0',
36
+ mutedTextColor: isDarkTheme ? '#8E8E93' : '#8E8E93',
37
+ inputBackgroundColor: isDarkTheme ? '#1C1C1E' : '#F2F2F7',
38
+ inputTextColor: isDarkTheme ? '#FFFFFF' : '#000000',
39
+ placeholderTextColor: isDarkTheme ? '#8E8E93' : '#8E8E93',
40
+ };
41
+ }, [theme]);
42
+
43
+ const handleSubmit = useCallback(async () => {
44
+ if (!reason.trim()) {
45
+ toast.error(t('accountVerification.reasonRequired') || 'Please provide a reason for verification');
46
+ return;
47
+ }
48
+
49
+ if (!oxyServices) {
50
+ toast.error(t('accountVerification.error') || 'Service not available');
51
+ return;
52
+ }
53
+
54
+ setIsSubmitting(true);
55
+ try {
56
+ const result = await oxyServices.requestAccountVerification(
57
+ reason.trim(),
58
+ evidence.trim() || undefined
59
+ );
60
+
61
+ Alert.alert(
62
+ t('accountVerification.successTitle') || 'Request Submitted',
63
+ t('accountVerification.successMessage') || `Your verification request has been submitted. Request ID: ${result.requestId}`,
64
+ [
65
+ {
66
+ text: t('accountVerification.ok') || 'OK',
67
+ onPress: () => {
68
+ setReason('');
69
+ setEvidence('');
70
+ goBack?.();
71
+ },
72
+ },
73
+ ]
74
+ );
75
+ } catch (error: any) {
76
+ console.error('Failed to submit verification request:', error);
77
+ toast.error(
78
+ error?.message || t('accountVerification.submitError') || 'Failed to submit verification request'
79
+ );
80
+ } finally {
81
+ setIsSubmitting(false);
82
+ }
83
+ }, [reason, evidence, oxyServices, t, goBack]);
84
+
85
+ return (
86
+ <View style={[styles.container, { backgroundColor: themeStyles.backgroundColor }]}>
87
+ <Header
88
+ title={t('accountVerification.title') || 'Account Verification'}
89
+ theme={theme}
90
+ onBack={goBack || onClose}
91
+ variant="minimal"
92
+ elevation="subtle"
93
+ />
94
+
95
+ <ScrollView style={styles.content}>
96
+ <Section theme={theme} isFirst={true}>
97
+ <Text style={[styles.description, { color: themeStyles.mutedTextColor }]}>
98
+ {t('accountVerification.description') || 'Request a verified badge for your account. Verified accounts help establish authenticity and credibility.'}
99
+ </Text>
100
+ </Section>
101
+
102
+ <Section title={t('accountVerification.sections.request') || 'VERIFICATION REQUEST'} theme={theme}>
103
+ <View style={styles.inputGroup}>
104
+ <Text style={[styles.label, { color: themeStyles.textColor }]}>
105
+ {t('accountVerification.reasonLabel') || 'Reason for Verification *'}
106
+ </Text>
107
+ <TextInput
108
+ style={[
109
+ styles.textInput,
110
+ styles.textArea,
111
+ {
112
+ backgroundColor: themeStyles.inputBackgroundColor,
113
+ color: themeStyles.inputTextColor,
114
+ borderColor: themeStyles.borderColor,
115
+ },
116
+ ]}
117
+ value={reason}
118
+ onChangeText={setReason}
119
+ placeholder={t('accountVerification.reasonPlaceholder') || 'Explain why you need a verified badge (e.g., public figure, brand, organization)'}
120
+ placeholderTextColor={themeStyles.placeholderTextColor}
121
+ multiline
122
+ numberOfLines={4}
123
+ textAlignVertical="top"
124
+ editable={!isSubmitting}
125
+ />
126
+ </View>
127
+
128
+ <View style={styles.inputGroup}>
129
+ <Text style={[styles.label, { color: themeStyles.textColor }]}>
130
+ {t('accountVerification.evidenceLabel') || 'Evidence (Optional)'}
131
+ </Text>
132
+ <TextInput
133
+ style={[
134
+ styles.textInput,
135
+ styles.textArea,
136
+ {
137
+ backgroundColor: themeStyles.inputBackgroundColor,
138
+ color: themeStyles.inputTextColor,
139
+ borderColor: themeStyles.borderColor,
140
+ },
141
+ ]}
142
+ value={evidence}
143
+ onChangeText={setEvidence}
144
+ placeholder={t('accountVerification.evidencePlaceholder') || 'Provide any supporting documentation or links (e.g., official website, social media profiles)'}
145
+ placeholderTextColor={themeStyles.placeholderTextColor}
146
+ multiline
147
+ numberOfLines={4}
148
+ textAlignVertical="top"
149
+ editable={!isSubmitting}
150
+ />
151
+ </View>
152
+ </Section>
153
+
154
+ <Section theme={theme}>
155
+ <TouchableOpacity
156
+ style={[
157
+ styles.submitButton,
158
+ { backgroundColor: isSubmitting ? themeStyles.mutedTextColor : '#007AFF' },
159
+ ]}
160
+ onPress={handleSubmit}
161
+ disabled={isSubmitting || !reason.trim()}
162
+ >
163
+ {isSubmitting ? (
164
+ <ActivityIndicator color="#FFFFFF" />
165
+ ) : (
166
+ <Text style={styles.submitButtonText}>
167
+ {t('accountVerification.submit') || 'Submit Request'}
168
+ </Text>
169
+ )}
170
+ </TouchableOpacity>
171
+ </Section>
172
+
173
+ <Section theme={theme}>
174
+ <Text style={[styles.note, { color: themeStyles.mutedTextColor }]}>
175
+ {t('accountVerification.note') || 'Note: Verification requests are reviewed manually and may take several days. We will notify you once your request has been reviewed.'}
176
+ </Text>
177
+ </Section>
178
+ </ScrollView>
179
+ </View>
180
+ );
181
+ };
182
+
183
+ const styles = StyleSheet.create({
184
+ container: {
185
+ flex: 1,
186
+ },
187
+ content: {
188
+ flex: 1,
189
+ padding: 16,
190
+ },
191
+ description: {
192
+ fontSize: 16,
193
+ lineHeight: 24,
194
+ marginBottom: 8,
195
+ },
196
+ inputGroup: {
197
+ marginBottom: 24,
198
+ },
199
+ label: {
200
+ fontSize: 16,
201
+ fontWeight: '500',
202
+ marginBottom: 8,
203
+ },
204
+ textInput: {
205
+ borderWidth: 1,
206
+ borderRadius: 8,
207
+ padding: 12,
208
+ fontSize: 16,
209
+ minHeight: 44,
210
+ },
211
+ textArea: {
212
+ minHeight: 100,
213
+ paddingTop: 12,
214
+ },
215
+ submitButton: {
216
+ borderRadius: 8,
217
+ padding: 16,
218
+ alignItems: 'center',
219
+ justifyContent: 'center',
220
+ minHeight: 50,
221
+ },
222
+ submitButtonText: {
223
+ color: '#FFFFFF',
224
+ fontSize: 16,
225
+ fontWeight: '600',
226
+ },
227
+ note: {
228
+ fontSize: 14,
229
+ lineHeight: 20,
230
+ fontStyle: 'italic',
231
+ },
232
+ });
233
+
234
+ export default React.memo(AccountVerificationScreen);
235
+