- context/
- hook/
- types/

### No Issue
This commit is contained in:
2025-08-19 15:25:07 +08:00
parent 1da4b00c2f
commit e1039a5744
10 changed files with 169 additions and 16 deletions

View File

@@ -129,8 +129,7 @@ export default function LoginView() {
Login
</ButtonCustom>
<Spacing />
{/* <ButtonCustom onPress={() => router.navigate("/admin/investment")}>
{/* <ButtonCustom onPress={() => router.navigate("/waiting-room")}>
Admin ( Delete Soon )
</ButtonCustom> */}
</View>

View File

@@ -11,10 +11,12 @@ import { OtpInput } from "react-native-otp-entry";
import Toast from "react-native-toast-message";
export default function VerificationView() {
const { kodeId } = useLocalSearchParams();
const { kodeId, nomor } = useLocalSearchParams();
console.log("nomor", nomor);
const [codeOtp, setCodeOtp] = useState<string>("");
const [inputOtp, setInputOtp] = useState<string>("");
const [nomor, setNomor] = useState<string>("");
const [userNumber, setUserNumber] = useState<string>("");
const [loading, setLoading] = useState<boolean>(false);
useEffect(() => {
@@ -25,7 +27,7 @@ export default function VerificationView() {
const response = await apiCheckCodeOtp({ kodeId: kodeId });
console.log("response ", JSON.stringify(response, null, 2));
setCodeOtp(response.otp);
setNomor(response.nomor);
setUserNumber(response.nomor);
}
const handleVerification = async () => {
@@ -47,7 +49,7 @@ export default function VerificationView() {
try {
setLoading(true);
const response = await apiValidationCode({ nomor: nomor });
const response = await apiValidationCode({ nomor: userNumber });
console.log("response ", JSON.stringify(response, null, 2));
if (response.success) {
@@ -61,7 +63,7 @@ export default function VerificationView() {
router.replace("/(application)/(user)/waiting-room");
}
} else {
router.replace(`/register?nomor=${nomor}`);
router.replace(`/register?nomor=${userNumber}`);
}
} catch (error) {
console.log("Error verification", error);
@@ -79,7 +81,9 @@ export default function VerificationView() {
<Text style={GStyles.authTitle}>Verifikasi KOde OTP</Text>
<Spacing height={30} />
<Text style={GStyles.textLabel}>Masukan 4 digit kode otp</Text>
<Text style={GStyles.textLabel}>Yang di kirim ke +{nomor}</Text>
<Text style={GStyles.textLabel}>
Yang di kirim ke +{userNumber}
</Text>
<Spacing height={30} />
<OtpInput
disabled={codeOtp === ""}