From 121caf3f3be5dcdd9b5b6f32a9785b3992ef53d5 Mon Sep 17 00:00:00 2001 From: Biswakalyan Bhuyan Date: Wed, 16 Oct 2024 18:35:51 +0530 Subject: Added more navigation in SignUpScreen and in ForgotPasswordScreen --- src/screens/Auth/SignupScreen.js | 57 ++++++++++++++++++++++++++++++++++------ 1 file changed, 49 insertions(+), 8 deletions(-) (limited to 'src/screens/Auth/SignupScreen.js') diff --git a/src/screens/Auth/SignupScreen.js b/src/screens/Auth/SignupScreen.js index 6e6ac53..6ba1402 100644 --- a/src/screens/Auth/SignupScreen.js +++ b/src/screens/Auth/SignupScreen.js @@ -1,6 +1,5 @@ import React, { useState } from 'react'; -import { View, TextInput, Button, Text } from 'react-native'; -import { resetPassword } from '../../services/authService'; +import { View, TextInput, Button, Text, StyleSheet, Alert } from 'react-native'; import emailService from '../../services/emailService'; const SignupScreen = ({ navigation }) => { @@ -8,24 +7,66 @@ const SignupScreen = ({ navigation }) => { const [password, setPassword] = useState(''); const handleSignup = async () => { - // Implement user creation logic here or call the backend try { // Trigger OTP email using custom email service await emailService.sendOtp(email); - alert('OTP sent to your email'); - navigation.navigate('Login'); + Alert.alert('Success', 'OTP sent to your email'); + navigation.navigate('Login'); // Navigate to Login after sending OTP } catch (error) { console.error('Signup error:', error); + Alert.alert('Error', 'There was an error sending the OTP. Please try again.'); } }; return ( - - - + + Sign Up + +