Merge branch 'family-icon' of WrenchBoard/Users-Wrench into master

This commit is contained in:
2023-07-17 14:48:17 +00:00
committed by Gogs
3 changed files with 17 additions and 23 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"
/>
@@ -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>
@@ -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}
/>