import React, { useState } from "react"; import { View, Text, TextInput, TouchableOpacity, StyleSheet, Alert, } from "react-native"; import { Ionicons } from "@expo/vector-icons"; // Import Ionicons untuk ikon export default function VerifyCode({ navigation }) { const [verificationCode, setVerificationCode] = useState(""); // Input untuk kode verifikasi const handleSubmit = async () => { if (!verificationCode) { Alert.alert("Peringatan", "Kode verifikasi tidak boleh kosong!"); return; } // Validasi kode verifikasi (ini hanya contoh, sesuaikan dengan backend) if (verificationCode !== "123456") { // Asumsikan kode valid adalah "123456" Alert.alert("Peringatan", "Kode verifikasi salah!"); return; } try { // Lanjutkan proses setelah verifikasi kode (misalnya, reset password) navigation.navigate("ResetPassword"); // Ganti dengan halaman yang sesuai, seperti halaman reset password } catch (error) { Alert.alert("Error", "Terjadi kesalahan saat memverifikasi kode."); } }; return ( {/* Header dengan tombol kembali */} navigation.goBack()} style={styles.backButton} > KODE VERIFIKASI {/* Subtitle */} Masukkan kode verifikasi yang telah dikirim {/* Input untuk kode verifikasi */} {/* Tombol Verifikasi */} navigation.navigate("notifikasisukses")} > KIRIM ); } const styles = StyleSheet.create({ container: { flex: 1, justifyContent: "flex-start", alignItems: "center", backgroundColor: "#FFF", padding: 0, }, header: { flexDirection: "row", alignItems: "center", justifyContent: "flex-start", width: "100%", padding: 10, backgroundColor: "#FFF", borderBottomWidth: 0, borderBottomColor: "#FFFS", marginTop: 30, }, backButton: { padding: 10, }, headerTextContainer: { flex: 1, alignItems: "flex-start", justifyContent: "center", }, title: { fontSize: 20, fontWeight: "bold", color: "#000", }, subtitle: { fontSize: 16, marginVertical: 20, color: "#8e8e8e", textAlign: "center", paddingHorizontal: 10, }, input: { width: "90%", padding: 15, marginBottom: 20, borderWidth: 1, borderRadius: 15, borderColor: "#BBBBBB", fontSize: 16, textAlign: "center", backgroundColor: "#f9f9f9", // Light background for the input }, button: { width: "90%", padding: 15, backgroundColor: "#2D572C", // Green color for submit button alignItems: "center", borderRadius: 15, }, buttonText: { color: "#fff", fontSize: 16, fontWeight: "bold", }, });