@onairos/react-native 3.0.24 → 3.0.25
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/components/OnairosButton.js +2 -3
- package/lib/commonjs/components/OnairosButton.js.map +1 -1
- package/lib/commonjs/components/TrainingModal.js +120 -16
- package/lib/commonjs/components/TrainingModal.js.map +1 -1
- package/lib/commonjs/components/UniversalOnboarding.js +131 -76
- package/lib/commonjs/components/UniversalOnboarding.js.map +1 -1
- package/lib/commonjs/components/onboarding/OAuthWebView.js +138 -27
- package/lib/commonjs/components/onboarding/OAuthWebView.js.map +1 -1
- package/lib/commonjs/constants/index.js +3 -3
- package/lib/commonjs/constants/index.js.map +1 -1
- package/lib/commonjs/services/platformAuthService.js +91 -44
- package/lib/commonjs/services/platformAuthService.js.map +1 -1
- package/lib/module/components/OnairosButton.js +2 -3
- package/lib/module/components/OnairosButton.js.map +1 -1
- package/lib/module/components/TrainingModal.js +120 -17
- package/lib/module/components/TrainingModal.js.map +1 -1
- package/lib/module/components/UniversalOnboarding.js +132 -77
- package/lib/module/components/UniversalOnboarding.js.map +1 -1
- package/lib/module/components/onboarding/OAuthWebView.js +139 -28
- package/lib/module/components/onboarding/OAuthWebView.js.map +1 -1
- package/lib/module/constants/index.js +3 -3
- package/lib/module/constants/index.js.map +1 -1
- package/lib/module/services/platformAuthService.js +88 -42
- package/lib/module/services/platformAuthService.js.map +1 -1
- package/lib/typescript/components/OnairosButton.d.ts.map +1 -1
- package/lib/typescript/components/TrainingModal.d.ts.map +1 -1
- package/lib/typescript/components/UniversalOnboarding.d.ts.map +1 -1
- package/lib/typescript/components/onboarding/OAuthWebView.d.ts.map +1 -1
- package/lib/typescript/services/platformAuthService.d.ts +11 -4
- package/lib/typescript/services/platformAuthService.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/OnairosButton.tsx +1 -4
- package/src/components/TrainingModal.tsx +202 -61
- package/src/components/UniversalOnboarding.tsx +129 -76
- package/src/components/onboarding/OAuthWebView.tsx +135 -25
- package/src/constants/index.ts +3 -3
- package/src/services/platformAuthService.ts +106 -40
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { View, Text, StyleSheet, TouchableOpacity, ActivityIndicator, Dimensions, Modal, TouchableWithoutFeedback, SafeAreaView } from 'react-native';
|
|
1
|
+
import React, { useState, useEffect } from 'react';
|
|
2
|
+
import { View, Text, StyleSheet, TouchableOpacity, ActivityIndicator, Dimensions, Modal, Animated, TouchableWithoutFeedback, SafeAreaView, TextInput, KeyboardAvoidingView, Platform } from 'react-native';
|
|
3
3
|
import Icon from 'react-native-vector-icons/MaterialIcons';
|
|
4
4
|
import { COLORS } from '../constants';
|
|
5
5
|
const {
|
|
6
6
|
width,
|
|
7
7
|
height
|
|
8
8
|
} = Dimensions.get('window');
|
|
9
|
+
|
|
10
|
+
// Dynamic training messages that appear during the process
|
|
11
|
+
const TRAINING_MESSAGES = ["Loading your data...", "Analyzing your digital footprint...", "Your mind is very unique...", "Creating your AI persona...", "Building neural pathways...", "Finalizing your digital twin...", "Almost ready...", "Training complete!"];
|
|
9
12
|
export const TrainingModal = ({
|
|
10
13
|
visible,
|
|
11
14
|
progress,
|
|
@@ -15,13 +18,48 @@ export const TrainingModal = ({
|
|
|
15
18
|
modelKey,
|
|
16
19
|
username
|
|
17
20
|
}) => {
|
|
21
|
+
const [email, setEmail] = useState('');
|
|
22
|
+
const [showEmailInput, setShowEmailInput] = useState(false);
|
|
23
|
+
const [currentMessage, setCurrentMessage] = useState(TRAINING_MESSAGES[0]);
|
|
24
|
+
const [messageIndex, setMessageIndex] = useState(0);
|
|
18
25
|
const progressPercentage = Math.round(progress * 100);
|
|
26
|
+
|
|
27
|
+
// Update training message based on progress
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
if (progress > 0) {
|
|
30
|
+
const newIndex = Math.min(Math.floor(progress * TRAINING_MESSAGES.length), TRAINING_MESSAGES.length - 1);
|
|
31
|
+
if (newIndex !== messageIndex) {
|
|
32
|
+
setMessageIndex(newIndex);
|
|
33
|
+
setCurrentMessage(TRAINING_MESSAGES[newIndex]);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}, [progress, messageIndex]);
|
|
37
|
+
|
|
38
|
+
// Show email input when training is complete
|
|
39
|
+
useEffect(() => {
|
|
40
|
+
if (progress >= 1 && !showEmailInput) {
|
|
41
|
+
setShowEmailInput(true);
|
|
42
|
+
}
|
|
43
|
+
}, [progress, showEmailInput]);
|
|
44
|
+
const handleEmailSubmit = () => {
|
|
45
|
+
if (email.trim() && onComplete) {
|
|
46
|
+
// Pass email data to the completion handler
|
|
47
|
+
onComplete();
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
const isValidEmail = email => {
|
|
51
|
+
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
52
|
+
return emailRegex.test(email);
|
|
53
|
+
};
|
|
19
54
|
return /*#__PURE__*/React.createElement(Modal, {
|
|
20
55
|
visible: visible,
|
|
21
56
|
transparent: true,
|
|
22
57
|
animationType: "none",
|
|
23
58
|
statusBarTranslucent: true,
|
|
24
59
|
onRequestClose: onCancel
|
|
60
|
+
}, /*#__PURE__*/React.createElement(KeyboardAvoidingView, {
|
|
61
|
+
style: styles.modalOverlay,
|
|
62
|
+
behavior: Platform.OS === 'ios' ? 'padding' : 'height'
|
|
25
63
|
}, /*#__PURE__*/React.createElement(TouchableWithoutFeedback, null, /*#__PURE__*/React.createElement(View, {
|
|
26
64
|
style: styles.modalOverlay
|
|
27
65
|
}, /*#__PURE__*/React.createElement(TouchableWithoutFeedback, null, /*#__PURE__*/React.createElement(View, {
|
|
@@ -34,7 +72,7 @@ export const TrainingModal = ({
|
|
|
34
72
|
style: styles.container
|
|
35
73
|
}, /*#__PURE__*/React.createElement(View, {
|
|
36
74
|
style: styles.content
|
|
37
|
-
}, /*#__PURE__*/React.createElement(Icon, {
|
|
75
|
+
}, !showEmailInput ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Icon, {
|
|
38
76
|
name: "auto_awesome",
|
|
39
77
|
size: 48,
|
|
40
78
|
color: COLORS.primary
|
|
@@ -46,7 +84,7 @@ export const TrainingModal = ({
|
|
|
46
84
|
style: styles.progressContainer
|
|
47
85
|
}, /*#__PURE__*/React.createElement(View, {
|
|
48
86
|
style: styles.progressBar
|
|
49
|
-
}, /*#__PURE__*/React.createElement(View, {
|
|
87
|
+
}, /*#__PURE__*/React.createElement(Animated.View, {
|
|
50
88
|
style: [styles.progressFill, {
|
|
51
89
|
width: `${progressPercentage}%`
|
|
52
90
|
}]
|
|
@@ -61,19 +99,51 @@ export const TrainingModal = ({
|
|
|
61
99
|
color: COLORS.primary
|
|
62
100
|
}), /*#__PURE__*/React.createElement(Text, {
|
|
63
101
|
style: styles.loadingText
|
|
64
|
-
},
|
|
102
|
+
}, currentMessage)), /*#__PURE__*/React.createElement(View, {
|
|
103
|
+
style: styles.footer
|
|
104
|
+
}, /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
105
|
+
style: styles.cancelButton,
|
|
106
|
+
onPress: onCancel
|
|
107
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
108
|
+
style: styles.cancelButtonText
|
|
109
|
+
}, "Cancel")))) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Icon, {
|
|
110
|
+
name: "check_circle",
|
|
111
|
+
size: 48,
|
|
112
|
+
color: "#4CAF50"
|
|
113
|
+
}), /*#__PURE__*/React.createElement(Text, {
|
|
114
|
+
style: styles.title
|
|
115
|
+
}, "Training Complete!"), /*#__PURE__*/React.createElement(Text, {
|
|
116
|
+
style: styles.subtitle
|
|
117
|
+
}, "Your AI model is ready. Enter your email to receive your account details and access your digital twin."), /*#__PURE__*/React.createElement(View, {
|
|
118
|
+
style: styles.emailContainer
|
|
119
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
120
|
+
style: styles.emailLabel
|
|
121
|
+
}, "Email Address"), /*#__PURE__*/React.createElement(TextInput, {
|
|
122
|
+
style: styles.emailInput,
|
|
123
|
+
placeholder: "Enter your email address",
|
|
124
|
+
placeholderTextColor: "#999",
|
|
125
|
+
value: email,
|
|
126
|
+
onChangeText: setEmail,
|
|
127
|
+
keyboardType: "email-address",
|
|
128
|
+
autoCapitalize: "none",
|
|
129
|
+
autoCorrect: false,
|
|
130
|
+
autoComplete: "email"
|
|
131
|
+
}), /*#__PURE__*/React.createElement(Text, {
|
|
132
|
+
style: styles.emailHint
|
|
133
|
+
}, "We'll send you login credentials and access to your AI persona")), /*#__PURE__*/React.createElement(View, {
|
|
65
134
|
style: styles.footer
|
|
66
135
|
}, /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
67
136
|
style: styles.cancelButton,
|
|
68
137
|
onPress: onCancel
|
|
69
138
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
70
139
|
style: styles.cancelButtonText
|
|
71
|
-
}, "Cancel")),
|
|
72
|
-
style: styles.completeButton,
|
|
73
|
-
onPress:
|
|
140
|
+
}, "Cancel")), /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
141
|
+
style: [styles.completeButton, !isValidEmail(email) && styles.completeButtonDisabled],
|
|
142
|
+
onPress: handleEmailSubmit,
|
|
143
|
+
disabled: !isValidEmail(email)
|
|
74
144
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
75
|
-
style: styles.completeButtonText
|
|
76
|
-
}, "Complete"))))))))));
|
|
145
|
+
style: [styles.completeButtonText, !isValidEmail(email) && styles.completeButtonTextDisabled]
|
|
146
|
+
}, "Complete Setup"))))))))))));
|
|
77
147
|
};
|
|
78
148
|
const styles = StyleSheet.create({
|
|
79
149
|
modalOverlay: {
|
|
@@ -85,7 +155,7 @@ const styles = StyleSheet.create({
|
|
|
85
155
|
bottomSheet: {
|
|
86
156
|
backgroundColor: '#fff',
|
|
87
157
|
width: width,
|
|
88
|
-
height: height * 0.
|
|
158
|
+
height: height * 0.7,
|
|
89
159
|
borderTopLeftRadius: 24,
|
|
90
160
|
borderTopRightRadius: 24,
|
|
91
161
|
overflow: 'hidden'
|
|
@@ -125,7 +195,8 @@ const styles = StyleSheet.create({
|
|
|
125
195
|
fontSize: 16,
|
|
126
196
|
color: COLORS.text.secondary,
|
|
127
197
|
textAlign: 'center',
|
|
128
|
-
marginBottom: 32
|
|
198
|
+
marginBottom: 32,
|
|
199
|
+
lineHeight: 22
|
|
129
200
|
},
|
|
130
201
|
progressContainer: {
|
|
131
202
|
width: '100%',
|
|
@@ -159,9 +230,37 @@ const styles = StyleSheet.create({
|
|
|
159
230
|
marginBottom: 32
|
|
160
231
|
},
|
|
161
232
|
loadingText: {
|
|
233
|
+
fontSize: 16,
|
|
234
|
+
color: COLORS.text.primary,
|
|
235
|
+
marginLeft: 12,
|
|
236
|
+
fontWeight: '500'
|
|
237
|
+
},
|
|
238
|
+
emailContainer: {
|
|
239
|
+
width: '100%',
|
|
240
|
+
marginBottom: 32
|
|
241
|
+
},
|
|
242
|
+
emailLabel: {
|
|
243
|
+
fontSize: 16,
|
|
244
|
+
fontWeight: '600',
|
|
245
|
+
color: COLORS.text.primary,
|
|
246
|
+
marginBottom: 8
|
|
247
|
+
},
|
|
248
|
+
emailInput: {
|
|
249
|
+
width: '100%',
|
|
250
|
+
height: 48,
|
|
251
|
+
borderWidth: 1,
|
|
252
|
+
borderColor: '#E0E0E0',
|
|
253
|
+
borderRadius: 12,
|
|
254
|
+
paddingHorizontal: 16,
|
|
255
|
+
fontSize: 16,
|
|
256
|
+
color: COLORS.text.primary,
|
|
257
|
+
backgroundColor: '#F8F8F8'
|
|
258
|
+
},
|
|
259
|
+
emailHint: {
|
|
162
260
|
fontSize: 14,
|
|
163
261
|
color: COLORS.text.secondary,
|
|
164
|
-
|
|
262
|
+
marginTop: 8,
|
|
263
|
+
textAlign: 'center'
|
|
165
264
|
},
|
|
166
265
|
footer: {
|
|
167
266
|
flexDirection: 'row',
|
|
@@ -186,14 +285,18 @@ const styles = StyleSheet.create({
|
|
|
186
285
|
paddingVertical: 16,
|
|
187
286
|
paddingHorizontal: 32,
|
|
188
287
|
borderRadius: 16,
|
|
189
|
-
backgroundColor: '#
|
|
190
|
-
|
|
191
|
-
|
|
288
|
+
backgroundColor: '#000'
|
|
289
|
+
},
|
|
290
|
+
completeButtonDisabled: {
|
|
291
|
+
backgroundColor: '#E0E0E0'
|
|
192
292
|
},
|
|
193
293
|
completeButtonText: {
|
|
194
294
|
fontSize: 16,
|
|
195
295
|
fontWeight: '600',
|
|
196
|
-
color: '#
|
|
296
|
+
color: '#fff'
|
|
297
|
+
},
|
|
298
|
+
completeButtonTextDisabled: {
|
|
299
|
+
color: '#999'
|
|
197
300
|
}
|
|
198
301
|
});
|
|
199
302
|
//# sourceMappingURL=TrainingModal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","View","Text","StyleSheet","TouchableOpacity","ActivityIndicator","Dimensions","Modal","TouchableWithoutFeedback","SafeAreaView","Icon","COLORS","width","height","get","TrainingModal","visible","progress","eta","onCancel","onComplete","modelKey","username","progressPercentage","Math","round","createElement","transparent","animationType","statusBarTranslucent","onRequestClose","style","styles","modalOverlay","bottomSheet","handleContainer","handle","container","content","name","size","color","primary","title","subtitle","progressContainer","progressBar","progressFill","progressText","etaText","loadingContainer","loadingText","footer","cancelButton","onPress","cancelButtonText","completeButton","completeButtonText","create","flex","backgroundColor","justifyContent","alignItems","borderTopLeftRadius","borderTopRightRadius","overflow","paddingTop","paddingBottom","borderRadius","padding","fontSize","fontWeight","marginTop","marginBottom","text","textAlign","secondary","border","flexDirection","marginLeft","borderTopWidth","borderTopColor","paddingHorizontal","paddingVertical","borderWidth","borderColor"],"sourceRoot":"..\\..\\..\\src","sources":["components/TrainingModal.tsx"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SACEC,IAAI,EACJC,IAAI,EACJC,UAAU,EACVC,gBAAgB,EAChBC,iBAAiB,EACjB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B,gBAAgB,EAAE;IAChB4B,aAAa,EAAE,KAAK;IACpBhB,UAAU,EAAE,QAAQ;IACpBW,YAAY,EAAE;EAChB,CAAC;EACDtB,WAAW,EAAE;IACXmB,QAAQ,EAAE,EAAE;IACZ7B,KAAK,EAAE9B,MAAM,CAAC+D,IAAI,CAACE,SAAS;IAC5BG,UAAU,EAAE;EACd,CAAC;EACD3B,MAAM,EAAE;IACN0B,aAAa,EAAE,KAAK;IACpBhB,UAAU,EAAE,QAAQ;IACpBD,cAAc,EAAE,eAAe;IAC/BjD,KAAK,EAAE,MAAM;IACboE,cAAc,EAAE,CAAC;IACjBC,cAAc,EAAE,MAAM;IACtBf,UAAU,EAAE,EAAE;IACdgB,iBAAiB,EAAE,EAAE;IACrBf,aAAa,EAAE;EACjB,CAAC;EACDd,YAAY,EAAE;IACZ8B,eAAe,EAAE,CAAC;IAClBD,iBAAiB,EAAE;EACrB,CAAC;EACD3B,gBAAgB,EAAE;IAChBe,QAAQ,EAAE,EAAE;IACZ7B,KAAK,EAAE;EACT,CAAC;EACDe,cAAc,EAAE;IACd2B,eAAe,EAAE,EAAE;IACnBD,iBAAiB,EAAE,EAAE;IACrBd,YAAY,EAAE,EAAE;IAChBR,eAAe,EAAE,MAAM;IACvBwB,WAAW,EAAE,CAAC;IACdC,WAAW,EAAE;EACf,CAAC;EACD5B,kBAAkB,EAAE;IAClBa,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,KAAK;IACjB9B,KAAK,EAAE;EACT;AACF,CAAC,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["React","useState","useEffect","View","Text","StyleSheet","TouchableOpacity","ActivityIndicator","Dimensions","Modal","Animated","TouchableWithoutFeedback","SafeAreaView","TextInput","KeyboardAvoidingView","Platform","Icon","COLORS","width","height","get","TRAINING_MESSAGES","TrainingModal","visible","progress","eta","onCancel","onComplete","modelKey","username","email","setEmail","showEmailInput","setShowEmailInput","currentMessage","setCurrentMessage","messageIndex","setMessageIndex","progressPercentage","Math","round","newIndex","min","floor","length","handleEmailSubmit","trim","isValidEmail","emailRegex","test","createElement","transparent","animationType","statusBarTranslucent","onRequestClose","style","styles","modalOverlay","behavior","OS","bottomSheet","handleContainer","handle","container","content","Fragment","name","size","color","primary","title","subtitle","progressContainer","progressBar","progressFill","progressText","etaText","loadingContainer","loadingText","footer","cancelButton","onPress","cancelButtonText","emailContainer","emailLabel","emailInput","placeholder","placeholderTextColor","value","onChangeText","keyboardType","autoCapitalize","autoCorrect","autoComplete","emailHint","completeButton","completeButtonDisabled","disabled","completeButtonText","completeButtonTextDisabled","create","flex","backgroundColor","justifyContent","alignItems","borderTopLeftRadius","borderTopRightRadius","overflow","paddingTop","paddingBottom","borderRadius","padding","fontSize","fontWeight","marginTop","marginBottom","text","textAlign","secondary","lineHeight","border","flexDirection","marginLeft","borderWidth","borderColor","paddingHorizontal","borderTopWidth","borderTopColor","paddingVertical"],"sourceRoot":"..\\..\\..\\src","sources":["components/TrainingModal.tsx"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,QAAQ,EAAEC,SAAS,QAAQ,OAAO;AAClD,SACEC,IAAI,EACJC,IAAI,EACJC,UAAU,EACVC,gBAAgB,EAChBC,iBAAiB,EACjBC,UAAU,EACVC,KAAK,EACLC,QAAQ,EACRC,wBAAwB,EACxBC,YAAY,EACZC,SAAS,EACTC,oBAAoB,EACpBC,QAAQ,QACH,cAAc;AACrB,OAAOC,IAAI,MAAM,yCAAyC;AAC1D,SAASC,MAAM,QAAQ,cAAc;AAGrC,MAAM;EAAEC,KAAK;EAAEC;AAAO,CAAC,GAAGX,UAAU,CAACY,GAAG,CAAC,QAAQ,CAAC;;AAElD;AACA,MAAMC,iBAAiB,GAAG,CACxB,sBAAsB,EACtB,qCAAqC,EACrC,6BAA6B,EAC7B,6BAA6B,EAC7B,6BAA6B,EAC7B,iCAAiC,EACjC,iBAAiB,EACjB,oBAAoB,CACrB;AAED,OAAO,MAAMC,aAA2C,GAAGA,CAAC;EAC1DC,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SAAS,EAAE,CAAC;IACZG,SAAS,EAAE;EACb,CAAC;EACDtC,MAAM,EAAE;IACN0C,aAAa,EAAE,KAAK;IACpBjB,UAAU,EAAE,QAAQ;IACpBD,cAAc,EAAE,eAAe;IAC/BrF,KAAK,EAAE,MAAM;IACb4G,cAAc,EAAE,CAAC;IACjBC,cAAc,EAAE,MAAM;IACtBnB,UAAU,EAAE,EAAE;IACdiB,iBAAiB,EAAE,EAAE;IACrBhB,aAAa,EAAE;EACjB,CAAC;EACD7B,YAAY,EAAE;IACZgD,eAAe,EAAE,CAAC;IAClBH,iBAAiB,EAAE;EACrB,CAAC;EACD3C,gBAAgB,EAAE;IAChB8B,QAAQ,EAAE,EAAE;IACZ5C,KAAK,EAAE;EACT,CAAC;EACD2B,cAAc,EAAE;IACdiC,eAAe,EAAE,EAAE;IACnBH,iBAAiB,EAAE,EAAE;IACrBf,YAAY,EAAE,EAAE;IAChBR,eAAe,EAAE;EACnB,CAAC;EACDN,sBAAsB,EAAE;IACtBM,eAAe,EAAE;EACnB,CAAC;EACDJ,kBAAkB,EAAE;IAClBc,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,KAAK;IACjB7C,KAAK,EAAE;EACT,CAAC;EACD+B,0BAA0B,EAAE;IAC1B/B,KAAK,EAAE;EACT;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import React, { useCallback, useEffect, useState } from 'react';
|
|
2
|
-
import { View, Text, StyleSheet, TouchableOpacity, Dimensions, Platform, Modal, Animated, SafeAreaView, TouchableWithoutFeedback, ScrollView, Image, Switch, Linking } from 'react-native';
|
|
2
|
+
import { View, Text, StyleSheet, TouchableOpacity, ActivityIndicator, Dimensions, Platform, Modal, Animated, SafeAreaView, TouchableWithoutFeedback, ScrollView, Image, Switch, Linking } from 'react-native';
|
|
3
3
|
import Icon from 'react-native-vector-icons/MaterialIcons';
|
|
4
4
|
import { PinInput } from './PinInput';
|
|
5
5
|
import { TrainingModal } from './TrainingModal';
|
|
6
6
|
import { OAuthWebView } from './onboarding/OAuthWebView';
|
|
7
7
|
import { useConnections } from '../hooks/useConnections';
|
|
8
|
+
import { COLORS } from '../constants';
|
|
8
9
|
import { initiateOAuth, initiateNativeAuth, hasNativeSDK, isOAuthCallback } from '../services/platformAuthService';
|
|
9
10
|
const {
|
|
10
11
|
height,
|
|
@@ -34,7 +35,9 @@ export const UniversalOnboarding = ({
|
|
|
34
35
|
const [platformToggles, setPlatformToggles] = useState({});
|
|
35
36
|
const [oauthUrl, setOauthUrl] = useState('');
|
|
36
37
|
const [currentPlatform, setCurrentPlatform] = useState('');
|
|
37
|
-
const [
|
|
38
|
+
const [userEmail, setUserEmail] = useState('user@example.com'); // Use proper email instead of random username
|
|
39
|
+
const [isConnectingPlatform, setIsConnectingPlatform] = useState(false);
|
|
40
|
+
const [connectingPlatform, setConnectingPlatform] = useState(null);
|
|
38
41
|
const platforms = [{
|
|
39
42
|
id: 'instagram',
|
|
40
43
|
name: 'Instagram',
|
|
@@ -156,64 +159,77 @@ export const UniversalOnboarding = ({
|
|
|
156
159
|
setConnections(status);
|
|
157
160
|
}, [getConnectionStatus]);
|
|
158
161
|
const togglePlatform = useCallback(async platformId => {
|
|
159
|
-
// If toggling on, initiate the OAuth flow for the platform
|
|
160
162
|
if (!platformToggles[platformId]) {
|
|
163
|
+
// Attempt to connect platform
|
|
161
164
|
try {
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
...prev,
|
|
166
|
-
[platformId]: !prev[platformId]
|
|
167
|
-
}));
|
|
168
|
-
return;
|
|
169
|
-
}
|
|
165
|
+
setIsConnectingPlatform(true);
|
|
166
|
+
setConnectingPlatform(platformId);
|
|
167
|
+
console.log(`Initiating connection for ${platformId}`);
|
|
170
168
|
|
|
171
|
-
// Check if
|
|
169
|
+
// Check if platform has a native SDK
|
|
172
170
|
if (hasNativeSDK(platformId)) {
|
|
173
|
-
|
|
174
|
-
|
|
171
|
+
console.log(`Using native SDK for ${platformId}`);
|
|
172
|
+
// Use native SDK for authentication
|
|
175
173
|
const success = await initiateNativeAuth(platformId);
|
|
176
174
|
if (success) {
|
|
175
|
+
console.log(`Native authentication successful for ${platformId}`);
|
|
176
|
+
// Update platform toggle state
|
|
177
|
+
setPlatformToggles(prev => ({
|
|
178
|
+
...prev,
|
|
179
|
+
[platformId]: true
|
|
180
|
+
}));
|
|
181
|
+
|
|
177
182
|
// Update connections state
|
|
178
183
|
setConnections(prev => ({
|
|
179
184
|
...prev,
|
|
180
185
|
[platformId]: {
|
|
181
|
-
userName:
|
|
186
|
+
userName: userEmail,
|
|
182
187
|
connected: true
|
|
183
188
|
}
|
|
184
189
|
}));
|
|
185
|
-
|
|
186
|
-
// Update platform toggles
|
|
187
|
-
setPlatformToggles(prev => ({
|
|
188
|
-
...prev,
|
|
189
|
-
[platformId]: true
|
|
190
|
-
}));
|
|
191
190
|
}
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
191
|
+
} else {
|
|
192
|
+
console.log(`Initiating OAuth flow for ${platformId}`);
|
|
193
|
+
// Use OAuth flow through proxy server
|
|
194
|
+
const oauthUrl = await initiateOAuth(platformId, userEmail);
|
|
195
|
+
if (oauthUrl) {
|
|
196
|
+
console.log(`Received OAuth URL for ${platformId}: ${oauthUrl}`);
|
|
197
|
+
setCurrentPlatform(platformId);
|
|
198
|
+
setOauthUrl(oauthUrl);
|
|
199
|
+
setStep('oauth');
|
|
200
|
+
} else {
|
|
201
|
+
console.error(`No OAuth URL returned for ${platformId}`);
|
|
202
|
+
}
|
|
203
203
|
}
|
|
204
204
|
} catch (error) {
|
|
205
|
-
console.error(`Error
|
|
206
|
-
//
|
|
207
|
-
|
|
205
|
+
console.error(`Error connecting ${platformId}:`, error);
|
|
206
|
+
// Reset toggle state on error
|
|
207
|
+
setPlatformToggles(prev => ({
|
|
208
|
+
...prev,
|
|
209
|
+
[platformId]: false
|
|
210
|
+
}));
|
|
211
|
+
} finally {
|
|
212
|
+
setIsConnectingPlatform(false);
|
|
213
|
+
setConnectingPlatform(null);
|
|
208
214
|
}
|
|
209
215
|
} else {
|
|
210
|
-
//
|
|
216
|
+
// Disconnect platform
|
|
217
|
+
console.log(`Disconnecting ${platformId}`);
|
|
211
218
|
setPlatformToggles(prev => ({
|
|
212
219
|
...prev,
|
|
213
|
-
[platformId]:
|
|
220
|
+
[platformId]: false
|
|
214
221
|
}));
|
|
222
|
+
|
|
223
|
+
// Update connections state
|
|
224
|
+
setConnections(prev => {
|
|
225
|
+
const newConnections = {
|
|
226
|
+
...prev
|
|
227
|
+
};
|
|
228
|
+
delete newConnections[platformId];
|
|
229
|
+
return newConnections;
|
|
230
|
+
});
|
|
215
231
|
}
|
|
216
|
-
}, [platformToggles,
|
|
232
|
+
}, [platformToggles, userEmail]);
|
|
217
233
|
|
|
218
234
|
/**
|
|
219
235
|
* Handles OAuth callback URLs
|
|
@@ -229,7 +245,7 @@ export const UniversalOnboarding = ({
|
|
|
229
245
|
setConnections(prev => ({
|
|
230
246
|
...prev,
|
|
231
247
|
[platform]: {
|
|
232
|
-
userName:
|
|
248
|
+
userName: userEmail,
|
|
233
249
|
connected: true
|
|
234
250
|
}
|
|
235
251
|
}));
|
|
@@ -246,18 +262,21 @@ export const UniversalOnboarding = ({
|
|
|
246
262
|
} catch (error) {
|
|
247
263
|
console.error('Error handling OAuth callback:', error);
|
|
248
264
|
}
|
|
249
|
-
}, [currentPlatform,
|
|
265
|
+
}, [currentPlatform, userEmail]);
|
|
250
266
|
|
|
251
267
|
/**
|
|
252
268
|
* Handles completion of the OAuth flow
|
|
253
269
|
*/
|
|
254
270
|
const handleOAuthSuccess = useCallback(code => {
|
|
271
|
+
console.log(`OAuth success for ${currentPlatform} with code: ${code}`);
|
|
272
|
+
|
|
273
|
+
// Update connections for the current platform
|
|
255
274
|
if (currentPlatform) {
|
|
256
275
|
// Update connections state
|
|
257
276
|
setConnections(prev => ({
|
|
258
277
|
...prev,
|
|
259
278
|
[currentPlatform]: {
|
|
260
|
-
userName:
|
|
279
|
+
userName: userEmail,
|
|
261
280
|
connected: true
|
|
262
281
|
}
|
|
263
282
|
}));
|
|
@@ -268,32 +287,36 @@ export const UniversalOnboarding = ({
|
|
|
268
287
|
[currentPlatform]: true
|
|
269
288
|
}));
|
|
270
289
|
|
|
271
|
-
//
|
|
272
|
-
|
|
290
|
+
// In a real implementation, we would send the code to our server
|
|
291
|
+
// to exchange it for an access token and store it securely
|
|
292
|
+
console.log(`Simulating token exchange for ${currentPlatform}`);
|
|
293
|
+
|
|
294
|
+
// For demo purposes, we'll just simulate a successful token exchange
|
|
295
|
+
if (debug || test) {
|
|
296
|
+
console.log('Debug mode: Simulating successful token exchange');
|
|
297
|
+
}
|
|
273
298
|
}
|
|
274
|
-
|
|
299
|
+
|
|
300
|
+
// Close OAuth window and return to connect step
|
|
301
|
+
setOauthUrl('');
|
|
302
|
+
setStep('connect');
|
|
303
|
+
}, [currentPlatform, userEmail, debug, test]);
|
|
275
304
|
const handlePinSubmit = useCallback(async userPin => {
|
|
276
305
|
setPin(userPin);
|
|
277
306
|
setStep('training');
|
|
278
|
-
// Simulate training progress
|
|
307
|
+
// Simulate training progress over 10 seconds
|
|
279
308
|
let progress = 0;
|
|
280
309
|
const interval = setInterval(() => {
|
|
281
|
-
progress +=
|
|
310
|
+
progress += 1; // 10% progress every second for 1 seconds total
|
|
282
311
|
setTraining({
|
|
283
312
|
progress,
|
|
284
|
-
eta: `${Math.round((1 - progress) *
|
|
313
|
+
eta: `${Math.round((1 - progress) * 10)} seconds remaining`
|
|
285
314
|
});
|
|
286
315
|
if (progress >= 1) {
|
|
287
316
|
clearInterval(interval);
|
|
288
|
-
|
|
289
|
-
pin: userPin,
|
|
290
|
-
connections,
|
|
291
|
-
platformToggles,
|
|
292
|
-
selectedTier,
|
|
293
|
-
tierData: requestData === null || requestData === void 0 ? void 0 : requestData[selectedTier]
|
|
294
|
-
});
|
|
317
|
+
// Training complete - TrainingModal will handle email input and final completion
|
|
295
318
|
}
|
|
296
|
-
}, 1000);
|
|
319
|
+
}, 1000); // 1 second intervals for 10 total seconds
|
|
297
320
|
}, [connections, onComplete, selectedTier, requestData, platformToggles]);
|
|
298
321
|
const canProceedToPin = useCallback(() => {
|
|
299
322
|
// Check if at least one platform is toggled on
|
|
@@ -355,26 +378,39 @@ export const UniversalOnboarding = ({
|
|
|
355
378
|
style: styles.privacyMessage
|
|
356
379
|
}, "None of your app data is shared with ANYONE")), /*#__PURE__*/React.createElement(View, {
|
|
357
380
|
style: styles.platformsContainer
|
|
358
|
-
}, platforms.map(platform =>
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
},
|
|
376
|
-
|
|
377
|
-
|
|
381
|
+
}, platforms.map(platform => {
|
|
382
|
+
var _connections$platform, _connections$platform2, _connections$platform3, _connections$platform4;
|
|
383
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
384
|
+
key: platform.id,
|
|
385
|
+
style: [styles.platformItem, ((_connections$platform = connections[platform.id]) === null || _connections$platform === void 0 ? void 0 : _connections$platform.connected) && styles.platformItemConnected]
|
|
386
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
387
|
+
style: styles.platformInfo
|
|
388
|
+
}, /*#__PURE__*/React.createElement(Image, {
|
|
389
|
+
source: platform.icon,
|
|
390
|
+
style: styles.platformIcon,
|
|
391
|
+
resizeMode: "contain"
|
|
392
|
+
}), /*#__PURE__*/React.createElement(View, {
|
|
393
|
+
style: styles.platformTextContainer
|
|
394
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
395
|
+
style: styles.platformName
|
|
396
|
+
}, platform.name), ((_connections$platform2 = connections[platform.id]) === null || _connections$platform2 === void 0 ? void 0 : _connections$platform2.connected) && /*#__PURE__*/React.createElement(Text, {
|
|
397
|
+
style: styles.connectedText
|
|
398
|
+
}, "Connected"))), /*#__PURE__*/React.createElement(View, {
|
|
399
|
+
style: styles.platformActions
|
|
400
|
+
}, connectingPlatform === platform.id ? /*#__PURE__*/React.createElement(ActivityIndicator, {
|
|
401
|
+
size: "small",
|
|
402
|
+
color: COLORS.primary
|
|
403
|
+
}) : /*#__PURE__*/React.createElement(Switch, {
|
|
404
|
+
value: platformToggles[platform.id] || ((_connections$platform3 = connections[platform.id]) === null || _connections$platform3 === void 0 ? void 0 : _connections$platform3.connected) || false,
|
|
405
|
+
onValueChange: () => togglePlatform(platform.id),
|
|
406
|
+
trackColor: {
|
|
407
|
+
false: '#767577',
|
|
408
|
+
true: '#81b0ff'
|
|
409
|
+
},
|
|
410
|
+
thumbColor: platformToggles[platform.id] || (_connections$platform4 = connections[platform.id]) !== null && _connections$platform4 !== void 0 && _connections$platform4.connected ? '#2196F3' : '#f4f3f4',
|
|
411
|
+
disabled: connectingPlatform !== null
|
|
412
|
+
})));
|
|
413
|
+
}))), /*#__PURE__*/React.createElement(View, {
|
|
378
414
|
style: styles.footer
|
|
379
415
|
}, /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
380
416
|
style: styles.footerButtonCancel,
|
|
@@ -404,11 +440,12 @@ export const UniversalOnboarding = ({
|
|
|
404
440
|
connections,
|
|
405
441
|
platformToggles,
|
|
406
442
|
selectedTier,
|
|
407
|
-
tierData: requestData === null || requestData === void 0 ? void 0 : requestData[selectedTier]
|
|
443
|
+
tierData: requestData === null || requestData === void 0 ? void 0 : requestData[selectedTier],
|
|
444
|
+
userEmail
|
|
408
445
|
});
|
|
409
446
|
},
|
|
410
447
|
modelKey: "onairosTrainingModel",
|
|
411
|
-
username:
|
|
448
|
+
username: userEmail
|
|
412
449
|
}), step === 'oauth' && oauthUrl && /*#__PURE__*/React.createElement(OAuthWebView, {
|
|
413
450
|
url: oauthUrl,
|
|
414
451
|
platform: currentPlatform,
|
|
@@ -536,6 +573,24 @@ const styles = StyleSheet.create({
|
|
|
536
573
|
fontWeight: '500',
|
|
537
574
|
color: '#000'
|
|
538
575
|
},
|
|
576
|
+
platformTextContainer: {
|
|
577
|
+
flex: 1
|
|
578
|
+
},
|
|
579
|
+
connectedText: {
|
|
580
|
+
fontSize: 12,
|
|
581
|
+
color: '#4CAF50',
|
|
582
|
+
fontWeight: '500',
|
|
583
|
+
marginTop: 2
|
|
584
|
+
},
|
|
585
|
+
platformActions: {
|
|
586
|
+
alignItems: 'center',
|
|
587
|
+
justifyContent: 'center'
|
|
588
|
+
},
|
|
589
|
+
platformItemConnected: {
|
|
590
|
+
backgroundColor: '#F8F9FA',
|
|
591
|
+
borderColor: '#4CAF50',
|
|
592
|
+
borderWidth: 1
|
|
593
|
+
},
|
|
539
594
|
footer: {
|
|
540
595
|
flexDirection: 'row',
|
|
541
596
|
alignItems: 'center',
|