fix : toast

Deskripsi:
- bisa custom posisi toast alert

No Issues
This commit is contained in:
2025-08-27 11:39:46 +08:00
parent 2651e4bd18
commit c01a1885c2
4 changed files with 6 additions and 8 deletions

View File

@@ -28,14 +28,13 @@ export default function ViewLogin({ onValidate }: Props) {
const otp = Math.floor(1000 + Math.random() * 9000)
const responseOtp = await apiSendOtp({ phone: `62${phone}`, otp })
if (responseOtp == 200) {
// localStorage.setItem('user', response.id)
await AsyncStorage.setItem('user', response.id);
return onValidate({ phone: `62${phone}`, otp })
}
}
return Toast.show({ type: 'small', text1: response.message, })
return Toast.show({ type: 'small', text1: response.message, position: 'top' })
} catch (error) {
return Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
return Toast.show({ type: 'small', text1: 'Terjadi kesalahan', position: 'top' })
} finally {
setLoadingLogin(false)
}

View File

@@ -27,7 +27,7 @@ export default function ViewVerification({ phone, otp }: Props) {
const encrypted = await encryptToken(valueUser);
signIn(encrypted);
} else {
return Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
return Toast.show({ type: 'small', text1: 'Terjadi kesalahan', position: 'top' })
}
}
@@ -35,7 +35,7 @@ export default function ViewVerification({ phone, otp }: Props) {
if (value === otpFix.toString()) {
login()
} else {
return Toast.show({ type: 'small', text1: 'Kode OTP tidak sesuai' });
return Toast.show({ type: 'small', text1: 'Kode OTP tidak sesuai', position: 'top' });
}
}