upd: tampilan
Deskripsi: - toast - firebase No Issues
This commit is contained in:
@@ -3,10 +3,12 @@ import { apiSendOtp } from "@/lib/api";
|
||||
import { useAuthSession } from "@/providers/AuthProvider";
|
||||
import AsyncStorage from "@react-native-async-storage/async-storage";
|
||||
import { useState } from "react";
|
||||
import { Image, ToastAndroid, View } from "react-native";
|
||||
import { Image, View } from "react-native";
|
||||
import { OtpInput } from "react-native-otp-entry";
|
||||
import Toast from 'react-native-toast-message';
|
||||
import { ButtonForm } from "../buttonForm";
|
||||
import Text from "../Text";
|
||||
import ToastCustom from "../toastCustom";
|
||||
|
||||
type Props = {
|
||||
phone: string
|
||||
@@ -25,7 +27,7 @@ export default function ViewVerification({ phone, otp }: Props) {
|
||||
const encrypted = await encryptToken(valueUser);
|
||||
signIn(encrypted);
|
||||
} else {
|
||||
return ToastAndroid.show('Terjadi kesalahan', ToastAndroid.SHORT)
|
||||
return Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +35,7 @@ export default function ViewVerification({ phone, otp }: Props) {
|
||||
if (value === otpFix.toString()) {
|
||||
login()
|
||||
} else {
|
||||
return ToastAndroid.show('Kode OTP tidak sesuai', ToastAndroid.SHORT)
|
||||
return Toast.show({ type: 'error', text1: 'Kode OTP tidak sesuai' });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,17 +45,18 @@ export default function ViewVerification({ phone, otp }: Props) {
|
||||
setOtpFix(otpNew)
|
||||
const responseOtp = await apiSendOtp({ phone, otp: otpNew })
|
||||
if (responseOtp == 200) {
|
||||
return ToastAndroid.show('Kode OTP berhasil dikirim ulang', ToastAndroid.SHORT)
|
||||
return Toast.show({ type: 'small', text1: 'Kode OTP berhasil dikirim ulang', })
|
||||
}
|
||||
return ToastAndroid.show('Terjadi kesalahan dalam mengirim kode OTP', ToastAndroid.SHORT)
|
||||
return Toast.show({ type: 'small', text1: 'Terjadi kesalahan dalam mengirim kode OTP', })
|
||||
} catch (error) {
|
||||
console.error('Error fetching data:', error);
|
||||
return ToastAndroid.show('Terjadi kesalahan', ToastAndroid.SHORT)
|
||||
return Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<ToastCustom />
|
||||
<View style={Styles.wrapLogin} >
|
||||
<View style={{ alignItems: "center", marginVertical: 50 }}>
|
||||
<Image
|
||||
|
||||
Reference in New Issue
Block a user