@onairos/react-native 3.0.25 → 3.0.27
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/TrainingModal.js +16 -120
- package/lib/commonjs/components/TrainingModal.js.map +1 -1
- package/lib/commonjs/components/UniversalOnboarding.js +42 -83
- package/lib/commonjs/components/UniversalOnboarding.js.map +1 -1
- package/lib/commonjs/components/onboarding/OAuthWebView.js +49 -124
- 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 +81 -95
- package/lib/commonjs/services/platformAuthService.js.map +1 -1
- package/lib/module/components/TrainingModal.js +17 -120
- package/lib/module/components/TrainingModal.js.map +1 -1
- package/lib/module/components/UniversalOnboarding.js +43 -84
- package/lib/module/components/UniversalOnboarding.js.map +1 -1
- package/lib/module/components/onboarding/OAuthWebView.js +50 -125
- 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/index.js +9 -10
- package/lib/module/index.js.map +1 -1
- package/lib/module/services/platformAuthService.js +80 -93
- package/lib/module/services/platformAuthService.js.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 +5 -11
- package/lib/typescript/services/platformAuthService.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/TrainingModal.tsx +61 -202
- package/src/components/UniversalOnboarding.tsx +42 -83
- package/src/components/onboarding/OAuthWebView.tsx +59 -121
- package/src/constants/index.ts +3 -3
- package/src/services/platformAuthService.ts +80 -110
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["PLATFORM_AUTH_CONFIG","instagram","hasNativeSDK","authEndpoint","color","youtube","reddit","pinterest","email","platform","config","getAuthEndpoint","getPlatformColor","initiateOAuth","
|
|
1
|
+
{"version":3,"names":["PLATFORM_AUTH_CONFIG","instagram","hasNativeSDK","authEndpoint","color","youtube","nativeSDKPackage","reddit","pinterest","email","platform","config","getAuthEndpoint","getPlatformColor","initiateOAuth","username","appName","Error","state","jsonData","session","oauthState","response","fetch","method","headers","body","JSON","stringify","responseData","json","instagramURL","data","redditURL","pinterestURL","youtubeURL","emailURL","url","error","console","initiateNativeAuth","log","handleOAuthCallback","parsedUrl","URL","searchParams","get","isOAuthCallback","startsWith"],"sourceRoot":"..\\..\\..\\src","sources":["services/platformAuthService.ts"],"mappings":"AAGA;;AAQA;AACA,MAAMA,oBAAwD,GAAG;EAC/DC,SAAS,EAAE;IACTC,YAAY,EAAE,KAAK;IAAE;IACrBC,YAAY,EAAE,6CAA6C;IAC3DC,KAAK,EAAE;EACT,CAAC;EACDC,OAAO,EAAE;IACPH,YAAY,EAAE,IAAI;IAAE;IACpBI,gBAAgB,EAAE,2CAA2C;IAC7DH,YAAY,EAAE,2CAA2C;IACzDC,KAAK,EAAE;EACT,CAAC;EACDG,MAAM,EAAE;IACNL,YAAY,EAAE,KAAK;IACnBC,YAAY,EAAE,0CAA0C;IACxDC,KAAK,EAAE;EACT,CAAC;EACDI,SAAS,EAAE;IACTN,YAAY,EAAE,KAAK;IACnBC,YAAY,EAAE,6CAA6C;IAC3DC,KAAK,EAAE;EACT,CAAC;EACDK,KAAK,EAAE;IACLP,YAAY,EAAE,KAAK;IACnBC,YAAY,EAAE,yCAAyC;IACvDC,KAAK,EAAE;EACT;AACF,CAAC;;AAED;AACA;AACA;AACA,OAAO,MAAMF,YAAY,GAAIQ,QAAgB,IAAc;EACzD,MAAMC,MAAM,GAAGX,oBAAoB,CAACU,QAAQ,CAAC;EAC7C,OAAO,CAAAC,MAAM,aAANA,MAAM,uBAANA,MAAM,CAAET,YAAY,KAAI,KAAK;AACtC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KAAK,CAAC;IAC/D,MAAMA,KAAK;EACb;AACF,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,OAAO,MAAME,kBAAkB,GAAG,MAAO9B,QAAgB,IAAuB;EAC9E,IAAI;IACF;IACA,IAAIA,QAAQ,KAAK,SAAS,EAAE;MAC1B;MACA;MACA6B,OAAO,CAACE,GAAG,CAAC,8CAA8C,CAAC;;MAE3D;MACA;MACA,OAAO,IAAI;IACb;IAEA,MAAM,IAAIxB,KAAK,CAAC,2CAA2CP,QAAQ,EAAE,CAAC;EACxE,CAAC,CAAC,OAAO4B,KAAK,EAAE;IACdC,OAAO,CAACD,KAAK,CAAC,oCAAoC5B,QAAQ,GAAG,EAAE4B,KAAK,CAAC;IACrE,MAAMA,KAAK;EACb;AACF,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMI,mBAAmB,GAAIL,GAAW,IAAoB;EACjE,IAAI;IACF;IACA,MAAMM,SAAS,GAAG,IAAIC,GAAG,CAACP,GAAG,CAAC;;IAE9B;IACA,OAAOM,SAAS,CAACE,YAAY,CAACC,GAAG,CAAC,MAAM,CAAC;EAC3C,CAAC,CAAC,OAAOR,KAAK,EAAE;IACdC,OAAO,CAACD,KAAK,CAAC,gCAAgC,EAAEA,KAAK,CAAC;IACtD,OAAO,IAAI;EACb;AACF,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMS,eAAe,GAAIV,GAAW,IAAc;EACvD;EACA,OAAOA,GAAG,CAACW,UAAU,CAAC,sBAAsB,CAAC;AAC/C,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TrainingModal.d.ts","sourceRoot":"","sources":["../../../src/components/TrainingModal.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"TrainingModal.d.ts","sourceRoot":"","sources":["../../../src/components/TrainingModal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAe1B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAInD,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAgFtD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UniversalOnboarding.d.ts","sourceRoot":"","sources":["../../../src/components/UniversalOnboarding.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAC;AA0BxE,OAAO,KAAK,EAAE,wBAAwB,EAAoB,MAAM,UAAU,CAAC;AAI3E,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,
|
|
1
|
+
{"version":3,"file":"UniversalOnboarding.d.ts","sourceRoot":"","sources":["../../../src/components/UniversalOnboarding.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAC;AA0BxE,OAAO,KAAK,EAAE,wBAAwB,EAAoB,MAAM,UAAU,CAAC;AAI3E,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CAgblE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OAuthWebView.d.ts","sourceRoot":"","sources":["../../../../src/components/onboarding/OAuthWebView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"OAuthWebView.d.ts","sourceRoot":"","sources":["../../../../src/components/onboarding/OAuthWebView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgC,MAAM,OAAO,CAAC;AAKrD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CA2HpD,CAAC"}
|
|
@@ -11,12 +11,13 @@ export declare const getAuthEndpoint: (platform: string) => string;
|
|
|
11
11
|
*/
|
|
12
12
|
export declare const getPlatformColor: (platform: string) => string;
|
|
13
13
|
/**
|
|
14
|
-
* Initiates the OAuth flow for a platform
|
|
14
|
+
* Initiates the OAuth flow for a platform
|
|
15
15
|
* @param platform The platform to authenticate with
|
|
16
|
-
* @param
|
|
17
|
-
* @
|
|
16
|
+
* @param username The username to associate with the authentication
|
|
17
|
+
* @param appName The app name to use for the OAuth session (optional)
|
|
18
|
+
* @returns A Promise that resolves to the OAuth URL to open in a WebView or null if using native SDK
|
|
18
19
|
*/
|
|
19
|
-
export declare const initiateOAuth: (platform: string,
|
|
20
|
+
export declare const initiateOAuth: (platform: string, username: string, appName?: string) => Promise<string | null>;
|
|
20
21
|
/**
|
|
21
22
|
* Initiates the native SDK authentication flow for a platform
|
|
22
23
|
* @param platform The platform to authenticate with
|
|
@@ -35,11 +36,4 @@ export declare const handleOAuthCallback: (url: string) => string | null;
|
|
|
35
36
|
* @returns True if the URL is an OAuth callback
|
|
36
37
|
*/
|
|
37
38
|
export declare const isOAuthCallback: (url: string) => boolean;
|
|
38
|
-
/**
|
|
39
|
-
* Detects if OAuth flow has completed successfully based on URL patterns
|
|
40
|
-
* @param url The current URL in the WebView
|
|
41
|
-
* @param platform The platform being authenticated
|
|
42
|
-
* @returns True if the OAuth flow has completed successfully
|
|
43
|
-
*/
|
|
44
|
-
export declare const isOAuthSuccess: (url: string, platform: string) => boolean;
|
|
45
39
|
//# sourceMappingURL=platformAuthService.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platformAuthService.d.ts","sourceRoot":"","sources":["../../../src/services/platformAuthService.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"platformAuthService.d.ts","sourceRoot":"","sources":["../../../src/services/platformAuthService.ts"],"names":[],"mappings":"AAyCA;;GAEG;AACH,eAAO,MAAM,YAAY,aAAc,MAAM,KAAG,OAG/C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,aAAc,MAAM,KAAG,MAGlD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,aAAc,MAAM,KAAG,MAGnD,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,aAAoB,MAAM,YAAY,MAAM,YAAY,MAAM,KAAG,QAAQ,MAAM,GAAG,IAAI,CAqF/G,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,aAAoB,MAAM,KAAG,QAAQ,OAAO,CAkB1E,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,QAAS,MAAM,KAAG,MAAM,GAAG,IAW1D,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,eAAe,QAAS,MAAM,KAAG,OAG7C,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import {
|
|
3
3
|
View,
|
|
4
4
|
Text,
|
|
@@ -10,9 +10,6 @@ import {
|
|
|
10
10
|
Animated,
|
|
11
11
|
TouchableWithoutFeedback,
|
|
12
12
|
SafeAreaView,
|
|
13
|
-
TextInput,
|
|
14
|
-
KeyboardAvoidingView,
|
|
15
|
-
Platform,
|
|
16
13
|
} from 'react-native';
|
|
17
14
|
import Icon from 'react-native-vector-icons/MaterialIcons';
|
|
18
15
|
import { COLORS } from '../constants';
|
|
@@ -20,18 +17,6 @@ import type { TrainingModalProps } from '../types';
|
|
|
20
17
|
|
|
21
18
|
const { width, height } = Dimensions.get('window');
|
|
22
19
|
|
|
23
|
-
// Dynamic training messages that appear during the process
|
|
24
|
-
const TRAINING_MESSAGES = [
|
|
25
|
-
"Loading your data...",
|
|
26
|
-
"Analyzing your digital footprint...",
|
|
27
|
-
"Your mind is very unique...",
|
|
28
|
-
"Creating your AI persona...",
|
|
29
|
-
"Building neural pathways...",
|
|
30
|
-
"Finalizing your digital twin...",
|
|
31
|
-
"Almost ready...",
|
|
32
|
-
"Training complete!"
|
|
33
|
-
];
|
|
34
|
-
|
|
35
20
|
export const TrainingModal: React.FC<TrainingModalProps> = ({
|
|
36
21
|
visible,
|
|
37
22
|
progress,
|
|
@@ -41,47 +26,8 @@ export const TrainingModal: React.FC<TrainingModalProps> = ({
|
|
|
41
26
|
modelKey,
|
|
42
27
|
username,
|
|
43
28
|
}) => {
|
|
44
|
-
const [email, setEmail] = useState<string>('');
|
|
45
|
-
const [showEmailInput, setShowEmailInput] = useState<boolean>(false);
|
|
46
|
-
const [currentMessage, setCurrentMessage] = useState<string>(TRAINING_MESSAGES[0]);
|
|
47
|
-
const [messageIndex, setMessageIndex] = useState<number>(0);
|
|
48
|
-
|
|
49
29
|
const progressPercentage = Math.round(progress * 100);
|
|
50
30
|
|
|
51
|
-
// Update training message based on progress
|
|
52
|
-
useEffect(() => {
|
|
53
|
-
if (progress > 0) {
|
|
54
|
-
const newIndex = Math.min(
|
|
55
|
-
Math.floor(progress * TRAINING_MESSAGES.length),
|
|
56
|
-
TRAINING_MESSAGES.length - 1
|
|
57
|
-
);
|
|
58
|
-
|
|
59
|
-
if (newIndex !== messageIndex) {
|
|
60
|
-
setMessageIndex(newIndex);
|
|
61
|
-
setCurrentMessage(TRAINING_MESSAGES[newIndex]);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
}, [progress, messageIndex]);
|
|
65
|
-
|
|
66
|
-
// Show email input when training is complete
|
|
67
|
-
useEffect(() => {
|
|
68
|
-
if (progress >= 1 && !showEmailInput) {
|
|
69
|
-
setShowEmailInput(true);
|
|
70
|
-
}
|
|
71
|
-
}, [progress, showEmailInput]);
|
|
72
|
-
|
|
73
|
-
const handleEmailSubmit = () => {
|
|
74
|
-
if (email.trim() && onComplete) {
|
|
75
|
-
// Pass email data to the completion handler
|
|
76
|
-
onComplete();
|
|
77
|
-
}
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
const isValidEmail = (email: string): boolean => {
|
|
81
|
-
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
82
|
-
return emailRegex.test(email);
|
|
83
|
-
};
|
|
84
|
-
|
|
85
31
|
return (
|
|
86
32
|
<Modal
|
|
87
33
|
visible={visible}
|
|
@@ -90,119 +36,65 @@ export const TrainingModal: React.FC<TrainingModalProps> = ({
|
|
|
90
36
|
statusBarTranslucent
|
|
91
37
|
onRequestClose={onCancel}
|
|
92
38
|
>
|
|
93
|
-
<
|
|
94
|
-
style={styles.modalOverlay}
|
|
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
|
-
styles.progressFill,
|
|
122
|
-
{ width: `${progressPercentage}%` },
|
|
123
|
-
]}
|
|
124
|
-
/>
|
|
125
|
-
</View>
|
|
126
|
-
<Text style={styles.progressText}>{progressPercentage}%</Text>
|
|
127
|
-
</View>
|
|
128
|
-
|
|
129
|
-
<Text style={styles.etaText}>Estimated time remaining: {eta}</Text>
|
|
130
|
-
|
|
131
|
-
<View style={styles.loadingContainer}>
|
|
132
|
-
<ActivityIndicator size="small" color={COLORS.primary} />
|
|
133
|
-
<Text style={styles.loadingText}>{currentMessage}</Text>
|
|
134
|
-
</View>
|
|
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>
|
|
135
67
|
|
|
136
|
-
|
|
137
|
-
<TouchableOpacity
|
|
138
|
-
style={styles.cancelButton}
|
|
139
|
-
onPress={onCancel}
|
|
140
|
-
>
|
|
141
|
-
<Text style={styles.cancelButtonText}>Cancel</Text>
|
|
142
|
-
</TouchableOpacity>
|
|
143
|
-
</View>
|
|
144
|
-
</>
|
|
145
|
-
) : (
|
|
146
|
-
<>
|
|
147
|
-
{/* Training complete - Email input */}
|
|
148
|
-
<Icon name="check_circle" size={48} color="#4CAF50" />
|
|
149
|
-
|
|
150
|
-
<Text style={styles.title}>Training Complete!</Text>
|
|
151
|
-
<Text style={styles.subtitle}>
|
|
152
|
-
Your AI model is ready. Enter your email to receive your account details and access your digital twin.
|
|
153
|
-
</Text>
|
|
68
|
+
<Text style={styles.etaText}>Estimated time remaining: {eta}</Text>
|
|
154
69
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
placeholder="Enter your email address"
|
|
160
|
-
placeholderTextColor="#999"
|
|
161
|
-
value={email}
|
|
162
|
-
onChangeText={setEmail}
|
|
163
|
-
keyboardType="email-address"
|
|
164
|
-
autoCapitalize="none"
|
|
165
|
-
autoCorrect={false}
|
|
166
|
-
autoComplete="email"
|
|
167
|
-
/>
|
|
168
|
-
<Text style={styles.emailHint}>
|
|
169
|
-
We'll send you login credentials and access to your AI persona
|
|
170
|
-
</Text>
|
|
171
|
-
</View>
|
|
70
|
+
<View style={styles.loadingContainer}>
|
|
71
|
+
<ActivityIndicator size="small" color={COLORS.primary} />
|
|
72
|
+
<Text style={styles.loadingText}>Processing your data...</Text>
|
|
73
|
+
</View>
|
|
172
74
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
>
|
|
189
|
-
<Text style={[
|
|
190
|
-
styles.completeButtonText,
|
|
191
|
-
!isValidEmail(email) && styles.completeButtonTextDisabled
|
|
192
|
-
]}>
|
|
193
|
-
Complete Setup
|
|
194
|
-
</Text>
|
|
195
|
-
</TouchableOpacity>
|
|
196
|
-
</View>
|
|
197
|
-
</>
|
|
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>
|
|
198
90
|
)}
|
|
199
91
|
</View>
|
|
200
|
-
</
|
|
201
|
-
</
|
|
202
|
-
</
|
|
203
|
-
</
|
|
204
|
-
</
|
|
205
|
-
</
|
|
92
|
+
</View>
|
|
93
|
+
</SafeAreaView>
|
|
94
|
+
</View>
|
|
95
|
+
</TouchableWithoutFeedback>
|
|
96
|
+
</View>
|
|
97
|
+
</TouchableWithoutFeedback>
|
|
206
98
|
</Modal>
|
|
207
99
|
);
|
|
208
100
|
};
|
|
@@ -217,7 +109,7 @@ const styles = StyleSheet.create({
|
|
|
217
109
|
bottomSheet: {
|
|
218
110
|
backgroundColor: '#fff',
|
|
219
111
|
width: width,
|
|
220
|
-
height: height * 0.
|
|
112
|
+
height: height * 0.6,
|
|
221
113
|
borderTopLeftRadius: 24,
|
|
222
114
|
borderTopRightRadius: 24,
|
|
223
115
|
overflow: 'hidden',
|
|
@@ -258,7 +150,6 @@ const styles = StyleSheet.create({
|
|
|
258
150
|
color: COLORS.text.secondary,
|
|
259
151
|
textAlign: 'center',
|
|
260
152
|
marginBottom: 32,
|
|
261
|
-
lineHeight: 22,
|
|
262
153
|
},
|
|
263
154
|
progressContainer: {
|
|
264
155
|
width: '100%',
|
|
@@ -292,37 +183,9 @@ const styles = StyleSheet.create({
|
|
|
292
183
|
marginBottom: 32,
|
|
293
184
|
},
|
|
294
185
|
loadingText: {
|
|
295
|
-
fontSize: 16,
|
|
296
|
-
color: COLORS.text.primary,
|
|
297
|
-
marginLeft: 12,
|
|
298
|
-
fontWeight: '500',
|
|
299
|
-
},
|
|
300
|
-
emailContainer: {
|
|
301
|
-
width: '100%',
|
|
302
|
-
marginBottom: 32,
|
|
303
|
-
},
|
|
304
|
-
emailLabel: {
|
|
305
|
-
fontSize: 16,
|
|
306
|
-
fontWeight: '600',
|
|
307
|
-
color: COLORS.text.primary,
|
|
308
|
-
marginBottom: 8,
|
|
309
|
-
},
|
|
310
|
-
emailInput: {
|
|
311
|
-
width: '100%',
|
|
312
|
-
height: 48,
|
|
313
|
-
borderWidth: 1,
|
|
314
|
-
borderColor: '#E0E0E0',
|
|
315
|
-
borderRadius: 12,
|
|
316
|
-
paddingHorizontal: 16,
|
|
317
|
-
fontSize: 16,
|
|
318
|
-
color: COLORS.text.primary,
|
|
319
|
-
backgroundColor: '#F8F8F8',
|
|
320
|
-
},
|
|
321
|
-
emailHint: {
|
|
322
186
|
fontSize: 14,
|
|
323
187
|
color: COLORS.text.secondary,
|
|
324
|
-
|
|
325
|
-
textAlign: 'center',
|
|
188
|
+
marginLeft: 8,
|
|
326
189
|
},
|
|
327
190
|
footer: {
|
|
328
191
|
flexDirection: 'row',
|
|
@@ -347,17 +210,13 @@ const styles = StyleSheet.create({
|
|
|
347
210
|
paddingVertical: 16,
|
|
348
211
|
paddingHorizontal: 32,
|
|
349
212
|
borderRadius: 16,
|
|
350
|
-
backgroundColor: '#
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
backgroundColor: '#E0E0E0',
|
|
213
|
+
backgroundColor: '#fff',
|
|
214
|
+
borderWidth: 1,
|
|
215
|
+
borderColor: '#000',
|
|
354
216
|
},
|
|
355
217
|
completeButtonText: {
|
|
356
218
|
fontSize: 16,
|
|
357
219
|
fontWeight: '600',
|
|
358
|
-
color: '#
|
|
359
|
-
},
|
|
360
|
-
completeButtonTextDisabled: {
|
|
361
|
-
color: '#999',
|
|
220
|
+
color: '#000',
|
|
362
221
|
},
|
|
363
222
|
});
|