upd: tampilan

Deskripsi:
- toast
- firebase

No Issues
This commit is contained in:
2025-07-28 17:56:42 +08:00
parent 8a085ced45
commit 86a80213ca
10 changed files with 69 additions and 28 deletions

View File

@@ -2,11 +2,13 @@ import Styles from "@/constants/Styles"
import { apiCheckPhoneLogin, apiSendOtp } from "@/lib/api"
import AsyncStorage from "@react-native-async-storage/async-storage"
import { useState } from "react"
import { Image, SafeAreaView, ToastAndroid, View } from "react-native"
import { Image, SafeAreaView, View } from "react-native"
import Toast from "react-native-toast-message"
import { ButtonForm } from "../buttonForm"
import { InputForm } from "../inputForm"
import ModalLoading from "../modalLoading"
import Text from "../Text"
import ToastCustom from "../toastCustom"
type Props = {
@@ -31,10 +33,9 @@ export default function ViewLogin({ onValidate }: Props) {
return onValidate({ phone: `62${phone}`, otp })
}
}
return ToastAndroid.show(response.message, ToastAndroid.SHORT)
return Toast.show({ type: 'small', text1: response.message, })
} catch (error) {
console.error('Error fetching data:', error);
return ToastAndroid.show(`Terjadi kesalahan ${error}`, ToastAndroid.SHORT)
return Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
} finally {
setLoadingLogin(false)
}
@@ -42,6 +43,7 @@ export default function ViewLogin({ onValidate }: Props) {
return (
<SafeAreaView>
<ToastCustom />
<View style={Styles.p20}>
<View style={{ alignItems: "center", marginVertical: 50 }}>
<Image