-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d1a04c7
commit c1d7aec
Showing
60 changed files
with
265 additions
and
63 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file added
BIN
+134 Bytes
...res/drawable-hdpi/node_modules_reactnavigation_elements_src_assets_backicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+100 Bytes
...res/drawable-mdpi/node_modules_reactnavigation_elements_src_assets_backicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+913 Bytes
...drawable-mdpi/node_modules_reactnavigation_elements_src_assets_backiconmask.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.82 KB
android/app/src/main/res/drawable-mdpi/src_assets_app_images_amazonpay.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.38 KB
android/app/src/main/res/drawable-mdpi/src_assets_app_images_applepay.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+15.9 KB
android/app/src/main/res/drawable-mdpi/src_assets_app_images_avatar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+4.28 KB
android/app/src/main/res/drawable-mdpi/src_assets_app_images_gpay.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+524 KB
...e-mdpi/src_assets_coffee_assets_americano_portrait_americano_pic_1_portrait.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+267 KB
...e-mdpi/src_assets_coffee_assets_americano_portrait_americano_pic_2_portrait.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+266 KB
...e-mdpi/src_assets_coffee_assets_americano_portrait_americano_pic_3_portrait.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+93.9 KB
...wable-mdpi/src_assets_coffee_assets_americano_square_americano_pic_1_square.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+60.4 KB
...wable-mdpi/src_assets_coffee_assets_americano_square_americano_pic_2_square.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+63.3 KB
...wable-mdpi/src_assets_coffee_assets_americano_square_americano_pic_3_square.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.34 MB
...src_assets_coffee_assets_arabica_coffee_beans_arabica_coffee_beans_portrait.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+104 KB
...i/src_assets_coffee_assets_arabica_coffee_beans_arabica_coffee_beans_square.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+326 KB
.../src_assets_coffee_assets_black_coffee_portrait_black_coffee_pic_1_portrait.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+244 KB
.../src_assets_coffee_assets_black_coffee_portrait_black_coffee_pic_2_portrait.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+391 KB
.../src_assets_coffee_assets_black_coffee_portrait_black_coffee_pic_3_portrait.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+62 KB
...mdpi/src_assets_coffee_assets_black_coffee_square_black_coffee_pic_1_square.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+59.5 KB
...mdpi/src_assets_coffee_assets_black_coffee_square_black_coffee_pic_2_square.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+77.5 KB
...mdpi/src_assets_coffee_assets_black_coffee_square_black_coffee_pic_3_square.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+274 KB
...mdpi/src_assets_coffee_assets_cappuccino_portrait_cappuccino_pic_1_portrait.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+356 KB
...mdpi/src_assets_coffee_assets_cappuccino_portrait_cappuccino_pic_2_portrait.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+339 KB
...mdpi/src_assets_coffee_assets_cappuccino_portrait_cappuccino_pic_3_portrait.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+59.7 KB
...ble-mdpi/src_assets_coffee_assets_cappuccino_square_cappuccino_pic_1_square.png
Oops, something went wrong.
Binary file added
BIN
+75.5 KB
...ble-mdpi/src_assets_coffee_assets_cappuccino_square_cappuccino_pic_2_square.png
Oops, something went wrong.
Binary file added
BIN
+67.7 KB
...ble-mdpi/src_assets_coffee_assets_cappuccino_square_cappuccino_pic_3_square.png
Oops, something went wrong.
Binary file added
BIN
+369 KB
...ble-mdpi/src_assets_coffee_assets_espresso_portrait_espresso_pic_1_portrait.png
Oops, something went wrong.
Binary file added
BIN
+377 KB
...ble-mdpi/src_assets_coffee_assets_espresso_portrait_espresso_pic_2_portrait.png
Oops, something went wrong.
Binary file added
BIN
+475 KB
...ble-mdpi/src_assets_coffee_assets_espresso_portrait_espresso_pic_3_portrait.png
Oops, something went wrong.
Binary file added
BIN
+63.1 KB
...rawable-mdpi/src_assets_coffee_assets_espresso_square_espresso_pic_1_square.png
Oops, something went wrong.
Binary file added
BIN
+64 KB
...rawable-mdpi/src_assets_coffee_assets_espresso_square_espresso_pic_2_square.png
Oops, something went wrong.
Binary file added
BIN
+78.1 KB
...rawable-mdpi/src_assets_coffee_assets_espresso_square_espresso_pic_3_square.png
Oops, something went wrong.
Binary file added
BIN
+1.25 MB
...src_assets_coffee_assets_excelsa_coffee_beans_excelsa_coffee_beans_portrait.png
Oops, something went wrong.
Binary file added
BIN
+97 KB
...i/src_assets_coffee_assets_excelsa_coffee_beans_excelsa_coffee_beans_square.png
Oops, something went wrong.
Binary file added
BIN
+353 KB
.../drawable-mdpi/src_assets_coffee_assets_latte_portrait_latte_pic_1_portrait.png
Oops, something went wrong.
Binary file added
BIN
+309 KB
.../drawable-mdpi/src_assets_coffee_assets_latte_portrait_latte_pic_2_portrait.png
Oops, something went wrong.
Binary file added
BIN
+322 KB
.../drawable-mdpi/src_assets_coffee_assets_latte_portrait_latte_pic_3_portrait.png
Oops, something went wrong.
Binary file added
BIN
+68.1 KB
.../res/drawable-mdpi/src_assets_coffee_assets_latte_square_latte_pic_1_square.png
Oops, something went wrong.
Binary file added
BIN
+58.2 KB
.../res/drawable-mdpi/src_assets_coffee_assets_latte_square_latte_pic_2_square.png
Oops, something went wrong.
Binary file added
BIN
+59.5 KB
.../res/drawable-mdpi/src_assets_coffee_assets_latte_square_latte_pic_3_square.png
Oops, something went wrong.
Binary file added
BIN
+1.28 MB
...c_assets_coffee_assets_liberica_coffee_beans_liberica_coffee_beans_portrait.png
Oops, something went wrong.
Binary file added
BIN
+94.5 KB
...src_assets_coffee_assets_liberica_coffee_beans_liberica_coffee_beans_square.png
Oops, something went wrong.
Binary file added
BIN
+348 KB
...e-mdpi/src_assets_coffee_assets_macchiato_portrait_macchiato_pic_1_portrait.png
Oops, something went wrong.
Binary file added
BIN
+420 KB
...e-mdpi/src_assets_coffee_assets_macchiato_portrait_macchiato_pic_2_portrait.png
Oops, something went wrong.
Binary file added
BIN
+367 KB
...e-mdpi/src_assets_coffee_assets_macchiato_portrait_macchiato_pic_3_portrait.png
Oops, something went wrong.
Binary file added
BIN
+77.1 KB
...wable-mdpi/src_assets_coffee_assets_macchiato_square_macchiato_pic_1_square.png
Oops, something went wrong.
Binary file added
BIN
+84.1 KB
...wable-mdpi/src_assets_coffee_assets_macchiato_square_macchiato_pic_2_square.png
Oops, something went wrong.
Binary file added
BIN
+76.1 KB
...wable-mdpi/src_assets_coffee_assets_macchiato_square_macchiato_pic_3_square.png
Oops, something went wrong.
Binary file added
BIN
+1.01 MB
...src_assets_coffee_assets_robusta_coffee_beans_robusta_coffee_beans_portrait.png
Oops, something went wrong.
Binary file added
BIN
+89.6 KB
...i/src_assets_coffee_assets_robusta_coffee_beans_robusta_coffee_beans_square.png
Oops, something went wrong.
Binary file added
BIN
+134 Bytes
...es/drawable-xhdpi/node_modules_reactnavigation_elements_src_assets_backicon.png
Oops, something went wrong.
Binary file added
BIN
+167 Bytes
...s/drawable-xxhdpi/node_modules_reactnavigation_elements_src_assets_backicon.png
Oops, something went wrong.
Binary file added
BIN
+207 Bytes
.../drawable-xxxhdpi/node_modules_reactnavigation_elements_src_assets_backicon.png
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,8 @@ import Ionicons from 'react-native-vector-icons/Ionicons' | |
import { Dimensions } from 'react-native' | ||
import OTPInputView from '@twotalltotems/react-native-otp-input' | ||
import emailSchema from '../validation/zod' | ||
import axios from 'axios' | ||
import AuthService from '../services' | ||
|
||
const windowHeight = Dimensions.get('window').height | ||
|
||
|
@@ -29,27 +31,38 @@ const AuthScreen = () => { | |
(state: any): any => state.userAuthentication, | ||
) | ||
const [mail, setMail] = useState('') | ||
const [validationMail, setValidationMail] = useState(false); | ||
const [code,setCode]=useState('') | ||
const [validationMail, setValidationMail] = useState(false) | ||
const [code, setCode] = useState('') | ||
const handleMailChange = (text: string) => { | ||
setMail(text) | ||
} | ||
|
||
const handleValidateEmail = () => { | ||
|
||
const handleValidateEmail = async () => { | ||
try { | ||
emailSchema.parse(mail); | ||
setValidationMail(true) | ||
const response = await AuthService.sendLoginOTP(mail); | ||
|
||
if (response.status === 200) { | ||
setValidationMail(true); | ||
} else { | ||
Alert.alert('Something Unwanted happened'); | ||
} | ||
} catch (error:any) { | ||
Alert.alert('Error', error.message || 'Something went wrong'); | ||
} | ||
}; | ||
const VerifyOtp = async () => { | ||
try { | ||
const response = await AuthService.verifyLoginOTP(mail, code); | ||
if (response.status === 200) { | ||
userAuthentication(); | ||
} else { | ||
Alert.alert('Wrong Otp'); | ||
} | ||
} catch (error) { | ||
Alert.alert('Error', 'Invalid email format'); | ||
Alert.alert('Something Went wrong'); | ||
} | ||
}; | ||
|
||
const VerifyOtp = () => { | ||
console.log(code); | ||
|
||
userAuthentication(); | ||
} | ||
return ( | ||
<View style={styles.ScreenContainer}> | ||
<StatusBar backgroundColor={COLORS.primaryBlackHex} /> | ||
|
@@ -60,20 +73,21 @@ const AuthScreen = () => { | |
/> | ||
<Text style={styles.Quote}>Keep calm and drink tea.</Text> | ||
<View style={styles.MailContainer}> | ||
{!validationMail ? <View style={styles.InputContainer}> | ||
<Ionicons | ||
name="mail" | ||
size={FONTSIZE.size_24} | ||
color={COLORS.secondaryLightGreyHex} | ||
/> | ||
<TextInput | ||
style={styles.mail} | ||
placeholder="[email protected]" | ||
onChangeText={handleMailChange} | ||
value={mail} | ||
/> | ||
</View> | ||
: | ||
{!validationMail ? ( | ||
<View style={styles.InputContainer}> | ||
<Ionicons | ||
name="mail" | ||
size={FONTSIZE.size_24} | ||
color={COLORS.secondaryLightGreyHex} | ||
/> | ||
<TextInput | ||
style={styles.mail} | ||
placeholder="[email protected]" | ||
onChangeText={handleMailChange} | ||
value={mail} | ||
/> | ||
</View> | ||
) : ( | ||
<> | ||
<Text style={styles.OtpText}>OTP sent to email.</Text> | ||
<OTPInputView | ||
|
@@ -82,28 +96,34 @@ const AuthScreen = () => { | |
autoFocusOnLoad | ||
codeInputFieldStyle={styles.underlineStyleBase} | ||
codeInputHighlightStyle={styles.underlineStyleHighLighted} | ||
onCodeFilled={(code => { | ||
onCodeFilled={(code) => { | ||
setCode(code) | ||
})} | ||
}} | ||
/> | ||
</> | ||
} | ||
{validationMail ? <TouchableOpacity | ||
onPress={VerifyOtp} | ||
> | ||
<View style={styles.AuthButton}> | ||
<Text style={styles.Authenticate}>Verify</Text> | ||
</View> | ||
</TouchableOpacity> : <TouchableOpacity | ||
onPress={handleValidateEmail} | ||
> | ||
<View style={styles.AuthButton}> | ||
<Text style={styles.Authenticate}>Continue</Text> | ||
</View> | ||
</TouchableOpacity>} | ||
{validationMail ? <TouchableOpacity onPress={() => { setValidationMail(false) }}> | ||
<Text style={styles.Back}>Back</Text> | ||
</TouchableOpacity> : null} | ||
)} | ||
{validationMail ? ( | ||
<TouchableOpacity onPress={VerifyOtp}> | ||
<View style={styles.AuthButton}> | ||
<Text style={styles.Authenticate}>Verify</Text> | ||
</View> | ||
</TouchableOpacity> | ||
) : ( | ||
<TouchableOpacity onPress={handleValidateEmail}> | ||
<View style={styles.AuthButton}> | ||
<Text style={styles.Authenticate}>Continue</Text> | ||
</View> | ||
</TouchableOpacity> | ||
)} | ||
{validationMail ? ( | ||
<TouchableOpacity | ||
onPress={() => { | ||
setValidationMail(false) | ||
}} | ||
> | ||
<Text style={styles.Back}>Back</Text> | ||
</TouchableOpacity> | ||
) : null} | ||
</View> | ||
</View> | ||
</View> | ||
|
@@ -183,10 +203,10 @@ const styles = StyleSheet.create({ | |
color: COLORS.primaryWhiteHex, | ||
fontSize: FONTSIZE.size_12, | ||
fontFamily: FONTFAMILY.poppins_extrabold, | ||
textAlign: 'center' | ||
textAlign: 'center', | ||
}, | ||
borderStyleHighLighted: { | ||
borderColor: "#03DAC6", | ||
borderColor: '#03DAC6', | ||
}, | ||
underlineStyleBase: { | ||
width: 36, | ||
|
@@ -201,16 +221,16 @@ const styles = StyleSheet.create({ | |
shadowRadius: 4, | ||
backgroundColor: COLORS.primaryWhiteHex, | ||
borderRadius: BORDERRADIUS.radius_8, | ||
color: COLORS.primaryBlackHex | ||
color: COLORS.primaryBlackHex, | ||
}, | ||
underlineStyleHighLighted: { | ||
borderColor: "#03DAC6", | ||
borderColor: '#03DAC6', | ||
}, | ||
Back: { | ||
color: COLORS.primaryWhiteHex, | ||
fontSize: FONTSIZE.size_12, | ||
fontFamily: FONTFAMILY.poppins_extrabold, | ||
textAlign: 'center', | ||
textDecorationLine: 'underline' | ||
textDecorationLine: 'underline', | ||
}, | ||
}) |
Oops, something went wrong.