Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 31e1a8aedb | |||
| 9a3ecc3bb6 |
@@ -1,44 +1,49 @@
|
|||||||
import React from "react";
|
import React, {useState} from "react";
|
||||||
|
import { useSelector } from "react-redux";
|
||||||
|
import { useLocation } from "react-router-dom";
|
||||||
|
|
||||||
import { Button, InputCompOne } from "..";
|
import { Button, CustomSpinner, InputCompOne } from "..";
|
||||||
|
|
||||||
import {Formik, Form} from 'formik'
|
import {Formik, Form} from 'formik'
|
||||||
import * as Yup from "yup";
|
import * as Yup from "yup";
|
||||||
|
import { RequestStatus, StoreState } from "../../core/models";
|
||||||
|
import ErrorMsg from "../shared/ErrorMsg";
|
||||||
|
import { verifyEmployee } from "../../core/apiRequest";
|
||||||
|
|
||||||
const initialValues = {
|
const initialValues = {
|
||||||
salary_acct: "",
|
// salary_acct: "",
|
||||||
confirm_salary_acct: false,
|
confirm_salary_acct: false,
|
||||||
qualification: "",
|
education: "",
|
||||||
doe: "",
|
applicant_date: "",
|
||||||
gl: "",
|
grade: "",
|
||||||
ippis: "",
|
ippis_number: "",
|
||||||
employer_name: "",
|
employers_name: "",
|
||||||
designation: "",
|
designation: "",
|
||||||
checked: false
|
checked: false
|
||||||
};
|
};
|
||||||
|
|
||||||
// To get the validation schema
|
// To get the validation schema
|
||||||
const validationSchema = Yup.object().shape({
|
const validationSchema = Yup.object().shape({
|
||||||
salary_acct: Yup.string()
|
// salary_acct: Yup.string()
|
||||||
.required("Required")
|
// .required("Required")
|
||||||
.test("no-e", "Invalid number", (value:any) => {
|
// .test("no-e", "Invalid number", (value:any) => {
|
||||||
if (value && /^[0-9]*$/.test(value) == false) {
|
// if (value && /^[0-9]*$/.test(value) == false) {
|
||||||
return false;
|
// return false;
|
||||||
}
|
// }
|
||||||
return true;
|
// return true;
|
||||||
})
|
// })
|
||||||
.min(10, "must be 10 digits")
|
// .min(10, "must be 10 digits")
|
||||||
.max(10, "must be 10 digits"),
|
// .max(10, "must be 10 digits"),
|
||||||
confirm_salary_acct: Yup.bool() // use bool instead of boolean
|
confirm_salary_acct: Yup.bool() // use bool instead of boolean
|
||||||
.oneOf([true], "You must check the box"),
|
.oneOf([true], "You must check the box"),
|
||||||
qualification: Yup.string()
|
education: Yup.string()
|
||||||
.required("Required"),
|
.required("Required"),
|
||||||
doe: Yup.string()
|
applicant_date: Yup.string()
|
||||||
.required("BVN is required"),
|
.required("BVN is required"),
|
||||||
gl: Yup.string()
|
grade: Yup.string()
|
||||||
.required("Required"),
|
.required("Required"),
|
||||||
ippis: Yup.string(),
|
ippis_number: Yup.string(),
|
||||||
employer_name: Yup.string()
|
employers_name: Yup.string()
|
||||||
.required("Required"),
|
.required("Required"),
|
||||||
designation: Yup.string()
|
designation: Yup.string()
|
||||||
.required("Required"),
|
.required("Required"),
|
||||||
@@ -48,213 +53,233 @@ const validationSchema = Yup.object().shape({
|
|||||||
|
|
||||||
|
|
||||||
const EmployerValidation: React.FC= () => {
|
const EmployerValidation: React.FC= () => {
|
||||||
// const inputRef = useRef<HTMLInputElement>(null);
|
|
||||||
|
|
||||||
// const handleInput = (e: React.FormEvent<HTMLInputElement>) => {
|
const { userDetails } = useSelector((state:StoreState) => state.userDetails);
|
||||||
// const { name, value } = e.target as HTMLInputElement;
|
|
||||||
|
|
||||||
// if (name === "bvn") {
|
const [requestStatus, setRequestStatus] = useState<RequestStatus>({loading:false, status:null, message:'', data:{}})
|
||||||
// const isNumeric = /^[0-9]+$/.test(value);
|
|
||||||
|
|
||||||
// if (isNumeric) {
|
const { state:{application_uid, verify_uid} } = useLocation();
|
||||||
// if (value.length === 10) {
|
|
||||||
// setHideOTPComponent(false);
|
|
||||||
// } else {
|
|
||||||
// setHideOTPComponent(true);
|
|
||||||
// }
|
|
||||||
// } else {
|
|
||||||
// console.log("Invalid BVN");
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// };
|
|
||||||
|
|
||||||
|
const initialValuesNew = {...initialValues, application_uid, verify_uid}
|
||||||
|
|
||||||
//FUNCTION TO HANDLE SUBMIT
|
//FUNCTION TO HANDLE SUBMIT
|
||||||
const handleSubmit = (values:any) => {
|
const handleSubmit = (values:any) => {
|
||||||
console.log(values)
|
delete values.checked
|
||||||
|
delete values.confirm_salary_acct
|
||||||
|
|
||||||
|
setRequestStatus({loading:true, status:null, message:'', data:{}})
|
||||||
|
verifyEmployee(values).then(res => {
|
||||||
|
console.log('RES', res)
|
||||||
|
// if(res.status != '200'){
|
||||||
|
// setRequestStatus({loading:false, status:false, message:'verification failed', data:{}})
|
||||||
|
// return setTimeout(()=>{
|
||||||
|
// setRequestStatus({loading:false, status:false, message:'', data:{}})
|
||||||
|
// },2000)
|
||||||
|
// }
|
||||||
|
setRequestStatus({loading:false, status:true, message:'verification sucessful', data:{}})
|
||||||
|
}).catch(() => {
|
||||||
|
setRequestStatus({loading:false, status:false, message:'Something went wrong, try again!', data:{}})
|
||||||
|
setTimeout(()=>{
|
||||||
|
setRequestStatus({loading:false, status:false, message:'', data:{}})
|
||||||
|
},2000)
|
||||||
|
})
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{/* Header */}
|
{requestStatus.status ?
|
||||||
<div className="w-full mb-10">
|
<p className="text-xl mb-4 text-center font-medium text-red-500 dark:text-black">
|
||||||
<h1 className="font-semibold text-lg md:text-xl text-[#5C2684]">
|
Thank you for completing the process, we will continue further processing with the information provided
|
||||||
EMPLOYER'S COMMITMENT AND VALIDATION
|
</p>
|
||||||
</h1>
|
:
|
||||||
<p className="text-[10px]">(This is to be filled and validated by the employer of the applicant)</p>
|
<>
|
||||||
</div>
|
{/* Header */}
|
||||||
<Formik
|
<div className="w-full mb-10">
|
||||||
initialValues={initialValues}
|
<h1 className="font-semibold text-lg md:text-xl text-[#5C2684]">
|
||||||
validationSchema={validationSchema}
|
EMPLOYER'S COMMITMENT AND VALIDATION
|
||||||
onSubmit={handleSubmit}
|
</h1>
|
||||||
>
|
<p className="text-[10px]">(This is to be filled and validated by the employer of the applicant)</p>
|
||||||
{(props)=>(
|
</div>
|
||||||
<Form>
|
<Formik
|
||||||
<div className="w-full">
|
initialValues={initialValuesNew}
|
||||||
<p className="my-10 tracking-wide leading-relaxed">We hereby confirm that <span className="font-bold">Mr Victor Badmus (The Applicant)</span> who applied for our loan facility is a permanent and confirmed (Non-contract) staff of <span className="font-bold">Globalcom Nigeria limited</span> and that he is actively on the company's payroll
|
validationSchema={validationSchema}
|
||||||
</p>
|
onSubmit={handleSubmit}
|
||||||
<p className="my-10 tracking-wide leading-relaxed">We hereby irrevocably and unconditionally undertake to domicile his/her salaries to First City Monument Bank Ltd (FCMB) Accounts number.
|
>
|
||||||
</p>
|
{(props)=>(
|
||||||
</div>
|
<Form>
|
||||||
<div className="w-full my-10">
|
<div className="w-full">
|
||||||
<p className="mb-1 text-[12px] font-bold flex items-center gap-4">Confirms Employee's salary account number
|
<p className="my-10 tracking-wide leading-relaxed">We hereby confirm that <span className="font-bold">Mr {userDetails.firstname} {userDetails.lastname} (The Applicant)</span> who applied for our loan facility is a permanent and confirmed (Non-contract) staff of <span className="font-bold">{userDetails.employer_name}</span> and that he is actively on the company's payroll
|
||||||
{(props.errors.salary_acct && props.touched.salary_acct) && <span className='text-[10px] text-red-500'>{props.errors.salary_acct}</span> }
|
</p>
|
||||||
</p>
|
<p className="my-10 tracking-wide leading-relaxed">We hereby irrevocably and unconditionally undertake to domicile his/her salaries to First City Monument Bank Ltd (FCMB) Accounts number.
|
||||||
<div className="w-full flex items-center gap-8">
|
|
||||||
<InputCompOne
|
|
||||||
parentClass="w-full max-w-[25rem]"
|
|
||||||
// label="First Name"
|
|
||||||
name="salary_acct"
|
|
||||||
parentInputClass="w-full"
|
|
||||||
labelClass="font-bold text-[1.125rem] leading-[1.3613rem] tracking-[2%] text-[#5C2684] mb-[.125rem]"
|
|
||||||
input
|
|
||||||
inputClass="w-full h-[2.25rem] bg-[#EFEFEF] rounded-[.375rem]"
|
|
||||||
value={props.values.first_name}
|
|
||||||
onChange={props.handleChange}
|
|
||||||
// error={(props.errors.first_name && props.touched.first_name) ? props.errors.first_name : ''}
|
|
||||||
/>
|
|
||||||
<input
|
|
||||||
type='checkbox'
|
|
||||||
name="confirm_salary_acct"
|
|
||||||
className='w-6 h-6 p-2 accent-purple-600 text-purple-600 bg-gray-100 border-gray-300 rounded-lg focus:ring-purple-500'
|
|
||||||
onChange={props.handleChange}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
{(props.errors.confirm_salary_acct && props.touched.confirm_salary_acct) && <span className='text-[10px] text-red-500'>{props.errors.confirm_salary_acct}</span> }
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="my-10">
|
|
||||||
<p className="my-2 tracking-wide leading-relaxed">We further undertake that we shall not change the domiciliation of the applicant's account from FCMB throughout the tenor of the loan and any extension thereof unless with your written consent stating that the applicant is no longer indebted to the Bank.
|
|
||||||
</p>
|
|
||||||
<p className="my-2 tracking-wide leading-relaxed">We agree to notigy you within 14 days in the event of transfer of the applicant from his/her present location, any change in the employment status or disengagement from the service of our organization or death of the applicant and shall pay his/her benefits, if applicable (excluding Pension Contribution) to the designated FCMB Account number above or issue a cheque or bank draft in favour of We further consent to any additional salary plus facility enhancement that may be obtained by the Beneficiary from your Bank subject to the Bank carrying out a due diligence as to the status of the Beneficiary's employment with our company prior to the approval of the facility Our commitment/consent and undertaking as stated above extends to cover additinal facilities of any kind that may be obtained from your Bank by any of the above mentioned Beneficiary(ies).
|
|
||||||
</p>
|
|
||||||
<p className="my-2 tracking-wide leading-relaxed">This Undertaking is given in good faith and shall remain irrevocable except with the written consent of the Bank.
|
|
||||||
</p>
|
|
||||||
<p className="my-2 tracking-wide leading-relaxed">Thank you.</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="mt-20 mb-10 w-full rounded py-3 bg-[#5C2684] px-5">
|
|
||||||
<p className="text-base text-[#FBB700] tracking-[3%] font-extrabold w-fit uppercase">
|
|
||||||
Employers Validation
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="my-10 flex flex-col md:flex-row gap-4 md:gap-10 md:items-end">
|
|
||||||
<InputCompOne
|
|
||||||
parentInputClass="w-full"
|
|
||||||
parentClass="w-full md:max-w-[25rem]"
|
|
||||||
name="qualification"
|
|
||||||
label="Applicant's Educational Qualification"
|
|
||||||
labelClass="font-bold text-base md:text-[1.125rem] leading-[1.3613rem] tracking-[2%] text-[#5C2684] mb-[.125rem]"
|
|
||||||
labelSpan={`(Please select the emplyee's highest qualification)`}
|
|
||||||
labelSpanClass='text-[10px]'
|
|
||||||
select={true}
|
|
||||||
selectClass="w-full h-[36px] rounded-[6px]"
|
|
||||||
selectOptions={titleOptions}
|
|
||||||
selectValue={props.values.qualification}
|
|
||||||
onChange={props.handleChange}
|
|
||||||
error={(props.errors.qualification && props.touched.qualification) ? props.errors.qualification : ''}
|
|
||||||
/>
|
|
||||||
<InputCompOne
|
|
||||||
parentClass="w-full md:max-w-[25rem]"
|
|
||||||
label="Applicant's Date of Employment"
|
|
||||||
name="doe"
|
|
||||||
parentInputClass="w-full"
|
|
||||||
labelClass="font-bold text-base md:text-[1.125rem] leading-[1.3613rem] tracking-[2%] text-[#5C2684] mb-[.125rem]"
|
|
||||||
input
|
|
||||||
inputType='date'
|
|
||||||
inputClass="w-full h-[2.25rem] bg-[#EFEFEF] rounded-[.375rem] px-3"
|
|
||||||
value={props.values.doe}
|
|
||||||
onChange={props.handleChange}
|
|
||||||
error={(props.errors.doe && props.touched.doe) ? props.errors.doe : ''}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div className="my-10 flex flex-col md:flex-row gap-4 md:gap-10 md:items-end">
|
|
||||||
<InputCompOne
|
|
||||||
parentClass="w-full md:max-w-[25rem]"
|
|
||||||
label="Applicant's Grade Level"
|
|
||||||
name="gl"
|
|
||||||
parentInputClass="w-full"
|
|
||||||
labelClass="font-bold text-base md:text-[1.125rem] leading-[1.3613rem] tracking-[2%] text-[#5C2684] mb-[.125rem]"
|
|
||||||
input
|
|
||||||
inputClass="w-full h-[2.25rem] bg-[#EFEFEF] rounded-[.375rem]"
|
|
||||||
value={props.values.gl}
|
|
||||||
onChange={props.handleChange}
|
|
||||||
error={(props.errors.gl && props.touched.gl) ? props.errors.gl : ''}
|
|
||||||
/>
|
|
||||||
<InputCompOne
|
|
||||||
parentClass="w-full md:max-w-[25rem]"
|
|
||||||
label="Applicant's IPPIS Number (optional)"
|
|
||||||
name="ippis"
|
|
||||||
parentInputClass="w-full"
|
|
||||||
labelClass="font-bold text-base md:text-[1.125rem] leading-[1.3613rem] tracking-[2%] text-[#5C2684] mb-[.125rem]"
|
|
||||||
input
|
|
||||||
inputClass="w-full h-[2.25rem] bg-[#EFEFEF] rounded-[.375rem]"
|
|
||||||
value={props.values.ippis}
|
|
||||||
onChange={props.handleChange}
|
|
||||||
error={(props.errors.ippis && props.touched.ippis) ? props.errors.ippis : ''}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className='w-full max-w-[45rem]'>
|
|
||||||
<div className='flex gap-4 items-start'>
|
|
||||||
<input
|
|
||||||
type='checkbox'
|
|
||||||
name="checked"
|
|
||||||
className='w-6 h-6 p-2 accent-purple-600 text-purple-600 bg-gray-100 border-gray-300 rounded focus:ring-purple-500'
|
|
||||||
onChange={props.handleChange}
|
|
||||||
/>
|
|
||||||
<p className='text-sm text-justify'>We hereby accept that all the information provided about the applicant (your employee) is true and correct to the best of our knowledge
|
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
{props.errors.checked && props.touched.checked && <span className='text-[10px] text-red-500'>{props.errors.checked}</span>}
|
<div className="w-full my-10">
|
||||||
</div>
|
<div className="w-full flex items-center gap-8">
|
||||||
|
<InputCompOne
|
||||||
|
parentClass="w-full max-w-[25rem]"
|
||||||
|
name="salary_acct"
|
||||||
|
parentInputClass="w-full"
|
||||||
|
labelClass="font-bold text-[1.125rem] leading-[1.3613rem] tracking-[2%] text-[#5C2684] mb-[.125rem]"
|
||||||
|
input
|
||||||
|
inputClass="w-full h-[2.25rem] bg-[#EFEFEF] rounded-[.375rem]"
|
||||||
|
value='0011223344'
|
||||||
|
onChange={props.handleChange}
|
||||||
|
disabled={true}
|
||||||
|
// error={(props.errors.first_name && props.touched.first_name) ? props.errors.first_name : ''}
|
||||||
|
/>
|
||||||
|
<input
|
||||||
|
type='checkbox'
|
||||||
|
name="confirm_salary_acct"
|
||||||
|
className='w-6 h-6 p-2 accent-purple-600 text-purple-600 bg-gray-100 border-gray-300 rounded-lg focus:ring-purple-500'
|
||||||
|
onChange={props.handleChange}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
{(props.errors.confirm_salary_acct && props.touched.confirm_salary_acct) && <span className='text-[10px] text-red-500'>{props.errors.confirm_salary_acct}</span> }
|
||||||
|
</div>
|
||||||
|
|
||||||
<div className="my-10 flex flex-col md:flex-row gap-4 md:gap-10 md:items-end">
|
<div className="my-10">
|
||||||
<InputCompOne
|
<p className="my-2 tracking-wide leading-relaxed">We further undertake that we shall not change the domiciliation of the applicant's account from FCMB throughout the tenor of the loan and any extension thereof unless with your written consent stating that the applicant is no longer indebted to the Bank.
|
||||||
parentClass="w-full md:max-w-[25rem]"
|
</p>
|
||||||
label="Employer's Name"
|
<p className="my-2 tracking-wide leading-relaxed">We agree to notigy you within 14 days in the event of transfer of the applicant from his/her present location, any change in the employment status or disengagement from the service of our organization or death of the applicant and shall pay his/her benefits, if applicable (excluding Pension Contribution) to the designated FCMB Account number above or issue a cheque or bank draft in favour of We further consent to any additional salary plus facility enhancement that may be obtained by the Beneficiary from your Bank subject to the Bank carrying out a due diligence as to the status of the Beneficiary's employment with our company prior to the approval of the facility Our commitment/consent and undertaking as stated above extends to cover additinal facilities of any kind that may be obtained from your Bank by any of the above mentioned Beneficiary(ies).
|
||||||
name="employer_name"
|
</p>
|
||||||
parentInputClass="w-full"
|
<p className="my-2 tracking-wide leading-relaxed">This Undertaking is given in good faith and shall remain irrevocable except with the written consent of the Bank.
|
||||||
labelClass="font-bold text-base md:text-[1.125rem] leading-[1.3613rem] tracking-[2%] text-[#5C2684] mb-[.125rem]"
|
</p>
|
||||||
labelSpan={`(your full name)`}
|
<p className="my-2 tracking-wide leading-relaxed">Thank you.</p>
|
||||||
labelSpanClass='text-[10px]'
|
</div>
|
||||||
input
|
|
||||||
inputClass="w-full h-[2.25rem] bg-[#EFEFEF] rounded-[.375rem]"
|
<div className="mt-20 mb-10 w-full rounded py-3 bg-[#5C2684] px-5">
|
||||||
value={props.values.employer_name}
|
<p className="text-base text-[#FBB700] tracking-[3%] font-extrabold w-fit uppercase">
|
||||||
onChange={props.handleChange}
|
Employers Validation
|
||||||
error={(props.errors.employer_name && props.touched.employer_name) ? props.errors.employer_name : ''}
|
</p>
|
||||||
/>
|
</div>
|
||||||
<InputCompOne
|
|
||||||
parentClass="w-full md:max-w-[25rem]"
|
<div className="my-10 flex flex-col md:flex-row gap-4 md:gap-10 md:items-end">
|
||||||
label="Designation"
|
<InputCompOne
|
||||||
name="designation"
|
parentInputClass="w-full"
|
||||||
parentInputClass="w-full"
|
parentClass="w-full md:max-w-[25rem]"
|
||||||
labelClass="font-bold text-base md:text-[1.125rem] leading-[1.3613rem] tracking-[2%] text-[#5C2684] mb-[.125rem]"
|
name="education"
|
||||||
labelSpan={`(your position)`}
|
label="Applicant's Educational Qualification"
|
||||||
labelSpanClass='text-[10px]'
|
labelClass="font-bold text-base md:text-[1.125rem] leading-[1.3613rem] tracking-[2%] text-[#5C2684] mb-[.125rem]"
|
||||||
input
|
labelSpan={`(Please select the emplyee's highest qualification)`}
|
||||||
inputClass="w-full h-[2.25rem] bg-[#EFEFEF] rounded-[.375rem]"
|
labelSpanClass='text-[10px]'
|
||||||
value={props.values.designation}
|
select={true}
|
||||||
onChange={props.handleChange}
|
selectClass="w-full h-[36px] rounded-[6px]"
|
||||||
error={(props.errors.designation && props.touched.designation) ? props.errors.designation : ''}
|
selectOptions={titleOptions}
|
||||||
/>
|
selectValue={props.values.education}
|
||||||
</div>
|
onChange={props.handleChange}
|
||||||
|
error={(props.errors.education && props.touched.education) ? props.errors.education : ''}
|
||||||
|
/>
|
||||||
|
<InputCompOne
|
||||||
|
parentClass="w-full md:max-w-[25rem]"
|
||||||
|
label="Applicant's Date of Employment"
|
||||||
|
name="applicant_date"
|
||||||
|
parentInputClass="w-full"
|
||||||
|
labelClass="font-bold text-base md:text-[1.125rem] leading-[1.3613rem] tracking-[2%] text-[#5C2684] mb-[.125rem]"
|
||||||
|
input
|
||||||
|
inputType='date'
|
||||||
|
inputClass="w-full h-[2.25rem] bg-[#EFEFEF] rounded-[.375rem] px-3"
|
||||||
|
value={props.values.applicant_date}
|
||||||
|
onChange={props.handleChange}
|
||||||
|
error={(props.errors.applicant_date && props.touched.applicant_date) ? props.errors.applicant_date : ''}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
{/* submit button */}
|
<div className="my-10 flex flex-col md:flex-row gap-4 md:gap-10 md:items-end">
|
||||||
<div className="mt-24">
|
<InputCompOne
|
||||||
<Button
|
parentClass="w-full md:max-w-[25rem]"
|
||||||
className="mt-8 btn-R bg-[#5A2C82]"
|
label="Applicant's Grade Level"
|
||||||
text="Submit"
|
name="grade"
|
||||||
type="submit"
|
parentInputClass="w-full"
|
||||||
/>
|
labelClass="font-bold text-base md:text-[1.125rem] leading-[1.3613rem] tracking-[2%] text-[#5C2684] mb-[.125rem]"
|
||||||
</div>
|
input
|
||||||
</Form>
|
inputClass="w-full h-[2.25rem] bg-[#EFEFEF] rounded-[.375rem]"
|
||||||
)}
|
value={props.values.grade}
|
||||||
</Formik>
|
onChange={props.handleChange}
|
||||||
|
error={(props.errors.grade && props.touched.grade) ? props.errors.grade : ''}
|
||||||
|
/>
|
||||||
|
<InputCompOne
|
||||||
|
parentClass="w-full md:max-w-[25rem]"
|
||||||
|
label="Applicant's IPPIS Number (optional)"
|
||||||
|
name="ippis_number"
|
||||||
|
parentInputClass="w-full"
|
||||||
|
labelClass="font-bold text-base md:text-[1.125rem] leading-[1.3613rem] tracking-[2%] text-[#5C2684] mb-[.125rem]"
|
||||||
|
input
|
||||||
|
inputClass="w-full h-[2.25rem] bg-[#EFEFEF] rounded-[.375rem]"
|
||||||
|
value={props.values.ippis_number}
|
||||||
|
onChange={props.handleChange}
|
||||||
|
error={(props.errors.ippis_number && props.touched.ippis_number) ? props.errors.ippis_number : ''}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className='w-full max-w-[45rem]'>
|
||||||
|
<div className='flex gap-4 items-start'>
|
||||||
|
<input
|
||||||
|
type='checkbox'
|
||||||
|
name="checked"
|
||||||
|
className='w-6 h-6 p-2 accent-purple-600 text-purple-600 bg-gray-100 border-gray-300 rounded focus:ring-purple-500'
|
||||||
|
onChange={props.handleChange}
|
||||||
|
/>
|
||||||
|
<p className='text-sm text-justify'>We hereby accept that all the information provided about the applicant (your employee) is true and correct to the best of our knowledge
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
{props.errors.checked && props.touched.checked && <span className='text-[10px] text-red-500'>{props.errors.checked}</span>}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="my-10 flex flex-col md:flex-row gap-4 md:gap-10 md:items-end">
|
||||||
|
<InputCompOne
|
||||||
|
parentClass="w-full md:max-w-[25rem]"
|
||||||
|
label="Employer's Name"
|
||||||
|
name="employers_name"
|
||||||
|
parentInputClass="w-full"
|
||||||
|
labelClass="font-bold text-base md:text-[1.125rem] leading-[1.3613rem] tracking-[2%] text-[#5C2684] mb-[.125rem]"
|
||||||
|
labelSpan={`(your full name)`}
|
||||||
|
labelSpanClass='text-[10px]'
|
||||||
|
input
|
||||||
|
inputClass="w-full h-[2.25rem] bg-[#EFEFEF] rounded-[.375rem]"
|
||||||
|
value={props.values.employers_name}
|
||||||
|
onChange={props.handleChange}
|
||||||
|
error={(props.errors.employers_name && props.touched.employers_name) ? props.errors.employers_name : ''}
|
||||||
|
/>
|
||||||
|
<InputCompOne
|
||||||
|
parentClass="w-full md:max-w-[25rem]"
|
||||||
|
label="Designation"
|
||||||
|
name="designation"
|
||||||
|
parentInputClass="w-full"
|
||||||
|
labelClass="font-bold text-base md:text-[1.125rem] leading-[1.3613rem] tracking-[2%] text-[#5C2684] mb-[.125rem]"
|
||||||
|
labelSpan={`(your position)`}
|
||||||
|
labelSpanClass='text-[10px]'
|
||||||
|
input
|
||||||
|
inputClass="w-full h-[2.25rem] bg-[#EFEFEF] rounded-[.375rem]"
|
||||||
|
value={props.values.designation}
|
||||||
|
onChange={props.handleChange}
|
||||||
|
error={(props.errors.designation && props.touched.designation) ? props.errors.designation : ''}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
{/* submit button */}
|
||||||
|
<div className="mt-24 flex items-center gap-2">
|
||||||
|
<Button
|
||||||
|
className="btn-R bg-[#5A2C82]"
|
||||||
|
text="Submit"
|
||||||
|
type="submit"
|
||||||
|
/>
|
||||||
|
{requestStatus.loading &&
|
||||||
|
<CustomSpinner />
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
<div className='w-full'>
|
||||||
|
<ErrorMsg
|
||||||
|
message={requestStatus.message}
|
||||||
|
status={requestStatus.status}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</Form>
|
||||||
|
)}
|
||||||
|
</Formik>
|
||||||
|
</>
|
||||||
|
}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -72,9 +72,9 @@ export default function Login() {
|
|||||||
}
|
}
|
||||||
setRequestStatus({loading:false, status:true, message:'OTP Verified', data:res?.data})
|
setRequestStatus({loading:false, status:true, message:'OTP Verified', data:res?.data})
|
||||||
localStorage.setItem('token', state?.verify_uid)
|
localStorage.setItem('token', state?.verify_uid)
|
||||||
let data = {firstname:'firstname', lastname:'lastname', uid:'28273737646466464'}
|
// let data = {firstname:'firstname', lastname:'lastname', uid:'28273737646466464'}
|
||||||
dispatch(updateUserDetails(data));
|
dispatch(updateUserDetails(res?.data?.records));
|
||||||
navigate(`/${state?.application_uid}`, {replace:true})
|
navigate(`/${state?.application_uid}`, {state:{'application_uid':state?.application_uid, 'verify_uid':state?.verify_uid}, replace:true})
|
||||||
}).catch(err =>{
|
}).catch(err =>{
|
||||||
setRequestStatus({loading:false, status:false, message:'something went wrong', data:{}})
|
setRequestStatus({loading:false, status:false, message:'something went wrong', data:{}})
|
||||||
console.log(err)
|
console.log(err)
|
||||||
|
|||||||
@@ -16,3 +16,11 @@ export const verifyOTP = (postData:any) => {
|
|||||||
}
|
}
|
||||||
return postAuxEnd('/otp', reqData)
|
return postAuxEnd('/otp', reqData)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FUNCTION TO VERIFY OTP AND LOGIN
|
||||||
|
export const verifyEmployee = (postData:any) => {
|
||||||
|
let reqData = {
|
||||||
|
...postData
|
||||||
|
}
|
||||||
|
return postAuxEnd('/verify', reqData)
|
||||||
|
}
|
||||||
@@ -15,3 +15,7 @@ export interface APIResponse {
|
|||||||
username: string
|
username: string
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface StoreState {
|
||||||
|
[index:string]: string
|
||||||
|
}
|
||||||
@@ -8,6 +8,7 @@ import { updateUserDetails } from '../../store/UserDetails';
|
|||||||
import { RouteHandler } from '../../router/routes';
|
import { RouteHandler } from '../../router/routes';
|
||||||
|
|
||||||
import Logo from '../../assets/images/logo.png'
|
import Logo from '../../assets/images/logo.png'
|
||||||
|
import { StoreState } from '../../core/models';
|
||||||
|
|
||||||
export default function DashboardAuth() {
|
export default function DashboardAuth() {
|
||||||
|
|
||||||
@@ -15,7 +16,7 @@ export default function DashboardAuth() {
|
|||||||
const dispatch = useDispatch()
|
const dispatch = useDispatch()
|
||||||
const {application_uid} = useParams()
|
const {application_uid} = useParams()
|
||||||
|
|
||||||
const { userDetails } = useSelector((state:any) => state?.userDetails); // CHECKS IF USER Details are avaliable
|
const { userDetails } = useSelector((state:StoreState) => state?.userDetails); // CHECKS IF USER Details are avaliable
|
||||||
|
|
||||||
const [loading, setLoading] = useState(true)
|
const [loading, setLoading] = useState(true)
|
||||||
|
|
||||||
@@ -45,7 +46,7 @@ export default function DashboardAuth() {
|
|||||||
navigate(RouteHandler.loginpage, {state:{application_uid}, replace:true})
|
navigate(RouteHandler.loginpage, {state:{application_uid}, replace:true})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if(!application_uid){ // IF NO TOKEN || UID RETURN TO LOGIN PAGE
|
if(!application_uid){ // APPLICATION UID RETURN TO LOGIN PAGE
|
||||||
navigate(RouteHandler.loginpage, {replace:true})
|
navigate(RouteHandler.loginpage, {replace:true})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user