Enforced send limit

This commit is contained in:
2023-07-26 15:49:04 +01:00
parent 6ab5eae0c0
commit 22e61d2b41
2 changed files with 12 additions and 4 deletions
@@ -263,6 +263,10 @@ function ConfirmNairaWithdraw({
?.toLowerCase()
.includes("limit")
? "Transfer limit Error"
: completeNairaWithdraw.state?.bad_param
?.toLowerCase()
.includes("balance")
? "Insufficient Balance"
: "An Error Occurred"}{" "}
</h1>
</div>
@@ -283,6 +287,10 @@ function ConfirmNairaWithdraw({
?.toLowerCase()
.includes("limit")
? "The transfer limit has been exceeded"
: completeNairaWithdraw.state?.bad_param
?.toLowerCase()
.includes("balance")
? "Insufficient Balance for Transaction"
: "Could not perform transaction"}
</span>
</div>
@@ -171,8 +171,8 @@ function NairaWithdraw({
setErrorMsgs({ amount: "amount required" });
setTimeout(() => setErrorMsgs({ amount: "" }), 3000);
return;
} else if (Number(values.amount) > Number(wallet?.transfer_limit)) {
setErrorMsgs({ amount: "transfer limit exceeded" });
}else if (Number(values.amount * 100) > Number(wallet?.transfer_limit)) {
setErrorMsgs({ amount: "Withdraw limit has been exceeded" });
setTimeout(() => setErrorMsgs({ amount: "" }), 3000);
return;
}
@@ -326,8 +326,8 @@ function NairaWithdraw({
<InputCom
fieldClass="px-4 text-end"
parentClass="flex items-center gap-1 justify-between"
labelClass="flex-[0.3] mb-0"
inputClass="flex-[0.7] max-w-[12rem]"
labelClass="flex-[0.4] mb-0"
inputClass="flex-[0.6] max-w-[12rem]"
label="Amount:"
type="number"
name="amount"