noboarding 1.0.7 → 1.0.8
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/OnboardingFlow.js +4 -1
- package/lib/types.d.ts +1 -0
- package/package.json +1 -1
- package/src/OnboardingFlow.tsx +4 -0
- package/src/types.ts +1 -0
package/lib/OnboardingFlow.js
CHANGED
|
@@ -74,7 +74,7 @@ const detectEnvironment = () => {
|
|
|
74
74
|
return 'test';
|
|
75
75
|
return 'production';
|
|
76
76
|
};
|
|
77
|
-
const OnboardingFlow = ({ apiKey, testKey, productionKey, onComplete, onSkip, baseUrl, initialVariables, customComponents, onUserIdGenerated, }) => {
|
|
77
|
+
const OnboardingFlow = ({ apiKey, testKey, productionKey, onComplete, onSkip, baseUrl, initialVariables, customComponents, onUserIdGenerated, loadingComponent, }) => {
|
|
78
78
|
// Determine which API key to use
|
|
79
79
|
const getApiKey = () => {
|
|
80
80
|
// If dual keys provided, use environment detection
|
|
@@ -268,6 +268,9 @@ const OnboardingFlow = ({ apiKey, testKey, productionKey, onComplete, onSkip, ba
|
|
|
268
268
|
}
|
|
269
269
|
};
|
|
270
270
|
if (loading) {
|
|
271
|
+
if (loadingComponent) {
|
|
272
|
+
return <>{loadingComponent}</>;
|
|
273
|
+
}
|
|
271
274
|
return (<react_native_1.View style={styles.centerContainer}>
|
|
272
275
|
<react_native_1.ActivityIndicator size="large" color="#007AFF"/>
|
|
273
276
|
<react_native_1.Text style={styles.loadingText}>Loading...</react_native_1.Text>
|
package/lib/types.d.ts
CHANGED
package/package.json
CHANGED
package/src/OnboardingFlow.tsx
CHANGED
|
@@ -51,6 +51,7 @@ export const OnboardingFlow: React.FC<OnboardingFlowProps> = ({
|
|
|
51
51
|
initialVariables,
|
|
52
52
|
customComponents,
|
|
53
53
|
onUserIdGenerated,
|
|
54
|
+
loadingComponent,
|
|
54
55
|
}) => {
|
|
55
56
|
// Determine which API key to use
|
|
56
57
|
const getApiKey = (): string => {
|
|
@@ -285,6 +286,9 @@ export const OnboardingFlow: React.FC<OnboardingFlowProps> = ({
|
|
|
285
286
|
};
|
|
286
287
|
|
|
287
288
|
if (loading) {
|
|
289
|
+
if (loadingComponent) {
|
|
290
|
+
return <>{loadingComponent}</>;
|
|
291
|
+
}
|
|
288
292
|
return (
|
|
289
293
|
<View style={styles.centerContainer}>
|
|
290
294
|
<ActivityIndicator size="large" color="#007AFF" />
|
package/src/types.ts
CHANGED
|
@@ -300,4 +300,5 @@ export interface OnboardingFlowProps {
|
|
|
300
300
|
initialVariables?: Record<string, any>; // seed the variable store
|
|
301
301
|
customComponents?: Record<string, React.ComponentType<CustomScreenProps>>;
|
|
302
302
|
onUserIdGenerated?: (userId: string) => void; // Called when user ID is generated for analytics
|
|
303
|
+
loadingComponent?: React.ReactNode; // Custom loading UI shown while fetching flow config
|
|
303
304
|
}
|