From 89c593621232d33299e5e66109f9887549a251a2 Mon Sep 17 00:00:00 2001 From: Ebube Date: Mon, 17 Jul 2023 11:29:50 +0100 Subject: [PATCH 1/3] Some fixes --- .../MyWallet/Popup/CompleteConfirmCredit.jsx | 60 ++++++++++--------- .../MyWallet/Popup/ConfirmAddFund.jsx | 4 +- src/components/MyWallet/Popup/CreditPopup.jsx | 3 + 3 files changed, 38 insertions(+), 29 deletions(-) diff --git a/src/components/MyWallet/Popup/CompleteConfirmCredit.jsx b/src/components/MyWallet/Popup/CompleteConfirmCredit.jsx index 1c13432..51f827f 100644 --- a/src/components/MyWallet/Popup/CompleteConfirmCredit.jsx +++ b/src/components/MyWallet/Popup/CompleteConfirmCredit.jsx @@ -53,38 +53,44 @@ function CompleteConfirmCredit({ onClose, confirmCredit }) {

{data?.result == "Charge success" ? "Credit was Successful!" - : data?.result} + : "Credit was Unsuccessful"}

-
-

- Amount({data?.currency || ""}) -

- - {`${data?.symbol || ""} ${ - Number(data?.amount * 0.01).toLocaleString() || "" - }`} - -
+ {data?.internal_return >= 0 ? ( + <> +
+

+ Amount({data?.currency || ""}) +

+ + {`${data?.symbol || ""} ${ + Number(data?.amount * 0.01).toLocaleString() || "" + }`} + +
-
-

- Wallet Balance -

- - {data?.curr_balance} - -
+
+

+ Wallet Balance +

+ + {data?.curr_balance} + +
-
-

- Confirmation Number -

- - {data?.confirmation} - -
+
+

+ Confirmation Number +

+ + {data?.confirmation} + +
+ + ) : ( +
+ )} diff --git a/src/components/MyWallet/Popup/ConfirmAddFund.jsx b/src/components/MyWallet/Popup/ConfirmAddFund.jsx index 4a4dd1a..cc05950 100644 --- a/src/components/MyWallet/Popup/ConfirmAddFund.jsx +++ b/src/components/MyWallet/Popup/ConfirmAddFund.jsx @@ -11,7 +11,7 @@ function ThePaymentText({ value, type }) { type === "new" ? cardDetails.cardNum[0] === "4" ? "Visa" - : value[0] === "5" + : value[0] == "5" ? "Master" : "ATM" : value.description; @@ -223,7 +223,7 @@ function ConfirmAddFund({ amount: amount * 100, cardnumber: cardNum.replace(/\s/g, ""), credit_reference, - cvc: cvv, + cvc: String(cvv), description: address, exp_month: expirationMonth, exp_year: expirationYear, diff --git a/src/components/MyWallet/Popup/CreditPopup.jsx b/src/components/MyWallet/Popup/CreditPopup.jsx index b464db0..4d291ea 100644 --- a/src/components/MyWallet/Popup/CreditPopup.jsx +++ b/src/components/MyWallet/Popup/CreditPopup.jsx @@ -24,6 +24,9 @@ const CreditPopup = ({ details, onClose, situation, walletItem }) => {

+ {confirmCredit?.show?.acceptConfirm?.state && + confirmCredit?.data?.internal_return < 0 && + "Credit Unsuccessful"} {confirmCredit?.show?.acceptConfirm?.loader ? "Confirming Credit..." : confirmCredit?.show?.awaitConfirm?.state From 5d12ab4f62677009ffae37180a1d8e2b2f833f91 Mon Sep 17 00:00:00 2001 From: Ebube Date: Mon, 17 Jul 2023 11:48:03 +0100 Subject: [PATCH 2/3] Made a few changes --- .../MyWallet/Popup/CompleteConfirmCredit.jsx | 2 +- .../MyWallet/Popup/ConfirmAddFund.jsx | 2 +- src/components/MyWallet/Popup/CreditPopup.jsx | 22 +++++++++++-------- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/components/MyWallet/Popup/CompleteConfirmCredit.jsx b/src/components/MyWallet/Popup/CompleteConfirmCredit.jsx index 51f827f..ba5c0a4 100644 --- a/src/components/MyWallet/Popup/CompleteConfirmCredit.jsx +++ b/src/components/MyWallet/Popup/CompleteConfirmCredit.jsx @@ -89,7 +89,7 @@ function CompleteConfirmCredit({ onClose, confirmCredit }) {

) : ( -
+
)}
diff --git a/src/components/MyWallet/Popup/ConfirmAddFund.jsx b/src/components/MyWallet/Popup/ConfirmAddFund.jsx index cc05950..dab5c73 100644 --- a/src/components/MyWallet/Popup/ConfirmAddFund.jsx +++ b/src/components/MyWallet/Popup/ConfirmAddFund.jsx @@ -11,7 +11,7 @@ function ThePaymentText({ value, type }) { type === "new" ? cardDetails.cardNum[0] === "4" ? "Visa" - : value[0] == "5" + : cardDetails.cardNum[0] == "5" ? "Master" : "ATM" : value.description; diff --git a/src/components/MyWallet/Popup/CreditPopup.jsx b/src/components/MyWallet/Popup/CreditPopup.jsx index 4d291ea..d186081 100644 --- a/src/components/MyWallet/Popup/CreditPopup.jsx +++ b/src/components/MyWallet/Popup/CreditPopup.jsx @@ -25,15 +25,19 @@ const CreditPopup = ({ details, onClose, situation, walletItem }) => {

{confirmCredit?.show?.acceptConfirm?.state && - confirmCredit?.data?.internal_return < 0 && - "Credit Unsuccessful"} - {confirmCredit?.show?.acceptConfirm?.loader - ? "Confirming Credit..." - : confirmCredit?.show?.awaitConfirm?.state - ? "Confirm Credit Add" - : confirmCredit?.show?.acceptConfirm?.state - ? "Credit Add Completed" - : "Add Credit"} + confirmCredit?.data?.internal_return < 0 ? ( + "Credit Unsuccessful" + ) : ( + <> + {confirmCredit?.show?.acceptConfirm?.loader + ? "Confirming Credit..." + : confirmCredit?.show?.awaitConfirm?.state + ? "Confirm Credit Add" + : confirmCredit?.show?.acceptConfirm?.state + ? "Credit Add Completed" + : "Add Credit"} + + )}