Compare commits

...

7 Commits

Author SHA1 Message Date
victorAnumudu 15fc5f4f14 family icon added 2023-07-17 15:31:39 +01:00
ameye 2ba3b01646 Merge branch 'resource-question-page' of WrenchBoard/Users-Wrench into master 2023-07-17 12:50:09 +00:00
ameye 4e960a2f53 Merge branch 'my_wallet_layout' of WrenchBoard/Users-Wrench into master 2023-07-17 12:49:59 +00:00
Ebube 42e80c7a11 Merge branch 'master' of https://gitlab.chiefsoft.net/WrenchBoard/Users-Wrench into my_wallet_layout 2023-07-17 12:59:32 +01:00
Ebube d4472a881a Fixed digits 2023-07-17 12:59:05 +01:00
Ebube 5d12ab4f62 Made a few changes 2023-07-17 11:48:03 +01:00
Ebube 89c5936212 Some fixes 2023-07-17 11:29:50 +01:00
6 changed files with 67 additions and 61 deletions
+5 -2
View File
@@ -6,6 +6,7 @@ import { handlePagingFunc } from "../Pagination/HandlePagination";
import PaginatedList from "../Pagination/PaginatedList";
import familyImage from '../../assets/images/no-family-side.png'
import localImgLoad from "../../lib/localImgLoad";
export default function FamilyTable({ className, familyList, loader, popUpHandler }) {
const navigate = useNavigate();
@@ -54,6 +55,7 @@ export default function FamilyTable({ className, familyList, loader, popUpHandle
last_login,
task_count,
family_uid,
banner
} = props;
let addedDate = added?.split(" ")[0];
let LoginDate = last_login?.split(" ")[0];
@@ -64,9 +66,10 @@ export default function FamilyTable({ className, familyList, loader, popUpHandle
>
<td className=" py-4">
<div className="flex space-x-2 items-center w-full">
<div className="w-full h-[60px] rounded-full overflow-hidden flex justify-center items-center flex-[0.1] min-w-[60px]">
<div className="w-[60px] h-[60px] rounded-full overflow-hidden flex justify-center items-center flex-[0.1]">
<img
src={dataImage1}
// src={dataImage1}
src={localImgLoad(`images/icons/${banner}`)}
alt="data"
className="w-full h-full"
/>
@@ -1,7 +1,6 @@
import React from "react";
function CompleteConfirmCredit({ onClose, confirmCredit }) {
console.log(confirmCredit);
const { data } = confirmCredit;
return (
<div className="logout-modal-body w-full flex flex-col items-center">
@@ -53,38 +52,44 @@ function CompleteConfirmCredit({ onClose, confirmCredit }) {
<h1 className="text-xl font-semibold text-dark-gray dark:text-white tracking-tighter my-1">
{data?.result == "Charge success"
? "Credit was Successful!"
: data?.result}
: "Credit was Unsuccessful"}
</h1>
</div>
<div className="flex items-center gap-8">
<h1 className="text-xl font-bold text-dark-gray dark:text-white tracking-tighter my-1">
Amount({data?.currency || ""})
</h1>
<span className="text-xl font-bold text-dark-gray dark:text-white tracking-tighter my-1">
{`${data?.symbol || ""} ${
Number(data?.amount * 0.01).toLocaleString() || ""
}`}
</span>
</div>
{data?.internal_return >= 0 ? (
<>
<div className="flex items-center gap-8">
<h1 className="text-xl font-bold text-dark-gray dark:text-white tracking-tighter my-1">
Amount({data?.currency || ""})
</h1>
<span className="text-xl font-bold text-dark-gray dark:text-white tracking-tighter my-1">
{`${data?.symbol || ""} ${
Number(data?.amount * 0.01).toLocaleString() || ""
}`}
</span>
</div>
<div className="flex items-center gap-8">
<h1 className="text-xl font-bold text-dark-gray dark:text-white tracking-tighter my-1">
Wallet Balance
</h1>
<span className="text-xl font-bold text-dark-gray dark:text-white tracking-tighter my-1">
{data?.curr_balance}
</span>
</div>
<div className="flex items-center gap-8">
<h1 className="text-xl font-bold text-dark-gray dark:text-white tracking-tighter my-1">
Wallet Balance
</h1>
<span className="text-xl font-bold text-dark-gray dark:text-white tracking-tighter my-1">
{data?.curr_balance}
</span>
</div>
<div className="flex items-center gap-8">
<h1 className="text-xl font-bold text-dark-gray dark:text-white tracking-tighter my-1">
Confirmation Number
</h1>
<span className="text-xl font-bold text-dark-gray dark:text-white tracking-tighter my-1">
{data?.confirmation}
</span>
</div>
<div className="flex items-center gap-8">
<h1 className="text-xl font-bold text-dark-gray dark:text-white tracking-tighter my-1">
Confirmation Number
</h1>
<span className="text-xl font-bold text-dark-gray dark:text-white tracking-tighter my-1">
{data?.confirmation}
</span>
</div>
</>
) : (
<div className="h-[160px]"></div>
)}
</div>
</div>
</div>
@@ -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;
@@ -223,7 +223,7 @@ function ConfirmAddFund({
amount: amount * 100,
cardnumber: cardNum.replace(/\s/g, ""),
credit_reference,
cvc: cvv,
cvc: String(cvv).length === 1 ? `0${cvv}` : String(cvv),
description: address,
exp_month: expirationMonth,
exp_year: expirationYear,
@@ -269,7 +269,7 @@ function ConfirmAddFund({
acceptConfirm: { loader: false },
},
}));
setTimeout(() => onClose, 10000)
setTimeout(() => onClose, 10000);
console.log(error);
}
};
@@ -23,7 +23,7 @@ function ConfirmNairaWithdraw({ payment, wallet, action, situation, state }) {
const handleSubmit = () => {
setRequestStatus({ message: "", loading: true, status: false });
let reqData = {
amount: Number(state.amount),
amount: Number(state.amount * 100),
Fee: Number(state.fee),
recipientid: Number(state.recipientID),
};
@@ -58,14 +58,6 @@ function ConfirmNairaWithdraw({ payment, wallet, action, situation, state }) {
});
};
useEffect(() => {
// what happens if not state redirect user
if (!state) {
navigate("/my-wallet/withdraw-naira", { replace: true });
} else {
setPageLoading(false);
}
}, []);
return (
<ModalCom action={action} situation={situation}>
<div className="content-wrapper w-[90%] md:w-[600px]">
@@ -114,7 +106,7 @@ function ConfirmNairaWithdraw({ payment, wallet, action, situation, state }) {
label="Processing Fee:"
type="text"
name="processingFee"
value={state?.fee || ""}
value={(state?.fee * 0.01).toFixed(2) || ""}
disable={true}
/>
</div>
@@ -126,7 +118,7 @@ function ConfirmNairaWithdraw({ payment, wallet, action, situation, state }) {
label="Total"
type="text"
name="total"
value={state?.total || ""}
value={(state?.total * 0.01).toFixed(2) || ""}
disable={true}
/>
</div>
+14 -7
View File
@@ -24,13 +24,20 @@ const CreditPopup = ({ details, onClose, situation, walletItem }) => {
<div className="logout-modal-wrapper lw-[90%] md:w-[768px] h-full lg:h-auto bg-white dark:bg-dark-white lg:rounded-2xl overflow-y-auto">
<div className="logout-modal-header w-full flex items-center justify-between lg:p-6 px-[30px] py-[23px] border-b dark:border-[#5356fb29] border-light-purple">
<h1 className="text-26 font-bold text-dark-gray dark:text-white tracking-wide">
{confirmCredit?.show?.acceptConfirm?.loader
? "Confirming Credit..."
: confirmCredit?.show?.awaitConfirm?.state
? "Confirm Credit Add"
: confirmCredit?.show?.acceptConfirm?.state
? "Credit Add Completed"
: "Add Credit"}
{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"}
</>
)}
</h1>
<button
type="button"
@@ -28,24 +28,23 @@ const initialValues = {
function NairaWithdraw({ wallet, action, situation, setShowConfirmNairaWithdraw }) {
const apiCall = new usersService(); // API CLASS CALL
console.log('TESTING', wallet)
const navigate = useNavigate();
let [requestStatus, setRequestStatus] = useState(false);
let [recipients, setRecipients] = useState({
// FOR COUPON HISTORY
loading: true,
data: [],
error: false,
});
let [sendMoneyFee, setSendMoneyFee] = useState({
loading: false,
fee: 0,
total: 0,
}); // HOLD THE VALUE FOR SEND MONEY FEE
}); // HOLD THE VALUE FOR walletSEND MONEY FEE
//FUNCTION TO GET RECIPIENT LIST
const getRecipients = () => {
apiCall
@@ -76,7 +75,7 @@ console.log('TESTING', wallet)
return;
}
apiCall
.getSendMoneyFee(Number(amount))
.getSendMoneyFee(Number(amount * 100))
.then((res) => {
setSendMoneyFee({
loading: false,
@@ -88,7 +87,7 @@ console.log('TESTING', wallet)
setSendMoneyFee({ loading: false, fee: 0, total: 0 });
});
};
console.log('TESTING', sendMoneyFee)
//FUNCTION TO HANDLE SUBMIT
const handleSubmit = (values, helpers) => {
if (!values?.amount && !values.recipientID) return;
@@ -170,7 +169,7 @@ console.log('TESTING', wallet)
name="fee"
direction="rtl"
value={
sendMoneyFee.loading ? "loading" : sendMoneyFee.fee
sendMoneyFee.loading ? "loading" : (sendMoneyFee.fee * 0.01).toFixed(2)
}
disable={true}
/>
@@ -187,7 +186,7 @@ console.log('TESTING', wallet)
name="total"
direction="rtl"
value={
sendMoneyFee.loading ? "loading" : sendMoneyFee.total
sendMoneyFee.loading ? "loading" : (sendMoneyFee.total * 0.01).toFixed(2)
}
disable={true}
/>