@onairos/react-native 3.0.18 → 3.0.19
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/Overlay.js +13 -0
- package/lib/commonjs/components/Overlay.js.map +1 -1
- package/lib/commonjs/components/PinInput.js +70 -11
- package/lib/commonjs/components/PinInput.js.map +1 -1
- package/lib/commonjs/components/TrainingModal.js +91 -14
- package/lib/commonjs/components/TrainingModal.js.map +1 -1
- package/lib/commonjs/components/UniversalOnboarding.js +19 -7
- package/lib/commonjs/components/UniversalOnboarding.js.map +1 -1
- package/lib/module/components/Overlay.js +13 -0
- package/lib/module/components/Overlay.js.map +1 -1
- package/lib/module/components/PinInput.js +71 -12
- package/lib/module/components/PinInput.js.map +1 -1
- package/lib/module/components/TrainingModal.js +92 -15
- package/lib/module/components/TrainingModal.js.map +1 -1
- package/lib/module/components/UniversalOnboarding.js +19 -7
- package/lib/module/components/UniversalOnboarding.js.map +1 -1
- package/lib/typescript/components/Overlay.d.ts.map +1 -1
- package/lib/typescript/components/PinInput.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/types/index.d.ts +5 -0
- package/lib/typescript/types/index.d.ts.map +1 -1
- package/lib/typescript/types.d.ts +7 -7
- package/lib/typescript/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/Overlay.tsx +4 -0
- package/src/components/PinInput.tsx +250 -189
- package/src/components/TrainingModal.tsx +222 -132
- package/src/components/UniversalOnboarding.tsx +8 -5
- package/src/types/index.ts +150 -145
- package/src/types.ts +149 -149
- package/lib/commonjs/components/Overlay.tsx.new +0 -516
- package/lib/module/components/Overlay.tsx.new +0 -516
- package/src/components/Overlay.tsx.new +0 -516
|
@@ -1,132 +1,222 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
View,
|
|
4
|
-
Text,
|
|
5
|
-
StyleSheet,
|
|
6
|
-
TouchableOpacity,
|
|
7
|
-
ActivityIndicator,
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
}
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {
|
|
3
|
+
View,
|
|
4
|
+
Text,
|
|
5
|
+
StyleSheet,
|
|
6
|
+
TouchableOpacity,
|
|
7
|
+
ActivityIndicator,
|
|
8
|
+
Dimensions,
|
|
9
|
+
Modal,
|
|
10
|
+
Animated,
|
|
11
|
+
TouchableWithoutFeedback,
|
|
12
|
+
SafeAreaView,
|
|
13
|
+
} from 'react-native';
|
|
14
|
+
import Icon from 'react-native-vector-icons/MaterialIcons';
|
|
15
|
+
import { COLORS } from '../constants';
|
|
16
|
+
import type { TrainingModalProps } from '../types';
|
|
17
|
+
|
|
18
|
+
const { width, height } = Dimensions.get('window');
|
|
19
|
+
|
|
20
|
+
export const TrainingModal: React.FC<TrainingModalProps> = ({
|
|
21
|
+
visible,
|
|
22
|
+
progress,
|
|
23
|
+
eta,
|
|
24
|
+
onCancel,
|
|
25
|
+
onComplete,
|
|
26
|
+
modelKey,
|
|
27
|
+
username,
|
|
28
|
+
}) => {
|
|
29
|
+
const progressPercentage = Math.round(progress * 100);
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<Modal
|
|
33
|
+
visible={visible}
|
|
34
|
+
transparent
|
|
35
|
+
animationType="none"
|
|
36
|
+
statusBarTranslucent
|
|
37
|
+
onRequestClose={onCancel}
|
|
38
|
+
>
|
|
39
|
+
<TouchableWithoutFeedback>
|
|
40
|
+
<View style={styles.modalOverlay}>
|
|
41
|
+
<TouchableWithoutFeedback>
|
|
42
|
+
<View style={styles.bottomSheet}>
|
|
43
|
+
<View style={styles.handleContainer}>
|
|
44
|
+
<View style={styles.handle} />
|
|
45
|
+
</View>
|
|
46
|
+
|
|
47
|
+
<SafeAreaView style={styles.container}>
|
|
48
|
+
<View style={styles.content}>
|
|
49
|
+
<Icon name="auto_awesome" size={48} color={COLORS.primary} />
|
|
50
|
+
|
|
51
|
+
<Text style={styles.title}>Training Your AI Model</Text>
|
|
52
|
+
<Text style={styles.subtitle}>
|
|
53
|
+
We're analyzing your social media data to create your personalized AI model
|
|
54
|
+
</Text>
|
|
55
|
+
|
|
56
|
+
<View style={styles.progressContainer}>
|
|
57
|
+
<View style={styles.progressBar}>
|
|
58
|
+
<View
|
|
59
|
+
style={[
|
|
60
|
+
styles.progressFill,
|
|
61
|
+
{ width: `${progressPercentage}%` },
|
|
62
|
+
]}
|
|
63
|
+
/>
|
|
64
|
+
</View>
|
|
65
|
+
<Text style={styles.progressText}>{progressPercentage}%</Text>
|
|
66
|
+
</View>
|
|
67
|
+
|
|
68
|
+
<Text style={styles.etaText}>Estimated time remaining: {eta}</Text>
|
|
69
|
+
|
|
70
|
+
<View style={styles.loadingContainer}>
|
|
71
|
+
<ActivityIndicator size="small" color={COLORS.primary} />
|
|
72
|
+
<Text style={styles.loadingText}>Processing your data...</Text>
|
|
73
|
+
</View>
|
|
74
|
+
|
|
75
|
+
<View style={styles.footer}>
|
|
76
|
+
<TouchableOpacity
|
|
77
|
+
style={styles.cancelButton}
|
|
78
|
+
onPress={onCancel}
|
|
79
|
+
>
|
|
80
|
+
<Text style={styles.cancelButtonText}>Cancel</Text>
|
|
81
|
+
</TouchableOpacity>
|
|
82
|
+
|
|
83
|
+
{progress >= 1 && (
|
|
84
|
+
<TouchableOpacity
|
|
85
|
+
style={styles.completeButton}
|
|
86
|
+
onPress={onComplete}
|
|
87
|
+
>
|
|
88
|
+
<Text style={styles.completeButtonText}>Complete</Text>
|
|
89
|
+
</TouchableOpacity>
|
|
90
|
+
)}
|
|
91
|
+
</View>
|
|
92
|
+
</View>
|
|
93
|
+
</SafeAreaView>
|
|
94
|
+
</View>
|
|
95
|
+
</TouchableWithoutFeedback>
|
|
96
|
+
</View>
|
|
97
|
+
</TouchableWithoutFeedback>
|
|
98
|
+
</Modal>
|
|
99
|
+
);
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
const styles = StyleSheet.create({
|
|
103
|
+
modalOverlay: {
|
|
104
|
+
flex: 1,
|
|
105
|
+
backgroundColor: 'rgba(0, 0, 0, 0.5)',
|
|
106
|
+
justifyContent: 'flex-end',
|
|
107
|
+
alignItems: 'center',
|
|
108
|
+
},
|
|
109
|
+
bottomSheet: {
|
|
110
|
+
backgroundColor: '#fff',
|
|
111
|
+
width: width,
|
|
112
|
+
height: height * 0.6,
|
|
113
|
+
borderTopLeftRadius: 24,
|
|
114
|
+
borderTopRightRadius: 24,
|
|
115
|
+
overflow: 'hidden',
|
|
116
|
+
},
|
|
117
|
+
handleContainer: {
|
|
118
|
+
width: '100%',
|
|
119
|
+
alignItems: 'center',
|
|
120
|
+
paddingTop: 12,
|
|
121
|
+
paddingBottom: 8,
|
|
122
|
+
},
|
|
123
|
+
handle: {
|
|
124
|
+
width: 40,
|
|
125
|
+
height: 5,
|
|
126
|
+
borderRadius: 3,
|
|
127
|
+
backgroundColor: '#E0E0E0',
|
|
128
|
+
},
|
|
129
|
+
container: {
|
|
130
|
+
flex: 1,
|
|
131
|
+
backgroundColor: '#fff',
|
|
132
|
+
},
|
|
133
|
+
content: {
|
|
134
|
+
flex: 1,
|
|
135
|
+
width: '100%',
|
|
136
|
+
alignItems: 'center',
|
|
137
|
+
justifyContent: 'center',
|
|
138
|
+
padding: 24,
|
|
139
|
+
},
|
|
140
|
+
title: {
|
|
141
|
+
fontSize: 24,
|
|
142
|
+
fontWeight: '600',
|
|
143
|
+
marginTop: 24,
|
|
144
|
+
marginBottom: 8,
|
|
145
|
+
color: COLORS.text.primary,
|
|
146
|
+
textAlign: 'center',
|
|
147
|
+
},
|
|
148
|
+
subtitle: {
|
|
149
|
+
fontSize: 16,
|
|
150
|
+
color: COLORS.text.secondary,
|
|
151
|
+
textAlign: 'center',
|
|
152
|
+
marginBottom: 32,
|
|
153
|
+
},
|
|
154
|
+
progressContainer: {
|
|
155
|
+
width: '100%',
|
|
156
|
+
marginBottom: 16,
|
|
157
|
+
},
|
|
158
|
+
progressBar: {
|
|
159
|
+
height: 8,
|
|
160
|
+
backgroundColor: COLORS.border,
|
|
161
|
+
borderRadius: 4,
|
|
162
|
+
overflow: 'hidden',
|
|
163
|
+
},
|
|
164
|
+
progressFill: {
|
|
165
|
+
height: '100%',
|
|
166
|
+
backgroundColor: COLORS.primary,
|
|
167
|
+
borderRadius: 4,
|
|
168
|
+
},
|
|
169
|
+
progressText: {
|
|
170
|
+
fontSize: 14,
|
|
171
|
+
color: COLORS.text.secondary,
|
|
172
|
+
textAlign: 'center',
|
|
173
|
+
marginTop: 8,
|
|
174
|
+
},
|
|
175
|
+
etaText: {
|
|
176
|
+
fontSize: 14,
|
|
177
|
+
color: COLORS.text.secondary,
|
|
178
|
+
marginBottom: 24,
|
|
179
|
+
},
|
|
180
|
+
loadingContainer: {
|
|
181
|
+
flexDirection: 'row',
|
|
182
|
+
alignItems: 'center',
|
|
183
|
+
marginBottom: 32,
|
|
184
|
+
},
|
|
185
|
+
loadingText: {
|
|
186
|
+
fontSize: 14,
|
|
187
|
+
color: COLORS.text.secondary,
|
|
188
|
+
marginLeft: 8,
|
|
189
|
+
},
|
|
190
|
+
footer: {
|
|
191
|
+
flexDirection: 'row',
|
|
192
|
+
alignItems: 'center',
|
|
193
|
+
justifyContent: 'space-between',
|
|
194
|
+
width: '100%',
|
|
195
|
+
borderTopWidth: 1,
|
|
196
|
+
borderTopColor: '#eee',
|
|
197
|
+
paddingTop: 16,
|
|
198
|
+
paddingHorizontal: 24,
|
|
199
|
+
paddingBottom: 24,
|
|
200
|
+
},
|
|
201
|
+
cancelButton: {
|
|
202
|
+
paddingVertical: 8,
|
|
203
|
+
paddingHorizontal: 16,
|
|
204
|
+
},
|
|
205
|
+
cancelButtonText: {
|
|
206
|
+
fontSize: 16,
|
|
207
|
+
color: '#666',
|
|
208
|
+
},
|
|
209
|
+
completeButton: {
|
|
210
|
+
paddingVertical: 16,
|
|
211
|
+
paddingHorizontal: 32,
|
|
212
|
+
borderRadius: 16,
|
|
213
|
+
backgroundColor: '#fff',
|
|
214
|
+
borderWidth: 1,
|
|
215
|
+
borderColor: '#000',
|
|
216
|
+
},
|
|
217
|
+
completeButtonText: {
|
|
218
|
+
fontSize: 16,
|
|
219
|
+
fontWeight: '600',
|
|
220
|
+
color: '#000',
|
|
221
|
+
},
|
|
222
|
+
});
|
|
@@ -51,6 +51,9 @@ export const UniversalOnboarding: React.FC<UniversalOnboardingProps> = ({
|
|
|
51
51
|
const platforms = [
|
|
52
52
|
{ id: 'instagram', name: 'Instagram', icon: require('../assets/images/instagram.png') },
|
|
53
53
|
{ id: 'youtube', name: 'YouTube', icon: require('../assets/images/youtube.png') },
|
|
54
|
+
{ id: 'reddit', name: 'Reddit', icon: require('../assets/images/reddit.png') },
|
|
55
|
+
{ id: 'pinterest', name: 'Pinterest', icon: require('../assets/images/pinterest.png') },
|
|
56
|
+
{ id: 'email', name: 'Email', icon: require('../assets/images/email.png') },
|
|
54
57
|
];
|
|
55
58
|
|
|
56
59
|
const {
|
|
@@ -271,13 +274,16 @@ export const UniversalOnboarding: React.FC<UniversalOnboardingProps> = ({
|
|
|
271
274
|
minLength={8}
|
|
272
275
|
requireSpecialChar
|
|
273
276
|
requireNumber
|
|
277
|
+
onBack={() => setStep('connect')}
|
|
274
278
|
/>
|
|
275
279
|
)}
|
|
276
280
|
|
|
277
281
|
{step === 'training' && (
|
|
278
282
|
<TrainingModal
|
|
279
283
|
visible={step === 'training'}
|
|
280
|
-
|
|
284
|
+
progress={training.progress}
|
|
285
|
+
eta={training.eta}
|
|
286
|
+
onCancel={handleClose}
|
|
281
287
|
onComplete={() => {
|
|
282
288
|
onComplete('https://api2.onairos.uk', 'dummy-token', {
|
|
283
289
|
pin,
|
|
@@ -289,9 +295,6 @@ export const UniversalOnboarding: React.FC<UniversalOnboardingProps> = ({
|
|
|
289
295
|
}}
|
|
290
296
|
modelKey="onairosTrainingModel"
|
|
291
297
|
username="demo_user"
|
|
292
|
-
progress={training.progress}
|
|
293
|
-
eta={training.eta}
|
|
294
|
-
onCancel={handleClose}
|
|
295
298
|
/>
|
|
296
299
|
)}
|
|
297
300
|
</SafeAreaView>
|
|
@@ -313,7 +316,7 @@ const styles = StyleSheet.create({
|
|
|
313
316
|
bottomSheet: {
|
|
314
317
|
backgroundColor: '#fff',
|
|
315
318
|
width: width,
|
|
316
|
-
height: height * 0.
|
|
319
|
+
height: height * 0.6,
|
|
317
320
|
borderTopLeftRadius: 24,
|
|
318
321
|
borderTopRightRadius: 24,
|
|
319
322
|
overflow: 'hidden',
|