@oxyhq/services 5.13.3 → 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.
- package/lib/commonjs/core/HttpClient.js +1 -1
- package/lib/commonjs/core/HttpClient.js.map +1 -1
- package/lib/commonjs/core/OxyServices.js +82 -8
- package/lib/commonjs/core/OxyServices.js.map +1 -1
- package/lib/commonjs/i18n/locales/en-US.json +222 -6
- package/lib/commonjs/lib/sonner.js.map +1 -1
- package/lib/commonjs/ui/components/GroupedItem.js +24 -22
- package/lib/commonjs/ui/components/GroupedItem.js.map +1 -1
- package/lib/commonjs/ui/components/OxyProvider.js +35 -14
- package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
- package/lib/commonjs/ui/navigation/routes.js +36 -1
- package/lib/commonjs/ui/navigation/routes.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountOverviewScreen.js +150 -5
- package/lib/commonjs/ui/screens/AccountOverviewScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js +475 -319
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountVerificationScreen.js +217 -0
- package/lib/commonjs/ui/screens/AccountVerificationScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/FileManagementScreen.js +911 -213
- package/lib/commonjs/ui/screens/FileManagementScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/HelpSupportScreen.js +131 -0
- package/lib/commonjs/ui/screens/HelpSupportScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/HistoryViewScreen.js +258 -0
- package/lib/commonjs/ui/screens/HistoryViewScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/LegalDocumentsScreen.js +211 -0
- package/lib/commonjs/ui/screens/LegalDocumentsScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js +0 -1
- package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PrivacySettingsScreen.js +307 -0
- package/lib/commonjs/ui/screens/PrivacySettingsScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/ProfileScreen.js +1 -7
- package/lib/commonjs/ui/screens/ProfileScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SavesCollectionsScreen.js +205 -0
- package/lib/commonjs/ui/screens/SavesCollectionsScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/SearchSettingsScreen.js +239 -0
- package/lib/commonjs/ui/screens/SearchSettingsScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/SignInScreen.js +14 -29
- package/lib/commonjs/ui/screens/SignInScreen.js.map +1 -1
- package/lib/commonjs/utils/asyncUtils.js +1 -0
- package/lib/commonjs/utils/asyncUtils.js.map +1 -1
- package/lib/commonjs/utils/cache.js +4 -4
- package/lib/commonjs/utils/cache.js.map +1 -1
- package/lib/commonjs/utils/index.js +0 -6
- package/lib/commonjs/utils/index.js.map +1 -1
- package/lib/module/core/HttpClient.js +1 -1
- package/lib/module/core/HttpClient.js.map +1 -1
- package/lib/module/core/OxyServices.js +82 -8
- package/lib/module/core/OxyServices.js.map +1 -1
- package/lib/module/i18n/locales/en-US.json +222 -6
- package/lib/module/lib/sonner.js.map +1 -1
- package/lib/module/ui/components/GroupedItem.js +24 -22
- package/lib/module/ui/components/GroupedItem.js.map +1 -1
- package/lib/module/ui/components/OxyProvider.js +40 -17
- package/lib/module/ui/components/OxyProvider.js.map +1 -1
- package/lib/module/ui/navigation/routes.js +36 -1
- package/lib/module/ui/navigation/routes.js.map +1 -1
- package/lib/module/ui/screens/AccountOverviewScreen.js +151 -6
- package/lib/module/ui/screens/AccountOverviewScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountSettingsScreen.js +475 -319
- package/lib/module/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountVerificationScreen.js +212 -0
- package/lib/module/ui/screens/AccountVerificationScreen.js.map +1 -0
- package/lib/module/ui/screens/FileManagementScreen.js +913 -212
- package/lib/module/ui/screens/FileManagementScreen.js.map +1 -1
- package/lib/module/ui/screens/HelpSupportScreen.js +126 -0
- package/lib/module/ui/screens/HelpSupportScreen.js.map +1 -0
- package/lib/module/ui/screens/HistoryViewScreen.js +253 -0
- package/lib/module/ui/screens/HistoryViewScreen.js.map +1 -0
- package/lib/module/ui/screens/LegalDocumentsScreen.js +206 -0
- package/lib/module/ui/screens/LegalDocumentsScreen.js.map +1 -0
- package/lib/module/ui/screens/PremiumSubscriptionScreen.js +0 -1
- package/lib/module/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
- package/lib/module/ui/screens/PrivacySettingsScreen.js +302 -0
- package/lib/module/ui/screens/PrivacySettingsScreen.js.map +1 -0
- package/lib/module/ui/screens/ProfileScreen.js +1 -7
- package/lib/module/ui/screens/ProfileScreen.js.map +1 -1
- package/lib/module/ui/screens/SavesCollectionsScreen.js +200 -0
- package/lib/module/ui/screens/SavesCollectionsScreen.js.map +1 -0
- package/lib/module/ui/screens/SearchSettingsScreen.js +234 -0
- package/lib/module/ui/screens/SearchSettingsScreen.js.map +1 -0
- package/lib/module/ui/screens/SignInScreen.js +14 -29
- package/lib/module/ui/screens/SignInScreen.js.map +1 -1
- package/lib/module/utils/asyncUtils.js +1 -0
- package/lib/module/utils/asyncUtils.js.map +1 -1
- package/lib/module/utils/cache.js +3 -3
- package/lib/module/utils/cache.js.map +1 -1
- package/lib/module/utils/index.js +1 -1
- package/lib/module/utils/index.js.map +1 -1
- package/lib/typescript/core/OxyServices.d.ts +30 -6
- package/lib/typescript/core/OxyServices.d.ts.map +1 -1
- package/lib/typescript/lib/sonner.d.ts +1 -0
- package/lib/typescript/lib/sonner.d.ts.map +1 -1
- package/lib/typescript/types/expo-document-picker.d.ts +36 -0
- package/lib/typescript/ui/components/GroupedItem.d.ts.map +1 -1
- package/lib/typescript/ui/components/OxyProvider.d.ts.map +1 -1
- package/lib/typescript/ui/navigation/routes.d.ts +1 -1
- package/lib/typescript/ui/navigation/routes.d.ts.map +1 -1
- package/lib/typescript/ui/screens/AccountOverviewScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/AccountSettingsScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/AccountVerificationScreen.d.ts +5 -0
- package/lib/typescript/ui/screens/AccountVerificationScreen.d.ts.map +1 -0
- package/lib/typescript/ui/screens/FileManagementScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/HelpSupportScreen.d.ts +5 -0
- package/lib/typescript/ui/screens/HelpSupportScreen.d.ts.map +1 -0
- package/lib/typescript/ui/screens/HistoryViewScreen.d.ts +5 -0
- package/lib/typescript/ui/screens/HistoryViewScreen.d.ts.map +1 -0
- package/lib/typescript/ui/screens/LegalDocumentsScreen.d.ts +5 -0
- package/lib/typescript/ui/screens/LegalDocumentsScreen.d.ts.map +1 -0
- package/lib/typescript/ui/screens/PremiumSubscriptionScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/PrivacySettingsScreen.d.ts +5 -0
- package/lib/typescript/ui/screens/PrivacySettingsScreen.d.ts.map +1 -0
- package/lib/typescript/ui/screens/ProfileScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/SavesCollectionsScreen.d.ts +5 -0
- package/lib/typescript/ui/screens/SavesCollectionsScreen.d.ts.map +1 -0
- package/lib/typescript/ui/screens/SearchSettingsScreen.d.ts +5 -0
- package/lib/typescript/ui/screens/SearchSettingsScreen.d.ts.map +1 -0
- package/lib/typescript/ui/screens/SignInScreen.d.ts.map +1 -1
- package/lib/typescript/utils/asyncUtils.d.ts.map +1 -1
- package/lib/typescript/utils/cache.d.ts +3 -3
- package/lib/typescript/utils/cache.d.ts.map +1 -1
- package/lib/typescript/utils/index.d.ts +1 -1
- package/lib/typescript/utils/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/core/HttpClient.ts +1 -1
- package/src/core/OxyServices.ts +80 -8
- package/src/i18n/locales/en-US.json +222 -6
- package/src/lib/sonner.ts +1 -0
- package/src/types/expo-document-picker.d.ts +36 -0
- package/src/ui/components/GroupedItem.tsx +23 -21
- package/src/ui/components/OxyProvider.tsx +33 -11
- package/src/ui/navigation/routes.ts +42 -0
- package/src/ui/screens/AccountOverviewScreen.tsx +175 -5
- package/src/ui/screens/AccountSettingsScreen.tsx +521 -360
- package/src/ui/screens/AccountVerificationScreen.tsx +235 -0
- package/src/ui/screens/FileManagementScreen.tsx +934 -208
- package/src/ui/screens/HelpSupportScreen.tsx +143 -0
- package/src/ui/screens/HistoryViewScreen.tsx +280 -0
- package/src/ui/screens/LegalDocumentsScreen.tsx +220 -0
- package/src/ui/screens/PremiumSubscriptionScreen.tsx +0 -1
- package/src/ui/screens/PrivacySettingsScreen.tsx +332 -0
- package/src/ui/screens/ProfileScreen.tsx +1 -8
- package/src/ui/screens/SavesCollectionsScreen.tsx +222 -0
- package/src/ui/screens/SearchSettingsScreen.tsx +219 -0
- package/src/ui/screens/SignInScreen.tsx +19 -35
- package/src/utils/asyncUtils.ts +1 -0
- package/src/utils/cache.ts +3 -3
- package/src/utils/index.ts +1 -1
- package/lib/commonjs/ui/components/StepBasedScreen.README.md +0 -337
- package/lib/commonjs/ui/components/internal/TextField.md +0 -436
- package/lib/commonjs/ui/styles/FONTS.md +0 -126
- package/lib/module/ui/components/StepBasedScreen.README.md +0 -337
- package/lib/module/ui/components/internal/TextField.md +0 -436
- package/lib/module/ui/styles/FONTS.md +0 -126
- package/src/ui/components/StepBasedScreen.README.md +0 -337
- package/src/ui/components/internal/TextField.md +0 -436
- 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
|
+
|