react-native-srschat 0.1.83 → 0.1.85
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/email.js +5 -9
- package/lib/commonjs/components/email.js.map +1 -1
- package/lib/commonjs/components/productCard.js +91 -86
- package/lib/commonjs/components/productCard.js.map +1 -1
- package/lib/commonjs/components/welcomeButton.js +4 -4
- package/lib/commonjs/components/welcomeButton.js.map +1 -1
- package/lib/commonjs/contexts/AppContext.js +46 -45
- package/lib/commonjs/contexts/AppContext.js.map +1 -1
- package/lib/commonjs/hooks/Stream.js +399 -74
- package/lib/commonjs/hooks/Stream.js.map +1 -1
- package/lib/commonjs/layout/disclaimer.js +36 -32
- package/lib/commonjs/layout/disclaimer.js.map +1 -1
- package/lib/commonjs/layout/welcome.js +8 -7
- package/lib/commonjs/layout/welcome.js.map +1 -1
- package/lib/commonjs/layout/window.js +152 -131
- package/lib/commonjs/layout/window.js.map +1 -1
- package/lib/commonjs/utils/audioRecorder.js.map +1 -1
- package/lib/commonjs/utils/storage.js +1 -1
- package/lib/module/components/email.js +5 -9
- package/lib/module/components/email.js.map +1 -1
- package/lib/module/components/productCard.js +94 -89
- package/lib/module/components/productCard.js.map +1 -1
- package/lib/module/components/welcomeButton.js +4 -4
- package/lib/module/components/welcomeButton.js.map +1 -1
- package/lib/module/contexts/AppContext.js +47 -46
- package/lib/module/contexts/AppContext.js.map +1 -1
- package/lib/module/hooks/Stream.js +400 -75
- package/lib/module/hooks/Stream.js.map +1 -1
- package/lib/module/layout/disclaimer.js +41 -37
- package/lib/module/layout/disclaimer.js.map +1 -1
- package/lib/module/layout/welcome.js +8 -7
- package/lib/module/layout/welcome.js.map +1 -1
- package/lib/module/layout/window.js +152 -131
- package/lib/module/layout/window.js.map +1 -1
- package/lib/module/utils/audioRecorder.js.map +1 -1
- package/lib/module/utils/storage.js +1 -1
- package/lib/typescript/components/email.d.ts.map +1 -1
- package/lib/typescript/components/productCard.d.ts +1 -1
- package/lib/typescript/components/productCard.d.ts.map +1 -1
- package/lib/typescript/components/welcomeButton.d.ts.map +1 -1
- package/lib/typescript/contexts/AppContext.d.ts +2 -2
- package/lib/typescript/contexts/AppContext.d.ts.map +1 -1
- package/lib/typescript/hooks/Stream.d.ts.map +1 -1
- package/lib/typescript/layout/disclaimer.d.ts +1 -1
- package/lib/typescript/layout/disclaimer.d.ts.map +1 -1
- package/lib/typescript/layout/welcome.d.ts.map +1 -1
- package/lib/typescript/layout/window.d.ts.map +1 -1
- package/lib/typescript/utils/audioRecorder.d.ts.map +1 -1
- package/package.json +2 -1
- package/src/components/email.js +4 -16
- package/src/components/productCard.js +279 -203
- package/src/components/welcomeButton.js +10 -10
- package/src/contexts/AppContext.js +185 -106
- package/src/hooks/Stream.js +607 -237
- package/src/layout/disclaimer.js +125 -78
- package/src/layout/welcome.js +58 -20
- package/src/layout/window.js +279 -140
- package/src/utils/audioRecorder.js +40 -34
- package/src/utils/storage.ts +2 -2
package/src/components/email.js
CHANGED
|
@@ -215,9 +215,8 @@ export const EmailForm = ({ panHandlers }) => {
|
|
|
215
215
|
return;
|
|
216
216
|
}
|
|
217
217
|
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
setError(emailValidationError);
|
|
218
|
+
if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(userEmail)) {
|
|
219
|
+
setError("Please enter a valid email address");
|
|
221
220
|
return;
|
|
222
221
|
}
|
|
223
222
|
|
|
@@ -312,7 +311,7 @@ export const EmailForm = ({ panHandlers }) => {
|
|
|
312
311
|
if (emailValidationError) {
|
|
313
312
|
setError(emailValidationError);
|
|
314
313
|
setSuccess(false);
|
|
315
|
-
} else {
|
|
314
|
+
} else if (error === "Please enter a valid email address" || error === "Email address is required") {
|
|
316
315
|
setError("");
|
|
317
316
|
}
|
|
318
317
|
}}
|
|
@@ -371,15 +370,7 @@ export const EmailForm = ({ panHandlers }) => {
|
|
|
371
370
|
{error ? <Text style={styles.errorText}>{error}</Text> : null}
|
|
372
371
|
{success ? <Text style={styles.successText}>Email sent successfully!</Text> : null}
|
|
373
372
|
|
|
374
|
-
<TouchableOpacity
|
|
375
|
-
style={[
|
|
376
|
-
styles.sendButton,
|
|
377
|
-
{ backgroundColor: theme.primaryColor },
|
|
378
|
-
(isLoading || error || !userEmail.trim() || !subject.trim() || !message.trim()) && styles.disabledButton
|
|
379
|
-
]}
|
|
380
|
-
onPress={handleSubmit}
|
|
381
|
-
disabled={isLoading || error || !userEmail.trim() || !subject.trim() || !message.trim()}
|
|
382
|
-
>
|
|
373
|
+
<TouchableOpacity style={[styles.sendButton, { backgroundColor: theme.primaryColor }]} onPress={handleSubmit} disabled={isLoading}>
|
|
383
374
|
{isLoading ? <ActivityIndicator size="small" color="#FFFFFF" /> : <Text style={styles.buttonText}>Send Email</Text>}
|
|
384
375
|
</TouchableOpacity>
|
|
385
376
|
</KeyboardAwareScrollView>
|
|
@@ -471,9 +462,6 @@ const styles = StyleSheet.create({
|
|
|
471
462
|
textAlign: "center",
|
|
472
463
|
marginTop: 10,
|
|
473
464
|
},
|
|
474
|
-
disabledButton: {
|
|
475
|
-
opacity: 0.5,
|
|
476
|
-
},
|
|
477
465
|
});
|
|
478
466
|
|
|
479
467
|
export default EmailForm;
|