@oxyhq/services 5.3.11 → 5.4.1
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/README.md +21 -0
- package/lib/commonjs/assets/assets/icons/OxyServices.tsx +67 -0
- package/lib/commonjs/assets/assets/icons/logo_OxyServices.svg +1 -0
- package/lib/commonjs/assets/icons/OxyServices.js +53 -0
- package/lib/commonjs/assets/icons/OxyServices.js.map +1 -0
- package/lib/commonjs/assets/icons/logo_OxyServices.svg +1 -0
- package/lib/commonjs/core/index.js +119 -23
- package/lib/commonjs/core/index.js.map +1 -1
- package/lib/commonjs/index.js +2 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/lib/sonner.js +15 -11
- package/lib/commonjs/lib/sonner.js.map +1 -1
- package/lib/commonjs/node/index.js +2 -0
- package/lib/commonjs/node/index.js.map +1 -1
- package/lib/commonjs/ui/components/GroupedItem.js +109 -0
- package/lib/commonjs/ui/components/GroupedItem.js.map +1 -0
- package/lib/commonjs/ui/components/GroupedSection.js +33 -0
- package/lib/commonjs/ui/components/GroupedSection.js.map +1 -0
- package/lib/commonjs/ui/components/OxyProvider.js +95 -112
- package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
- package/lib/commonjs/ui/components/ProfileCard.js +124 -0
- package/lib/commonjs/ui/components/ProfileCard.js.map +1 -0
- package/lib/commonjs/ui/components/QuickActions.js +87 -0
- package/lib/commonjs/ui/components/QuickActions.js.map +1 -0
- package/lib/commonjs/ui/components/Section.js +36 -0
- package/lib/commonjs/ui/components/Section.js.map +1 -0
- package/lib/commonjs/ui/components/SectionTitle.js +35 -0
- package/lib/commonjs/ui/components/SectionTitle.js.map +1 -0
- package/lib/commonjs/ui/components/bottomSheet/index.js +6 -6
- package/lib/commonjs/ui/components/index.js +97 -0
- package/lib/commonjs/ui/components/index.js.map +1 -0
- package/lib/commonjs/ui/navigation/OxyRouter.js +20 -3
- package/lib/commonjs/ui/navigation/OxyRouter.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountCenterScreen.js +190 -207
- package/lib/commonjs/ui/screens/AccountCenterScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountManagementDemo.js +299 -0
- package/lib/commonjs/ui/screens/AccountManagementDemo.js.map +1 -0
- package/lib/commonjs/ui/screens/AccountOverviewScreen.js +669 -401
- package/lib/commonjs/ui/screens/AccountOverviewScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js +695 -498
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountSwitcherScreen.js +451 -488
- package/lib/commonjs/ui/screens/AccountSwitcherScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AppInfoScreen.js +498 -185
- package/lib/commonjs/ui/screens/AppInfoScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/BillingManagementScreen.js +636 -0
- package/lib/commonjs/ui/screens/BillingManagementScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/FileManagementScreen.js +2497 -0
- package/lib/commonjs/ui/screens/FileManagementScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js +1620 -0
- package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/ProfileScreen.js +117 -13
- package/lib/commonjs/ui/screens/ProfileScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SessionManagementScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SignInScreen.js +1 -1
- package/lib/commonjs/ui/screens/SignUpScreen.js +1 -1
- package/lib/commonjs/utils/polyfills.js +42 -0
- package/lib/commonjs/utils/polyfills.js.map +1 -0
- package/lib/module/assets/assets/icons/OxyServices.tsx +67 -0
- package/lib/module/assets/assets/icons/logo_OxyServices.svg +1 -0
- package/lib/module/assets/icons/OxyServices.js +46 -0
- package/lib/module/assets/icons/OxyServices.js.map +1 -0
- package/lib/module/assets/icons/logo_OxyServices.svg +1 -0
- package/lib/module/core/index.js +119 -23
- package/lib/module/core/index.js.map +1 -1
- package/lib/module/index.js +3 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/lib/sonner.js +13 -1
- package/lib/module/lib/sonner.js.map +1 -1
- package/lib/module/node/index.js +3 -0
- package/lib/module/node/index.js.map +1 -1
- package/lib/module/ui/components/GroupedItem.js +104 -0
- package/lib/module/ui/components/GroupedItem.js.map +1 -0
- package/lib/module/ui/components/GroupedSection.js +28 -0
- package/lib/module/ui/components/GroupedSection.js.map +1 -0
- package/lib/module/ui/components/OxyProvider.js +97 -114
- package/lib/module/ui/components/OxyProvider.js.map +1 -1
- package/lib/module/ui/components/ProfileCard.js +119 -0
- package/lib/module/ui/components/ProfileCard.js.map +1 -0
- package/lib/module/ui/components/QuickActions.js +82 -0
- package/lib/module/ui/components/QuickActions.js.map +1 -0
- package/lib/module/ui/components/Section.js +31 -0
- package/lib/module/ui/components/Section.js.map +1 -0
- package/lib/module/ui/components/SectionTitle.js +30 -0
- package/lib/module/ui/components/SectionTitle.js.map +1 -0
- package/lib/module/ui/components/bottomSheet/index.js +2 -5
- package/lib/module/ui/components/bottomSheet/index.js.map +1 -1
- package/lib/module/ui/components/index.js +18 -0
- package/lib/module/ui/components/index.js.map +1 -0
- package/lib/module/ui/navigation/OxyRouter.js +20 -3
- package/lib/module/ui/navigation/OxyRouter.js.map +1 -1
- package/lib/module/ui/screens/AccountCenterScreen.js +191 -208
- package/lib/module/ui/screens/AccountCenterScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountManagementDemo.js +296 -0
- package/lib/module/ui/screens/AccountManagementDemo.js.map +1 -0
- package/lib/module/ui/screens/AccountOverviewScreen.js +671 -403
- package/lib/module/ui/screens/AccountOverviewScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountSettingsScreen.js +698 -501
- package/lib/module/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountSwitcherScreen.js +450 -488
- package/lib/module/ui/screens/AccountSwitcherScreen.js.map +1 -1
- package/lib/module/ui/screens/AppInfoScreen.js +498 -186
- package/lib/module/ui/screens/AppInfoScreen.js.map +1 -1
- package/lib/module/ui/screens/BillingManagementScreen.js +631 -0
- package/lib/module/ui/screens/BillingManagementScreen.js.map +1 -0
- package/lib/module/ui/screens/FileManagementScreen.js +2492 -0
- package/lib/module/ui/screens/FileManagementScreen.js.map +1 -0
- package/lib/module/ui/screens/PremiumSubscriptionScreen.js +1615 -0
- package/lib/module/ui/screens/PremiumSubscriptionScreen.js.map +1 -0
- package/lib/module/ui/screens/ProfileScreen.js +118 -14
- package/lib/module/ui/screens/ProfileScreen.js.map +1 -1
- package/lib/module/ui/screens/SessionManagementScreen.js.map +1 -1
- package/lib/module/ui/screens/SignInScreen.js +1 -1
- package/lib/module/ui/screens/SignInScreen.js.map +1 -1
- package/lib/module/ui/screens/SignUpScreen.js +1 -1
- package/lib/module/ui/screens/SignUpScreen.js.map +1 -1
- package/lib/module/utils/polyfills.js +36 -0
- package/lib/module/utils/polyfills.js.map +1 -0
- package/lib/typescript/assets/icons/OxyServices.d.ts +29 -0
- package/lib/typescript/assets/icons/OxyServices.d.ts.map +1 -0
- package/lib/typescript/core/index.d.ts +26 -1
- package/lib/typescript/core/index.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +1 -0
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/lib/sonner.d.ts +5 -1
- package/lib/typescript/lib/sonner.d.ts.map +1 -1
- package/lib/typescript/models/interfaces.d.ts +1 -2
- package/lib/typescript/models/interfaces.d.ts.map +1 -1
- package/lib/typescript/node/index.d.ts +1 -0
- package/lib/typescript/node/index.d.ts.map +1 -1
- package/lib/typescript/ui/components/GroupedItem.d.ts +17 -0
- package/lib/typescript/ui/components/GroupedItem.d.ts.map +1 -0
- package/lib/typescript/ui/components/GroupedSection.d.ts +19 -0
- package/lib/typescript/ui/components/GroupedSection.d.ts.map +1 -0
- package/lib/typescript/ui/components/OxyProvider.d.ts.map +1 -1
- package/lib/typescript/ui/components/ProfileCard.d.ts +20 -0
- package/lib/typescript/ui/components/ProfileCard.d.ts.map +1 -0
- package/lib/typescript/ui/components/QuickActions.d.ts +15 -0
- package/lib/typescript/ui/components/QuickActions.d.ts.map +1 -0
- package/lib/typescript/ui/components/Section.d.ts +11 -0
- package/lib/typescript/ui/components/Section.d.ts.map +1 -0
- package/lib/typescript/ui/components/SectionTitle.d.ts +9 -0
- package/lib/typescript/ui/components/SectionTitle.d.ts.map +1 -0
- package/lib/typescript/ui/components/bottomSheet/index.d.ts +3 -2
- package/lib/typescript/ui/components/bottomSheet/index.d.ts.map +1 -1
- package/lib/typescript/ui/components/index.d.ts +13 -0
- package/lib/typescript/ui/components/index.d.ts.map +1 -0
- package/lib/typescript/ui/navigation/OxyRouter.d.ts.map +1 -1
- package/lib/typescript/ui/navigation/types.d.ts +8 -0
- package/lib/typescript/ui/navigation/types.d.ts.map +1 -1
- package/lib/typescript/ui/screens/AccountCenterScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/AccountManagementDemo.d.ts +8 -0
- package/lib/typescript/ui/screens/AccountManagementDemo.d.ts.map +1 -0
- package/lib/typescript/ui/screens/AccountOverviewScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/AccountSettingsScreen.d.ts +1 -4
- package/lib/typescript/ui/screens/AccountSettingsScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/AccountSwitcherScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/AppInfoScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/BillingManagementScreen.d.ts +5 -0
- package/lib/typescript/ui/screens/BillingManagementScreen.d.ts.map +1 -0
- package/lib/typescript/ui/screens/FileManagementScreen.d.ts +8 -0
- package/lib/typescript/ui/screens/FileManagementScreen.d.ts.map +1 -0
- package/lib/typescript/ui/screens/PremiumSubscriptionScreen.d.ts +5 -0
- package/lib/typescript/ui/screens/PremiumSubscriptionScreen.d.ts.map +1 -0
- package/lib/typescript/ui/screens/ProfileScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/SessionManagementScreen.d.ts.map +1 -1
- package/lib/typescript/utils/polyfills.d.ts +6 -0
- package/lib/typescript/utils/polyfills.d.ts.map +1 -0
- package/package.json +11 -3
- package/src/__tests__/polyfills.test.ts +30 -0
- package/src/__tests__/setup.ts +43 -0
- package/src/__tests__/ui/screens/AccountSettingsScreen.test.tsx +8 -8
- package/src/assets/icons/OxyServices.tsx +67 -0
- package/src/assets/icons/logo_OxyServices.svg +1 -0
- package/src/core/index.ts +127 -19
- package/src/index.ts +3 -0
- package/src/lib/sonner.ts +10 -1
- package/src/models/interfaces.ts +1 -2
- package/src/node/index.ts +3 -0
- package/src/ui/components/GroupedItem.tsx +118 -0
- package/src/ui/components/GroupedSection.tsx +45 -0
- package/src/ui/components/OxyProvider.tsx +95 -120
- package/src/ui/components/ProfileCard.tsx +129 -0
- package/src/ui/components/QuickActions.tsx +90 -0
- package/src/ui/components/Section.tsx +37 -0
- package/src/ui/components/SectionTitle.tsx +31 -0
- package/src/ui/components/bottomSheet/index.tsx +13 -11
- package/src/ui/components/index.ts +15 -0
- package/src/ui/navigation/OxyRouter.tsx +20 -3
- package/src/ui/navigation/types.ts +10 -1
- package/src/ui/screens/AccountCenterScreen.tsx +188 -159
- package/src/ui/screens/AccountManagementDemo.tsx +297 -0
- package/src/ui/screens/AccountOverviewScreen.tsx +474 -310
- package/src/ui/screens/AccountSettingsScreen.tsx +648 -463
- package/src/ui/screens/AccountSwitcherScreen.tsx +385 -449
- package/src/ui/screens/AppInfoScreen.tsx +571 -140
- package/src/ui/screens/BillingManagementScreen.tsx +589 -0
- package/src/ui/screens/FileManagementScreen.tsx +2513 -0
- package/src/ui/screens/PremiumSubscriptionScreen.tsx +1628 -0
- package/src/ui/screens/ProfileScreen.tsx +101 -7
- package/src/ui/screens/SessionManagementScreen.tsx +1 -0
- package/src/ui/screens/SignInScreen.tsx +1 -1
- package/src/ui/screens/SignUpScreen.tsx +1 -1
- package/src/utils/polyfills.ts +34 -0
- package/lib/commonjs/lib/sonner.web.js +0 -17
- package/lib/commonjs/lib/sonner.web.js.map +0 -1
- package/lib/module/lib/sonner.web.js +0 -4
- package/lib/module/lib/sonner.web.js.map +0 -1
- package/lib/typescript/__tests__/ui/screens/AccountSettingsScreen.test.d.ts +0 -2
- package/lib/typescript/__tests__/ui/screens/AccountSettingsScreen.test.d.ts.map +0 -1
- package/lib/typescript/lib/sonner.web.d.ts +0 -2
- package/lib/typescript/lib/sonner.web.d.ts.map +0 -1
- package/src/lib/sonner.web.ts +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
|
2
|
-
import { View, Text, StyleSheet, ActivityIndicator, ScrollView } from 'react-native';
|
|
2
|
+
import { View, Text, StyleSheet, ActivityIndicator, ScrollView, TouchableOpacity } from 'react-native';
|
|
3
3
|
import { BaseScreenProps } from '../navigation/types';
|
|
4
4
|
import { useOxy } from '../context/OxyContext';
|
|
5
5
|
import Avatar from '../components/Avatar';
|
|
@@ -11,7 +11,7 @@ interface ProfileScreenProps extends BaseScreenProps {
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
const ProfileScreen: React.FC<ProfileScreenProps> = ({ userId, username, theme, goBack }) => {
|
|
14
|
-
const { oxyServices } = useOxy();
|
|
14
|
+
const { oxyServices, user: currentUser } = useOxy();
|
|
15
15
|
const [profile, setProfile] = useState<any>(null);
|
|
16
16
|
const [karmaTotal, setKarmaTotal] = useState<number | null>(null);
|
|
17
17
|
const [postsCount, setPostsCount] = useState<number | null>(null);
|
|
@@ -27,15 +27,38 @@ const ProfileScreen: React.FC<ProfileScreenProps> = ({ userId, username, theme,
|
|
|
27
27
|
const primaryColor = '#d169e5';
|
|
28
28
|
|
|
29
29
|
useEffect(() => {
|
|
30
|
+
console.log('ProfileScreen - userId:', userId);
|
|
31
|
+
console.log('ProfileScreen - username:', username);
|
|
32
|
+
|
|
33
|
+
if (!userId) {
|
|
34
|
+
setError('No user ID provided');
|
|
35
|
+
setIsLoading(false);
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
|
|
30
39
|
setIsLoading(true);
|
|
31
40
|
setError(null);
|
|
32
41
|
|
|
33
42
|
// Load user profile and karma total
|
|
34
43
|
Promise.all([
|
|
35
|
-
oxyServices.getUserById(userId)
|
|
36
|
-
|
|
44
|
+
oxyServices.getUserById(userId).catch(err => {
|
|
45
|
+
console.error('getUserById error:', err);
|
|
46
|
+
// If this is the current user and the API call fails, use current user data as fallback
|
|
47
|
+
if (currentUser && currentUser.id === userId) {
|
|
48
|
+
console.log('API call failed, using current user as fallback:', currentUser);
|
|
49
|
+
return currentUser;
|
|
50
|
+
}
|
|
51
|
+
throw err;
|
|
52
|
+
}),
|
|
53
|
+
oxyServices.getUserKarmaTotal ?
|
|
54
|
+
oxyServices.getUserKarmaTotal(userId).catch(err => {
|
|
55
|
+
console.warn('getUserKarmaTotal error:', err);
|
|
56
|
+
return { total: undefined };
|
|
57
|
+
}) :
|
|
58
|
+
Promise.resolve({ total: undefined })
|
|
37
59
|
])
|
|
38
60
|
.then(([profileRes, karmaRes]) => {
|
|
61
|
+
console.log('Profile loaded:', profileRes);
|
|
39
62
|
setProfile(profileRes);
|
|
40
63
|
setKarmaTotal(typeof karmaRes.total === 'number' ? karmaRes.total : null);
|
|
41
64
|
|
|
@@ -46,7 +69,27 @@ const ProfileScreen: React.FC<ProfileScreenProps> = ({ userId, username, theme,
|
|
|
46
69
|
setFollowersCount(Math.floor(Math.random() * 200));
|
|
47
70
|
setFollowingCount(Math.floor(Math.random() * 100));
|
|
48
71
|
})
|
|
49
|
-
.catch((err: any) =>
|
|
72
|
+
.catch((err: any) => {
|
|
73
|
+
console.error('Profile loading error:', err);
|
|
74
|
+
// Provide user-friendly error messages based on the error type
|
|
75
|
+
let errorMessage = 'Failed to load profile';
|
|
76
|
+
|
|
77
|
+
if (err.status === 404 || err.message?.includes('not found') || err.message?.includes('Resource not found')) {
|
|
78
|
+
if (currentUser && currentUser.id === userId) {
|
|
79
|
+
errorMessage = 'Unable to load your profile from the server. This may be due to a temporary service issue.';
|
|
80
|
+
} else {
|
|
81
|
+
errorMessage = 'This user profile could not be found or may have been removed.';
|
|
82
|
+
}
|
|
83
|
+
} else if (err.status === 403) {
|
|
84
|
+
errorMessage = 'You do not have permission to view this profile.';
|
|
85
|
+
} else if (err.status === 500) {
|
|
86
|
+
errorMessage = 'Server error occurred while loading the profile. Please try again later.';
|
|
87
|
+
} else if (err.message) {
|
|
88
|
+
errorMessage = err.message;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
setError(errorMessage);
|
|
92
|
+
})
|
|
50
93
|
.finally(() => setIsLoading(false));
|
|
51
94
|
}, [userId]);
|
|
52
95
|
|
|
@@ -60,8 +103,22 @@ const ProfileScreen: React.FC<ProfileScreenProps> = ({ userId, username, theme,
|
|
|
60
103
|
|
|
61
104
|
if (error) {
|
|
62
105
|
return (
|
|
63
|
-
<View style={[styles.container, { backgroundColor
|
|
64
|
-
<
|
|
106
|
+
<View style={[styles.container, { backgroundColor }]}>
|
|
107
|
+
<View style={styles.errorHeader}>
|
|
108
|
+
{goBack && (
|
|
109
|
+
<TouchableOpacity onPress={goBack} style={styles.backButton}>
|
|
110
|
+
<Ionicons name="arrow-back" size={24} color={textColor} />
|
|
111
|
+
</TouchableOpacity>
|
|
112
|
+
)}
|
|
113
|
+
<Text style={[styles.errorTitle, { color: textColor }]}>Profile Error</Text>
|
|
114
|
+
</View>
|
|
115
|
+
<View style={styles.errorContent}>
|
|
116
|
+
<Ionicons name="alert-circle" size={48} color="#D32F2F" style={styles.errorIcon} />
|
|
117
|
+
<Text style={[styles.errorText, { color: '#D32F2F' }]}>{error}</Text>
|
|
118
|
+
<Text style={[styles.errorSubtext, { color: textColor }]}>
|
|
119
|
+
This could happen if the user doesn't exist or the profile service is unavailable.
|
|
120
|
+
</Text>
|
|
121
|
+
</View>
|
|
65
122
|
</View>
|
|
66
123
|
);
|
|
67
124
|
}
|
|
@@ -150,6 +207,43 @@ const styles = StyleSheet.create({
|
|
|
150
207
|
statItem: { flex: 1, alignItems: 'center', minWidth: 50, marginBottom: 12 },
|
|
151
208
|
karmaLabel: { fontSize: 14, marginBottom: 2, textAlign: 'center', color: '#a0a0a0' },
|
|
152
209
|
karmaAmount: { fontSize: 24, fontWeight: 'bold', textAlign: 'center', letterSpacing: 0.2 },
|
|
210
|
+
// Error handling styles
|
|
211
|
+
errorHeader: {
|
|
212
|
+
flexDirection: 'row',
|
|
213
|
+
alignItems: 'center',
|
|
214
|
+
paddingHorizontal: 16,
|
|
215
|
+
paddingVertical: 12,
|
|
216
|
+
borderBottomWidth: 1,
|
|
217
|
+
borderBottomColor: '#E0E0E0',
|
|
218
|
+
},
|
|
219
|
+
backButton: {
|
|
220
|
+
padding: 8,
|
|
221
|
+
marginRight: 16,
|
|
222
|
+
},
|
|
223
|
+
errorTitle: {
|
|
224
|
+
fontSize: 20,
|
|
225
|
+
fontWeight: 'bold',
|
|
226
|
+
},
|
|
227
|
+
errorContent: {
|
|
228
|
+
flex: 1,
|
|
229
|
+
justifyContent: 'center',
|
|
230
|
+
alignItems: 'center',
|
|
231
|
+
paddingHorizontal: 32,
|
|
232
|
+
},
|
|
233
|
+
errorIcon: {
|
|
234
|
+
marginBottom: 16,
|
|
235
|
+
},
|
|
236
|
+
errorText: {
|
|
237
|
+
fontSize: 18,
|
|
238
|
+
fontWeight: '600',
|
|
239
|
+
textAlign: 'center',
|
|
240
|
+
marginBottom: 8,
|
|
241
|
+
},
|
|
242
|
+
errorSubtext: {
|
|
243
|
+
fontSize: 14,
|
|
244
|
+
textAlign: 'center',
|
|
245
|
+
opacity: 0.7,
|
|
246
|
+
},
|
|
153
247
|
});
|
|
154
248
|
|
|
155
249
|
export default ProfileScreen;
|
|
@@ -14,6 +14,7 @@ import { BaseScreenProps } from '../navigation/types';
|
|
|
14
14
|
import { useOxy } from '../context/OxyContext';
|
|
15
15
|
import { fontFamilies } from '../styles/fonts';
|
|
16
16
|
import { toast } from '../../lib/sonner';
|
|
17
|
+
import { Ionicons } from '@expo/vector-icons';
|
|
17
18
|
|
|
18
19
|
interface Session {
|
|
19
20
|
id: string;
|
|
@@ -19,7 +19,7 @@ import { useOxy } from '../context/OxyContext';
|
|
|
19
19
|
import { fontFamilies, useThemeColors, createCommonStyles } from '../styles';
|
|
20
20
|
import OxyLogo from '../components/OxyLogo';
|
|
21
21
|
import Avatar from '../components/Avatar';
|
|
22
|
-
import { BottomSheetScrollView } from '
|
|
22
|
+
import { BottomSheetScrollView } from '../components/bottomSheet';
|
|
23
23
|
import { Ionicons } from '@expo/vector-icons';
|
|
24
24
|
import Svg, { Path, Circle, Defs, LinearGradient, Stop } from 'react-native-svg';
|
|
25
25
|
import { toast } from '../../lib/sonner';
|
|
@@ -17,7 +17,7 @@ import { BaseScreenProps } from '../navigation/types';
|
|
|
17
17
|
import { useOxy } from '../context/OxyContext';
|
|
18
18
|
import { fontFamilies } from '../styles/fonts';
|
|
19
19
|
import OxyLogo from '../components/OxyLogo';
|
|
20
|
-
import { BottomSheetScrollView, BottomSheetView } from '
|
|
20
|
+
import { BottomSheetScrollView, BottomSheetView } from '../components/bottomSheet';
|
|
21
21
|
import { Ionicons } from '@expo/vector-icons'; // Add icon import
|
|
22
22
|
import Svg, { Path, Circle } from 'react-native-svg';
|
|
23
23
|
import { toast } from '../../lib/sonner';
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Polyfills for React Native environments that may be missing certain Web APIs
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
// FormData polyfill for React Native/Hermes environments
|
|
6
|
+
if (typeof FormData === 'undefined') {
|
|
7
|
+
try {
|
|
8
|
+
const FormDataPolyfill = require('form-data');
|
|
9
|
+
// Use globalThis which is more universal than global
|
|
10
|
+
if (typeof globalThis !== 'undefined') {
|
|
11
|
+
(globalThis as any).FormData = FormDataPolyfill;
|
|
12
|
+
}
|
|
13
|
+
} catch (error) {
|
|
14
|
+
console.warn('form-data package not found. File uploads may not work in React Native environments without native FormData support.');
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// Export a helper to ensure FormData is available
|
|
19
|
+
export const ensureFormDataAvailable = (): boolean => {
|
|
20
|
+
return typeof FormData !== 'undefined' || typeof require !== 'undefined';
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
// Get FormData constructor (either native or polyfilled)
|
|
24
|
+
export const getFormDataConstructor = (): any => {
|
|
25
|
+
if (typeof FormData !== 'undefined') {
|
|
26
|
+
return FormData;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
try {
|
|
30
|
+
return require('form-data');
|
|
31
|
+
} catch (error) {
|
|
32
|
+
throw new Error('FormData is not available and form-data package is not installed. Please install form-data for file upload support.');
|
|
33
|
+
}
|
|
34
|
+
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
var _sonner = require("sonner");
|
|
7
|
-
Object.keys(_sonner).forEach(function (key) {
|
|
8
|
-
if (key === "default" || key === "__esModule") return;
|
|
9
|
-
if (key in exports && exports[key] === _sonner[key]) return;
|
|
10
|
-
Object.defineProperty(exports, key, {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
get: function () {
|
|
13
|
-
return _sonner[key];
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
});
|
|
17
|
-
//# sourceMappingURL=sonner.web.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_sonner","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get"],"sourceRoot":"../../../src","sources":["lib/sonner.web.ts"],"mappings":";;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,OAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,OAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,OAAA,CAAAK,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["lib/sonner.web.ts"],"mappings":";;AAAA,cAAc,QAAQ","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AccountSettingsScreen.test.d.ts","sourceRoot":"","sources":["../../../../../src/__tests__/ui/screens/AccountSettingsScreen.test.tsx"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sonner.web.d.ts","sourceRoot":"","sources":["../../../src/lib/sonner.web.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC"}
|
package/src/lib/sonner.web.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from 'sonner';
|