import React from "react"; import { Button, InputCompOne } from ".."; import {Formik, Form} from 'formik' import * as Yup from "yup"; const initialValues = { title: "", marital_status: "", agent_id: "", bvn: "", first_name: "", phone: "", email: "", surname: "", dob: "", second_name: "", spouse_bvn: "", }; // To get the validation schema const validationSchema = Yup.object().shape({ title: Yup.string() .required("Required"), marital_status: Yup.string() .required("Required"), agent_id: Yup.string() .required("Required"), bvn: Yup.string() .required("BVN is required") .test("no-e", "Invalid number", (value:any) => { if (value && /^[0-9]*$/.test(value) == false) { return false; } return true; }) .min(11, "must be 11 digits") .max(11, "must be 11 digits"), first_name: Yup.string() .required("Required"), phone: Yup.string() .required("Required"), email: Yup.string() .required("Required") .email("Wrong email format"), surname: Yup.string() .required("Required"), dob: Yup.string() .required("Required"), }); interface BasicInfoProps { handleNextStep: any; } const BasicInfo: React.FC = ({ handleNextStep, }) => { // const inputRef = useRef(null); // const handleInput = (e: React.FormEvent) => { // const { name, value } = e.target as HTMLInputElement; // if (name === "bvn") { // const isNumeric = /^[0-9]+$/.test(value); // if (isNumeric) { // if (value.length === 10) { // setHideOTPComponent(false); // } else { // setHideOTPComponent(true); // } // } else { // console.log("Invalid BVN"); // } // } // }; //FUNCTION TO HANDLE SUBMIT const handleSubmit = (values:any) => { console.log(values) handleNextStep() }; return ( <> {/* Header */}

Let’s Get You Started

{(props)=>(

BASIC INFORMATION

SPOUSE DETAILS ( If not applicable, please move to the next stage )

<>