@oxyhq/services 0.1.17 → 5.1.7
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 +17 -138
- package/UI_COMPONENTS.md +142 -0
- package/lib/commonjs/assets/OxyLogo.svg +1 -0
- package/lib/commonjs/assets/assets/OxyLogo.svg +1 -0
- package/lib/commonjs/assets/assets/fonts/Phudu/Phudu-Black.ttf +0 -0
- package/lib/commonjs/assets/assets/fonts/Phudu/Phudu-Bold.ttf +0 -0
- package/lib/commonjs/assets/assets/fonts/Phudu/Phudu-ExtraBold.ttf +0 -0
- package/lib/commonjs/assets/assets/fonts/Phudu/Phudu-Light.ttf +0 -0
- package/lib/commonjs/assets/assets/fonts/Phudu/Phudu-Medium.ttf +0 -0
- package/lib/commonjs/assets/assets/fonts/Phudu/Phudu-Regular.ttf +0 -0
- package/lib/commonjs/assets/assets/fonts/Phudu/Phudu-SemiBold.ttf +0 -0
- package/lib/commonjs/assets/fonts/Phudu/Phudu-Black.ttf +0 -0
- package/lib/commonjs/assets/fonts/Phudu/Phudu-Bold.ttf +0 -0
- package/lib/commonjs/assets/fonts/Phudu/Phudu-ExtraBold.ttf +0 -0
- package/lib/commonjs/assets/fonts/Phudu/Phudu-Light.ttf +0 -0
- package/lib/commonjs/assets/fonts/Phudu/Phudu-Medium.ttf +0 -0
- package/lib/commonjs/assets/fonts/Phudu/Phudu-Regular.ttf +0 -0
- package/lib/commonjs/assets/fonts/Phudu/Phudu-SemiBold.ttf +0 -0
- package/lib/commonjs/core/index.js +783 -0
- package/lib/commonjs/core/index.js.map +1 -0
- package/lib/commonjs/index.js +128 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/models/interfaces.js +2 -0
- package/lib/commonjs/models/interfaces.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/ui/components/FontLoader.js +181 -0
- package/lib/commonjs/ui/components/FontLoader.js.map +1 -0
- package/lib/commonjs/ui/components/OxyLogo.js +56 -0
- package/lib/commonjs/ui/components/OxyLogo.js.map +1 -0
- package/lib/commonjs/ui/components/OxyProvider.js +464 -0
- package/lib/commonjs/ui/components/OxyProvider.js.map +1 -0
- package/lib/commonjs/ui/components/OxySignInButton.js +178 -0
- package/lib/commonjs/ui/components/OxySignInButton.js.map +1 -0
- package/lib/commonjs/ui/components/bottomSheet/index.js +37 -0
- package/lib/commonjs/ui/components/bottomSheet/index.js.map +1 -0
- package/lib/commonjs/ui/context/OxyContext.js +296 -0
- package/lib/commonjs/ui/context/OxyContext.js.map +1 -0
- package/lib/commonjs/ui/index.js +136 -0
- package/lib/commonjs/ui/index.js.map +1 -0
- package/lib/commonjs/ui/navigation/OxyRouter.js +140 -0
- package/lib/commonjs/ui/navigation/OxyRouter.js.map +1 -0
- package/lib/commonjs/ui/navigation/types.js +6 -0
- package/lib/commonjs/ui/navigation/types.js.map +1 -0
- package/lib/commonjs/ui/screens/AccountCenterScreen.js +280 -0
- package/lib/commonjs/ui/screens/AccountCenterScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/AccountOverviewScreen.js +578 -0
- package/lib/commonjs/ui/screens/AccountOverviewScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/SignInScreen.js +230 -0
- package/lib/commonjs/ui/screens/SignInScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/SignUpScreen.js +673 -0
- package/lib/commonjs/ui/screens/SignUpScreen.js.map +1 -0
- package/lib/commonjs/ui/styles/FONTS.md +126 -0
- package/lib/commonjs/ui/styles/fonts.js +84 -0
- package/lib/commonjs/ui/styles/fonts.js.map +1 -0
- package/lib/commonjs/ui/styles/index.js +28 -0
- package/lib/commonjs/ui/styles/index.js.map +1 -0
- package/lib/commonjs/ui/styles/theme.js +122 -0
- package/lib/commonjs/ui/styles/theme.js.map +1 -0
- package/lib/module/assets/OxyLogo.svg +1 -0
- package/lib/module/assets/assets/OxyLogo.svg +1 -0
- package/lib/module/assets/assets/fonts/Phudu/Phudu-Black.ttf +0 -0
- package/lib/module/assets/assets/fonts/Phudu/Phudu-Bold.ttf +0 -0
- package/lib/module/assets/assets/fonts/Phudu/Phudu-ExtraBold.ttf +0 -0
- package/lib/module/assets/assets/fonts/Phudu/Phudu-Light.ttf +0 -0
- package/lib/module/assets/assets/fonts/Phudu/Phudu-Medium.ttf +0 -0
- package/lib/module/assets/assets/fonts/Phudu/Phudu-Regular.ttf +0 -0
- package/lib/module/assets/assets/fonts/Phudu/Phudu-SemiBold.ttf +0 -0
- package/lib/module/assets/fonts/Phudu/Phudu-Black.ttf +0 -0
- package/lib/module/assets/fonts/Phudu/Phudu-Bold.ttf +0 -0
- package/lib/module/assets/fonts/Phudu/Phudu-ExtraBold.ttf +0 -0
- package/lib/module/assets/fonts/Phudu/Phudu-Light.ttf +0 -0
- package/lib/module/assets/fonts/Phudu/Phudu-Medium.ttf +0 -0
- package/lib/module/assets/fonts/Phudu/Phudu-Regular.ttf +0 -0
- package/lib/module/assets/fonts/Phudu/Phudu-SemiBold.ttf +0 -0
- package/lib/module/core/index.js +777 -0
- package/lib/module/core/index.js.map +1 -0
- package/lib/module/index.js +29 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/models/interfaces.js +2 -0
- package/lib/module/models/interfaces.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/ui/components/FontLoader.js +176 -0
- package/lib/module/ui/components/FontLoader.js.map +1 -0
- package/lib/module/ui/components/OxyLogo.js +49 -0
- package/lib/module/ui/components/OxyLogo.js.map +1 -0
- package/lib/module/ui/components/OxyProvider.js +458 -0
- package/lib/module/ui/components/OxyProvider.js.map +1 -0
- package/lib/module/ui/components/OxySignInButton.js +172 -0
- package/lib/module/ui/components/OxySignInButton.js.map +1 -0
- package/lib/module/ui/components/bottomSheet/index.js +8 -0
- package/lib/module/ui/components/bottomSheet/index.js.map +1 -0
- package/lib/module/ui/context/OxyContext.js +291 -0
- package/lib/module/ui/context/OxyContext.js.map +1 -0
- package/lib/module/ui/index.js +25 -0
- package/lib/module/ui/index.js.map +1 -0
- package/lib/module/ui/navigation/OxyRouter.js +133 -0
- package/lib/module/ui/navigation/OxyRouter.js.map +1 -0
- package/lib/module/ui/navigation/types.js +4 -0
- package/lib/module/ui/navigation/types.js.map +1 -0
- package/lib/module/ui/screens/AccountCenterScreen.js +275 -0
- package/lib/module/ui/screens/AccountCenterScreen.js.map +1 -0
- package/lib/module/ui/screens/AccountOverviewScreen.js +573 -0
- package/lib/module/ui/screens/AccountOverviewScreen.js.map +1 -0
- package/lib/module/ui/screens/SignInScreen.js +224 -0
- package/lib/module/ui/screens/SignInScreen.js.map +1 -0
- package/lib/module/ui/screens/SignUpScreen.js +668 -0
- package/lib/module/ui/screens/SignUpScreen.js.map +1 -0
- package/lib/module/ui/styles/FONTS.md +126 -0
- package/lib/module/ui/styles/fonts.js +81 -0
- package/lib/module/ui/styles/fonts.js.map +1 -0
- package/lib/module/ui/styles/index.js +5 -0
- package/lib/module/ui/styles/index.js.map +1 -0
- package/lib/module/ui/styles/theme.js +115 -0
- package/lib/module/ui/styles/theme.js.map +1 -0
- package/lib/typescript/core/index.d.ts +304 -0
- package/lib/typescript/core/index.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +11 -0
- package/lib/typescript/index.d.ts.map +1 -0
- package/lib/typescript/models/interfaces.d.ts +98 -0
- package/lib/typescript/models/interfaces.d.ts.map +1 -0
- package/lib/typescript/ui/components/FontLoader.d.ts +15 -0
- package/lib/typescript/ui/components/FontLoader.d.ts.map +1 -0
- package/lib/typescript/ui/components/OxyLogo.d.ts +29 -0
- package/lib/typescript/ui/components/OxyLogo.d.ts.map +1 -0
- package/lib/typescript/ui/components/OxyProvider.d.ts +12 -0
- package/lib/typescript/ui/components/OxyProvider.d.ts.map +1 -0
- package/lib/typescript/ui/components/OxySignInButton.d.ts +65 -0
- package/lib/typescript/ui/components/OxySignInButton.d.ts.map +1 -0
- package/lib/typescript/ui/components/bottomSheet/index.d.ts +3 -0
- package/lib/typescript/ui/components/bottomSheet/index.d.ts.map +1 -0
- package/lib/typescript/ui/context/OxyContext.d.ts +26 -0
- package/lib/typescript/ui/context/OxyContext.d.ts.map +1 -0
- package/lib/typescript/ui/index.d.ts +15 -0
- package/lib/typescript/ui/index.d.ts.map +1 -0
- package/lib/typescript/ui/navigation/OxyRouter.d.ts +5 -0
- package/lib/typescript/ui/navigation/OxyRouter.d.ts.map +1 -0
- package/lib/typescript/ui/navigation/types.d.ts +107 -0
- package/lib/typescript/ui/navigation/types.d.ts.map +1 -0
- package/lib/typescript/ui/screens/AccountCenterScreen.d.ts +5 -0
- package/lib/typescript/ui/screens/AccountCenterScreen.d.ts.map +1 -0
- package/lib/typescript/ui/screens/AccountOverviewScreen.d.ts +5 -0
- package/lib/typescript/ui/screens/AccountOverviewScreen.d.ts.map +1 -0
- package/lib/typescript/ui/screens/SignInScreen.d.ts +5 -0
- package/lib/typescript/ui/screens/SignInScreen.d.ts.map +1 -0
- package/lib/typescript/ui/screens/SignUpScreen.d.ts +5 -0
- package/lib/typescript/ui/screens/SignUpScreen.d.ts.map +1 -0
- package/lib/typescript/ui/styles/fonts.d.ts +21 -0
- package/lib/typescript/ui/styles/fonts.d.ts.map +1 -0
- package/lib/typescript/ui/styles/index.d.ts +3 -0
- package/lib/typescript/ui/styles/index.d.ts.map +1 -0
- package/lib/typescript/ui/styles/theme.d.ts +69 -0
- package/lib/typescript/ui/styles/theme.d.ts.map +1 -0
- package/package.json +95 -51
- package/src/assets/OxyLogo.svg +1 -0
- package/src/assets/fonts/Phudu/Phudu-Black.ttf +0 -0
- package/src/assets/fonts/Phudu/Phudu-Bold.ttf +0 -0
- package/src/assets/fonts/Phudu/Phudu-ExtraBold.ttf +0 -0
- package/src/assets/fonts/Phudu/Phudu-Light.ttf +0 -0
- package/src/assets/fonts/Phudu/Phudu-Medium.ttf +0 -0
- package/src/assets/fonts/Phudu/Phudu-Regular.ttf +0 -0
- package/src/assets/fonts/Phudu/Phudu-SemiBold.ttf +0 -0
- package/src/core/index.ts +768 -0
- package/src/index.ts +46 -0
- package/src/models/interfaces.ts +128 -0
- package/src/ui/components/FontLoader.tsx +180 -0
- package/src/ui/components/OxyLogo.tsx +73 -0
- package/src/ui/components/OxyProvider.tsx +490 -0
- package/src/ui/components/OxySignInButton.tsx +207 -0
- package/src/ui/components/bottomSheet/index.tsx +12 -0
- package/src/ui/context/OxyContext.tsx +344 -0
- package/src/ui/index.ts +27 -0
- package/src/ui/navigation/OxyRouter.tsx +137 -0
- package/src/ui/navigation/types.ts +124 -0
- package/src/ui/screens/AccountCenterScreen.tsx +240 -0
- package/src/ui/screens/AccountOverviewScreen.tsx +519 -0
- package/src/ui/screens/SignInScreen.tsx +210 -0
- package/src/ui/screens/SignUpScreen.tsx +607 -0
- package/src/ui/styles/FONTS.md +126 -0
- package/src/ui/styles/fonts.ts +77 -0
- package/src/ui/styles/index.ts +2 -0
- package/src/ui/styles/theme.ts +142 -0
- package/dist/index.d.ts +0 -152
- package/dist/index.js +0 -1
|
@@ -0,0 +1,519 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
View,
|
|
4
|
+
Text,
|
|
5
|
+
TouchableOpacity,
|
|
6
|
+
StyleSheet,
|
|
7
|
+
ActivityIndicator,
|
|
8
|
+
ScrollView,
|
|
9
|
+
Alert,
|
|
10
|
+
Platform,
|
|
11
|
+
Image,
|
|
12
|
+
TextStyle,
|
|
13
|
+
} from 'react-native';
|
|
14
|
+
import { BaseScreenProps } from '../navigation/types';
|
|
15
|
+
import { useOxy } from '../context/OxyContext';
|
|
16
|
+
import OxyLogo from '../components/OxyLogo';
|
|
17
|
+
import { fontFamilies } from '../styles/fonts';
|
|
18
|
+
|
|
19
|
+
const AccountOverviewScreen: React.FC<BaseScreenProps> = ({
|
|
20
|
+
onClose,
|
|
21
|
+
theme,
|
|
22
|
+
}) => {
|
|
23
|
+
const { user, logout, isLoading } = useOxy();
|
|
24
|
+
const [showMoreAccounts, setShowMoreAccounts] = useState(false);
|
|
25
|
+
|
|
26
|
+
const isDarkTheme = theme === 'dark';
|
|
27
|
+
const textColor = isDarkTheme ? '#FFFFFF' : '#000000';
|
|
28
|
+
const backgroundColor = isDarkTheme ? '#121212' : '#FFFFFF';
|
|
29
|
+
const secondaryBackgroundColor = isDarkTheme ? '#222222' : '#F5F5F5';
|
|
30
|
+
const borderColor = isDarkTheme ? '#444444' : '#E0E0E0';
|
|
31
|
+
const primaryColor = '#d169e5';
|
|
32
|
+
const dangerColor = '#D32F2F';
|
|
33
|
+
const iconColor = isDarkTheme ? '#BBBBBB' : '#666666';
|
|
34
|
+
|
|
35
|
+
// Mock additional accounts (for demo purposes)
|
|
36
|
+
const additionalAccounts = [
|
|
37
|
+
{
|
|
38
|
+
id: '2',
|
|
39
|
+
username: 'Albert Isern Alvarez',
|
|
40
|
+
email: 'albert.isern.alvarez@gmail.com',
|
|
41
|
+
avatarUrl: 'https://example.com/avatar2.jpg',
|
|
42
|
+
}
|
|
43
|
+
];
|
|
44
|
+
|
|
45
|
+
// Feature settings (with mock values)
|
|
46
|
+
const features = {
|
|
47
|
+
safeSearch: false,
|
|
48
|
+
language: 'English',
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
const handleLogout = async () => {
|
|
52
|
+
try {
|
|
53
|
+
await logout();
|
|
54
|
+
if (onClose) {
|
|
55
|
+
onClose();
|
|
56
|
+
}
|
|
57
|
+
} catch (error) {
|
|
58
|
+
console.error('Logout failed:', error);
|
|
59
|
+
Alert.alert('Logout Failed', 'There was a problem signing you out. Please try again.');
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
const confirmLogout = () => {
|
|
64
|
+
Alert.alert(
|
|
65
|
+
'Sign Out',
|
|
66
|
+
'Are you sure you want to sign out?',
|
|
67
|
+
[
|
|
68
|
+
{
|
|
69
|
+
text: 'Cancel',
|
|
70
|
+
style: 'cancel',
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
text: 'Sign Out',
|
|
74
|
+
onPress: handleLogout,
|
|
75
|
+
style: 'destructive',
|
|
76
|
+
},
|
|
77
|
+
],
|
|
78
|
+
{ cancelable: true }
|
|
79
|
+
);
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
const handleAddAccount = () => {
|
|
83
|
+
Alert.alert('Add Account', 'Add another account feature coming soon!');
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
const handleSignOutAll = () => {
|
|
87
|
+
Alert.alert(
|
|
88
|
+
'Sign Out of All Accounts',
|
|
89
|
+
'Are you sure you want to sign out of all accounts?',
|
|
90
|
+
[
|
|
91
|
+
{
|
|
92
|
+
text: 'Cancel',
|
|
93
|
+
style: 'cancel',
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
text: 'Sign Out All',
|
|
97
|
+
onPress: handleLogout,
|
|
98
|
+
style: 'destructive',
|
|
99
|
+
},
|
|
100
|
+
],
|
|
101
|
+
{ cancelable: true }
|
|
102
|
+
);
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
const renderFeatureItem = (
|
|
106
|
+
icon: React.ReactNode,
|
|
107
|
+
title: string,
|
|
108
|
+
value: string | null | undefined,
|
|
109
|
+
onPress: () => void
|
|
110
|
+
) => (
|
|
111
|
+
<TouchableOpacity
|
|
112
|
+
style={[styles.featureItem, { borderColor }]}
|
|
113
|
+
onPress={onPress}
|
|
114
|
+
>
|
|
115
|
+
<View style={styles.featureItemLeft}>
|
|
116
|
+
<View style={styles.iconContainer}>
|
|
117
|
+
{icon}
|
|
118
|
+
</View>
|
|
119
|
+
<Text style={[styles.featureItemTitle, { color: textColor }]}>{title}</Text>
|
|
120
|
+
</View>
|
|
121
|
+
{value !== undefined && (
|
|
122
|
+
<Text style={[styles.featureItemValue, { color: iconColor }]}>{value}</Text>
|
|
123
|
+
)}
|
|
124
|
+
</TouchableOpacity>
|
|
125
|
+
);
|
|
126
|
+
|
|
127
|
+
if (!user) {
|
|
128
|
+
return (
|
|
129
|
+
<View style={[styles.container, { backgroundColor }]}>
|
|
130
|
+
<Text style={[styles.message, { color: textColor }]}>Not signed in</Text>
|
|
131
|
+
</View>
|
|
132
|
+
);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
if (isLoading) {
|
|
136
|
+
return (
|
|
137
|
+
<View style={[styles.container, { backgroundColor, justifyContent: 'center' }]}>
|
|
138
|
+
<ActivityIndicator size="large" color={primaryColor} />
|
|
139
|
+
</View>
|
|
140
|
+
);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
// Default avatar if no avatarUrl provided
|
|
144
|
+
const avatarSource = user.avatarUrl
|
|
145
|
+
? { uri: user.avatarUrl }
|
|
146
|
+
: null; // We'll handle this with a text avatar instead
|
|
147
|
+
|
|
148
|
+
return (
|
|
149
|
+
<View style={[styles.container, { backgroundColor }]}>
|
|
150
|
+
<ScrollView style={styles.scrollView} contentContainerStyle={styles.scrollContainer}>
|
|
151
|
+
<View style={styles.header}>
|
|
152
|
+
<Text style={[styles.accountEmail, { color: textColor }]}>
|
|
153
|
+
{user.email || user.username}
|
|
154
|
+
</Text>
|
|
155
|
+
<TouchableOpacity style={styles.closeIcon} onPress={onClose}>
|
|
156
|
+
<Text style={{ fontSize: 24, color: textColor }}>×</Text>
|
|
157
|
+
</TouchableOpacity>
|
|
158
|
+
</View>
|
|
159
|
+
|
|
160
|
+
<View style={[styles.profileContainer, { backgroundColor: secondaryBackgroundColor }]}>
|
|
161
|
+
<View style={styles.avatarContainer}>
|
|
162
|
+
{user.avatarUrl ? (
|
|
163
|
+
<Image source={{ uri: user.avatarUrl }} style={styles.avatar} />
|
|
164
|
+
) : (
|
|
165
|
+
<View style={[styles.avatar, { backgroundColor: primaryColor }]}>
|
|
166
|
+
<Text style={styles.avatarText}>
|
|
167
|
+
{user.username.charAt(0).toUpperCase()}
|
|
168
|
+
</Text>
|
|
169
|
+
</View>
|
|
170
|
+
)}
|
|
171
|
+
</View>
|
|
172
|
+
<Text style={[styles.greeting, { color: textColor }]}>Hi, {user.username.split(' ')[0]}!</Text>
|
|
173
|
+
|
|
174
|
+
<TouchableOpacity
|
|
175
|
+
style={[styles.manageAccountButton, { borderColor }]}
|
|
176
|
+
onPress={() => Alert.alert('Account', 'Manage your Oxy Account feature coming soon!')}
|
|
177
|
+
>
|
|
178
|
+
<Text style={[styles.manageAccountText, { color: textColor }]}>
|
|
179
|
+
Manage your Oxy Account
|
|
180
|
+
</Text>
|
|
181
|
+
</TouchableOpacity>
|
|
182
|
+
</View>
|
|
183
|
+
|
|
184
|
+
{/* Multiple accounts section */}
|
|
185
|
+
<TouchableOpacity
|
|
186
|
+
style={[styles.sectionHeader, { borderColor }]}
|
|
187
|
+
onPress={() => setShowMoreAccounts(!showMoreAccounts)}
|
|
188
|
+
>
|
|
189
|
+
<Text style={[styles.sectionHeaderText, { color: textColor }]}>
|
|
190
|
+
{showMoreAccounts ? "Hide more accounts" : "Show more accounts"}
|
|
191
|
+
</Text>
|
|
192
|
+
<Text style={{ color: textColor, fontSize: 16 }}>
|
|
193
|
+
{showMoreAccounts ? "▲" : "▼"}
|
|
194
|
+
</Text>
|
|
195
|
+
</TouchableOpacity>
|
|
196
|
+
|
|
197
|
+
{showMoreAccounts && (
|
|
198
|
+
<View style={[styles.accountsContainer, { backgroundColor: secondaryBackgroundColor }]}>
|
|
199
|
+
{additionalAccounts.map((account) => (
|
|
200
|
+
<TouchableOpacity
|
|
201
|
+
key={account.id}
|
|
202
|
+
style={[styles.accountItem, { borderColor }]}
|
|
203
|
+
onPress={() => Alert.alert('Switch Account', `Switch to ${account.username}?`)}
|
|
204
|
+
>
|
|
205
|
+
<View style={styles.accountItemLeft}>
|
|
206
|
+
{account.avatarUrl ? (
|
|
207
|
+
<Image source={{ uri: account.avatarUrl }} style={styles.accountAvatar} />
|
|
208
|
+
) : (
|
|
209
|
+
<View style={[styles.accountAvatar, { backgroundColor: primaryColor }]}>
|
|
210
|
+
<Text style={styles.avatarText}>
|
|
211
|
+
{account.username.charAt(0).toUpperCase()}
|
|
212
|
+
</Text>
|
|
213
|
+
</View>
|
|
214
|
+
)}
|
|
215
|
+
<View>
|
|
216
|
+
<Text style={[styles.accountName, { color: textColor }]}>
|
|
217
|
+
{account.username}
|
|
218
|
+
</Text>
|
|
219
|
+
<Text style={[styles.accountEmail, { color: iconColor }]}>
|
|
220
|
+
{account.email}
|
|
221
|
+
</Text>
|
|
222
|
+
</View>
|
|
223
|
+
</View>
|
|
224
|
+
</TouchableOpacity>
|
|
225
|
+
))}
|
|
226
|
+
|
|
227
|
+
<TouchableOpacity
|
|
228
|
+
style={[styles.accountItem, { borderColor }]}
|
|
229
|
+
onPress={handleAddAccount}
|
|
230
|
+
>
|
|
231
|
+
<View style={styles.accountItemLeft}>
|
|
232
|
+
<View style={[styles.accountAvatar, styles.addAccountIcon, { borderColor }]}>
|
|
233
|
+
<Text style={{ fontSize: 20, color: textColor }}>+</Text>
|
|
234
|
+
</View>
|
|
235
|
+
<Text style={[styles.accountItemAction, { color: textColor }]}>
|
|
236
|
+
Add another account
|
|
237
|
+
</Text>
|
|
238
|
+
</View>
|
|
239
|
+
</TouchableOpacity>
|
|
240
|
+
|
|
241
|
+
<TouchableOpacity
|
|
242
|
+
style={[styles.accountItem, { borderColor }]}
|
|
243
|
+
onPress={handleSignOutAll}
|
|
244
|
+
>
|
|
245
|
+
<View style={styles.accountItemLeft}>
|
|
246
|
+
<View style={[styles.accountAvatar, styles.signOutIcon, { borderColor }]}>
|
|
247
|
+
<Text style={{ fontSize: 20, color: textColor }}>←</Text>
|
|
248
|
+
</View>
|
|
249
|
+
<Text style={[styles.accountItemAction, { color: textColor }]}>
|
|
250
|
+
Sign out of all accounts
|
|
251
|
+
</Text>
|
|
252
|
+
</View>
|
|
253
|
+
</TouchableOpacity>
|
|
254
|
+
</View>
|
|
255
|
+
)}
|
|
256
|
+
|
|
257
|
+
<View style={styles.sectionHeader}>
|
|
258
|
+
<Text style={[styles.sectionHeaderText, { color: textColor }]}>
|
|
259
|
+
More from Oxy
|
|
260
|
+
</Text>
|
|
261
|
+
</View>
|
|
262
|
+
|
|
263
|
+
<View style={[styles.featuresContainer, { backgroundColor: secondaryBackgroundColor }]}>
|
|
264
|
+
{renderFeatureItem(
|
|
265
|
+
<Text style={{ fontSize: 18 }}>🕒</Text>,
|
|
266
|
+
'History',
|
|
267
|
+
'Saving',
|
|
268
|
+
() => Alert.alert('History', 'View your history feature coming soon!')
|
|
269
|
+
)}
|
|
270
|
+
|
|
271
|
+
{renderFeatureItem(
|
|
272
|
+
<Text style={{ fontSize: 18 }}>⏱️</Text>,
|
|
273
|
+
'Delete last 15 minutes',
|
|
274
|
+
null,
|
|
275
|
+
() => Alert.alert('Delete History', 'Delete recent history feature coming soon!')
|
|
276
|
+
)}
|
|
277
|
+
|
|
278
|
+
{renderFeatureItem(
|
|
279
|
+
<Text style={{ fontSize: 18 }}>📋</Text>,
|
|
280
|
+
'Saves & Collections',
|
|
281
|
+
null,
|
|
282
|
+
() => Alert.alert('Saves', 'Saved items feature coming soon!')
|
|
283
|
+
)}
|
|
284
|
+
|
|
285
|
+
{renderFeatureItem(
|
|
286
|
+
<Text style={{ fontSize: 18 }}>🔍</Text>,
|
|
287
|
+
'Search personalization',
|
|
288
|
+
null,
|
|
289
|
+
() => Alert.alert('Personalization', 'Search personalization feature coming soon!')
|
|
290
|
+
)}
|
|
291
|
+
|
|
292
|
+
{renderFeatureItem(
|
|
293
|
+
<Text style={{ fontSize: 18 }}>🛡️</Text>,
|
|
294
|
+
'SafeSearch',
|
|
295
|
+
features.safeSearch ? 'On' : 'Off',
|
|
296
|
+
() => Alert.alert('SafeSearch', 'SafeSearch settings feature coming soon!')
|
|
297
|
+
)}
|
|
298
|
+
|
|
299
|
+
{renderFeatureItem(
|
|
300
|
+
<Text style={{ fontSize: 18 }}>🌐</Text>,
|
|
301
|
+
'Language',
|
|
302
|
+
features.language,
|
|
303
|
+
() => Alert.alert('Language', 'Language settings feature coming soon!')
|
|
304
|
+
)}
|
|
305
|
+
</View>
|
|
306
|
+
|
|
307
|
+
<View style={styles.footerContainer}>
|
|
308
|
+
<View style={styles.footerButtonsRow}>
|
|
309
|
+
<TouchableOpacity
|
|
310
|
+
style={styles.footerButton}
|
|
311
|
+
onPress={() => Alert.alert('Settings', 'More settings feature coming soon!')}
|
|
312
|
+
>
|
|
313
|
+
<Text style={[styles.footerButtonText, { color: textColor }]}>
|
|
314
|
+
More settings
|
|
315
|
+
</Text>
|
|
316
|
+
</TouchableOpacity>
|
|
317
|
+
|
|
318
|
+
<TouchableOpacity
|
|
319
|
+
style={styles.footerButton}
|
|
320
|
+
onPress={() => Alert.alert('Help', 'Help & support feature coming soon!')}
|
|
321
|
+
>
|
|
322
|
+
<Text style={[styles.footerButtonText, { color: textColor }]}>
|
|
323
|
+
Help
|
|
324
|
+
</Text>
|
|
325
|
+
</TouchableOpacity>
|
|
326
|
+
</View>
|
|
327
|
+
|
|
328
|
+
<View style={styles.footerLinksRow}>
|
|
329
|
+
<TouchableOpacity onPress={() => Alert.alert('Privacy', 'Privacy Policy feature coming soon!')}>
|
|
330
|
+
<Text style={[styles.footerLink, { color: iconColor }]}>Privacy Policy</Text>
|
|
331
|
+
</TouchableOpacity>
|
|
332
|
+
<Text style={[{ color: iconColor, marginHorizontal: 5 }]}>•</Text>
|
|
333
|
+
<TouchableOpacity onPress={() => Alert.alert('Terms', 'Terms of Service feature coming soon!')}>
|
|
334
|
+
<Text style={[styles.footerLink, { color: iconColor }]}>Terms of Service</Text>
|
|
335
|
+
</TouchableOpacity>
|
|
336
|
+
</View>
|
|
337
|
+
</View>
|
|
338
|
+
</ScrollView>
|
|
339
|
+
</View>
|
|
340
|
+
);
|
|
341
|
+
};
|
|
342
|
+
|
|
343
|
+
const styles = StyleSheet.create({
|
|
344
|
+
container: {
|
|
345
|
+
flex: 1,
|
|
346
|
+
},
|
|
347
|
+
scrollView: {
|
|
348
|
+
flex: 1,
|
|
349
|
+
},
|
|
350
|
+
scrollContainer: {
|
|
351
|
+
padding: 20,
|
|
352
|
+
},
|
|
353
|
+
header: {
|
|
354
|
+
flexDirection: 'row',
|
|
355
|
+
justifyContent: 'space-between',
|
|
356
|
+
alignItems: 'center',
|
|
357
|
+
marginBottom: 20,
|
|
358
|
+
},
|
|
359
|
+
closeIcon: {
|
|
360
|
+
padding: 8,
|
|
361
|
+
},
|
|
362
|
+
profileContainer: {
|
|
363
|
+
padding: 20,
|
|
364
|
+
borderRadius: 15,
|
|
365
|
+
alignItems: 'center',
|
|
366
|
+
marginBottom: 20,
|
|
367
|
+
},
|
|
368
|
+
avatarContainer: {
|
|
369
|
+
margin: 10,
|
|
370
|
+
},
|
|
371
|
+
avatar: {
|
|
372
|
+
width: 70,
|
|
373
|
+
height: 70,
|
|
374
|
+
borderRadius: 35,
|
|
375
|
+
justifyContent: 'center',
|
|
376
|
+
alignItems: 'center',
|
|
377
|
+
},
|
|
378
|
+
avatarText: {
|
|
379
|
+
color: 'white',
|
|
380
|
+
fontSize: 30,
|
|
381
|
+
fontWeight: 'bold',
|
|
382
|
+
},
|
|
383
|
+
greeting: {
|
|
384
|
+
fontFamily: Platform.OS === 'web'
|
|
385
|
+
? 'Phudu' // Use CSS font name directly for web
|
|
386
|
+
: 'Phudu-Bold', // Use exact font name as registered with Font.loadAsync
|
|
387
|
+
fontWeight: Platform.OS === 'web' ? 'bold' : undefined, // Only apply fontWeight on web
|
|
388
|
+
fontSize: 20,
|
|
389
|
+
marginVertical: 10,
|
|
390
|
+
},
|
|
391
|
+
manageAccountButton: {
|
|
392
|
+
paddingVertical: 10,
|
|
393
|
+
paddingHorizontal: 20,
|
|
394
|
+
borderWidth: 1,
|
|
395
|
+
borderRadius: 20,
|
|
396
|
+
marginTop: 10,
|
|
397
|
+
},
|
|
398
|
+
manageAccountText: {
|
|
399
|
+
fontSize: 14,
|
|
400
|
+
},
|
|
401
|
+
sectionHeader: {
|
|
402
|
+
flexDirection: 'row',
|
|
403
|
+
justifyContent: 'space-between',
|
|
404
|
+
alignItems: 'center',
|
|
405
|
+
paddingVertical: 15,
|
|
406
|
+
borderBottomWidth: 1,
|
|
407
|
+
marginBottom: 10,
|
|
408
|
+
},
|
|
409
|
+
sectionHeaderText: {
|
|
410
|
+
fontFamily: Platform.OS === 'web'
|
|
411
|
+
? 'Phudu' // Use CSS font name directly for web
|
|
412
|
+
: 'Phudu-Bold', // Use exact font name as registered with Font.loadAsync
|
|
413
|
+
fontWeight: Platform.OS === 'web' ? 'bold' : undefined, // Only apply fontWeight on web
|
|
414
|
+
fontSize: 16,
|
|
415
|
+
},
|
|
416
|
+
accountsContainer: {
|
|
417
|
+
borderRadius: 15,
|
|
418
|
+
marginBottom: 20,
|
|
419
|
+
overflow: 'hidden',
|
|
420
|
+
},
|
|
421
|
+
accountItem: {
|
|
422
|
+
flexDirection: 'row',
|
|
423
|
+
justifyContent: 'space-between',
|
|
424
|
+
alignItems: 'center',
|
|
425
|
+
padding: 15,
|
|
426
|
+
borderBottomWidth: 1,
|
|
427
|
+
},
|
|
428
|
+
accountItemLeft: {
|
|
429
|
+
flexDirection: 'row',
|
|
430
|
+
alignItems: 'center',
|
|
431
|
+
},
|
|
432
|
+
accountAvatar: {
|
|
433
|
+
width: 36,
|
|
434
|
+
height: 36,
|
|
435
|
+
borderRadius: 18,
|
|
436
|
+
marginRight: 15,
|
|
437
|
+
justifyContent: 'center',
|
|
438
|
+
alignItems: 'center',
|
|
439
|
+
},
|
|
440
|
+
accountName: {
|
|
441
|
+
fontSize: 15,
|
|
442
|
+
fontWeight: '500',
|
|
443
|
+
},
|
|
444
|
+
accountEmail: {
|
|
445
|
+
fontSize: 14,
|
|
446
|
+
},
|
|
447
|
+
accountItemAction: {
|
|
448
|
+
fontSize: 15,
|
|
449
|
+
},
|
|
450
|
+
addAccountIcon: {
|
|
451
|
+
backgroundColor: 'transparent',
|
|
452
|
+
borderWidth: 1,
|
|
453
|
+
},
|
|
454
|
+
signOutIcon: {
|
|
455
|
+
backgroundColor: 'transparent',
|
|
456
|
+
borderWidth: 1,
|
|
457
|
+
},
|
|
458
|
+
featuresContainer: {
|
|
459
|
+
borderRadius: 15,
|
|
460
|
+
overflow: 'hidden',
|
|
461
|
+
marginBottom: 20,
|
|
462
|
+
},
|
|
463
|
+
featureItem: {
|
|
464
|
+
flexDirection: 'row',
|
|
465
|
+
justifyContent: 'space-between',
|
|
466
|
+
alignItems: 'center',
|
|
467
|
+
padding: 15,
|
|
468
|
+
borderBottomWidth: 1,
|
|
469
|
+
},
|
|
470
|
+
featureItemLeft: {
|
|
471
|
+
flexDirection: 'row',
|
|
472
|
+
alignItems: 'center',
|
|
473
|
+
},
|
|
474
|
+
iconContainer: {
|
|
475
|
+
width: 36,
|
|
476
|
+
height: 36,
|
|
477
|
+
justifyContent: 'center',
|
|
478
|
+
alignItems: 'center',
|
|
479
|
+
marginRight: 15,
|
|
480
|
+
},
|
|
481
|
+
featureItemTitle: {
|
|
482
|
+
fontSize: 15,
|
|
483
|
+
fontWeight: '500',
|
|
484
|
+
},
|
|
485
|
+
featureItemValue: {
|
|
486
|
+
fontSize: 14,
|
|
487
|
+
},
|
|
488
|
+
footerContainer: {
|
|
489
|
+
marginBottom: 30,
|
|
490
|
+
},
|
|
491
|
+
footerButtonsRow: {
|
|
492
|
+
flexDirection: 'row',
|
|
493
|
+
justifyContent: 'space-between',
|
|
494
|
+
marginBottom: 20,
|
|
495
|
+
},
|
|
496
|
+
footerButton: {
|
|
497
|
+
flex: 1,
|
|
498
|
+
padding: 15,
|
|
499
|
+
alignItems: 'center',
|
|
500
|
+
},
|
|
501
|
+
footerButtonText: {
|
|
502
|
+
fontSize: 15,
|
|
503
|
+
},
|
|
504
|
+
footerLinksRow: {
|
|
505
|
+
flexDirection: 'row',
|
|
506
|
+
justifyContent: 'center',
|
|
507
|
+
alignItems: 'center',
|
|
508
|
+
},
|
|
509
|
+
footerLink: {
|
|
510
|
+
fontSize: 13,
|
|
511
|
+
},
|
|
512
|
+
message: {
|
|
513
|
+
fontSize: 16,
|
|
514
|
+
textAlign: 'center',
|
|
515
|
+
marginTop: 24,
|
|
516
|
+
},
|
|
517
|
+
});
|
|
518
|
+
|
|
519
|
+
export default AccountOverviewScreen;
|