everything works!

This commit is contained in:
Ebube
2023-04-25 08:29:45 +01:00
parent 636651aa38
commit f86ac54e5c
2 changed files with 16 additions and 13 deletions
@@ -1,4 +1,4 @@
import React, { useState } from "react";
import React, { useEffect, useState } from "react";
import { Link, useNavigate } from 'react-router-dom';
import WrenchBoard from "../../../assets/images/wrenchboard.png"
import InputCom from "../../Helpers/Inputs/InputCom";
@@ -26,10 +26,10 @@ export default function ForgotPassword() {
const resetHandler = async () => {
if (email == '') {
setMsgError('Please fill in fields')
} else if (!checked){
} else if (!checked) {
setMsgError('Check if you are human')
}
if (email != '' && checked) {
const reqData = { email }
setResetLoading(true)
@@ -44,11 +44,14 @@ export default function ForgotPassword() {
}
if (data.status > 0) {
setResetLoading(false)
navigate("/verify-you", { replace: true })
console.log('Success', data)
}
setMail("")
}
} catch (error) {
setResetLoading(false)
setMail("")
setMsgError('An error occurred')
throw new Error(error)
} finally {
@@ -105,7 +108,7 @@ export default function ForgotPassword() {
<div className="relative table top-0 h-full">
<div className="table-cell align-middle">
<div className="relative w-[30px] h-[30px] mx-[15px]">
<input type="checkbox" name="human-checkbox" id="human-checkbox" className="w-[28px] h-[28px] border-[1px] rounded border-gray-400 checked:bg-white" />
<input type="checkbox" name="human-checkbox" id="human-checkbox" className="w-[28px] h-[28px] border-[1px] rounded border-gray-400 checked:bg-white" onClick={humanChecker} />
</div>
</div>
</div>
@@ -144,12 +147,6 @@ export default function ForgotPassword() {
Cancel
</button>
</div>
{/* <a
href="/verify-you"
className="w-full rounded-[50px] mb-5 h-[58px] text-xl text-white font-bold flex justify-center bg-purple items-center"
>
Send Code
</a> */}
</div>
</div>
</div>