Merge branch 'family-icon' of WrenchBoard/Users-Wrench into master
This commit is contained in:
@@ -6,6 +6,7 @@ import { handlePagingFunc } from "../Pagination/HandlePagination";
|
|||||||
import PaginatedList from "../Pagination/PaginatedList";
|
import PaginatedList from "../Pagination/PaginatedList";
|
||||||
|
|
||||||
import familyImage from '../../assets/images/no-family-side.png'
|
import familyImage from '../../assets/images/no-family-side.png'
|
||||||
|
import localImgLoad from "../../lib/localImgLoad";
|
||||||
|
|
||||||
export default function FamilyTable({ className, familyList, loader, popUpHandler }) {
|
export default function FamilyTable({ className, familyList, loader, popUpHandler }) {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
@@ -54,6 +55,7 @@ export default function FamilyTable({ className, familyList, loader, popUpHandle
|
|||||||
last_login,
|
last_login,
|
||||||
task_count,
|
task_count,
|
||||||
family_uid,
|
family_uid,
|
||||||
|
banner
|
||||||
} = props;
|
} = props;
|
||||||
let addedDate = added?.split(" ")[0];
|
let addedDate = added?.split(" ")[0];
|
||||||
let LoginDate = last_login?.split(" ")[0];
|
let LoginDate = last_login?.split(" ")[0];
|
||||||
@@ -64,9 +66,10 @@ export default function FamilyTable({ className, familyList, loader, popUpHandle
|
|||||||
>
|
>
|
||||||
<td className=" py-4">
|
<td className=" py-4">
|
||||||
<div className="flex space-x-2 items-center w-full">
|
<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
|
<img
|
||||||
src={dataImage1}
|
// src={dataImage1}
|
||||||
|
src={localImgLoad(`images/icons/${banner}`)}
|
||||||
alt="data"
|
alt="data"
|
||||||
className="w-full h-full"
|
className="w-full h-full"
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ function ConfirmNairaWithdraw({ payment, wallet, action, situation, state }) {
|
|||||||
const handleSubmit = () => {
|
const handleSubmit = () => {
|
||||||
setRequestStatus({ message: "", loading: true, status: false });
|
setRequestStatus({ message: "", loading: true, status: false });
|
||||||
let reqData = {
|
let reqData = {
|
||||||
amount: Number(state.amount),
|
amount: Number(state.amount * 100),
|
||||||
Fee: Number(state.fee),
|
Fee: Number(state.fee),
|
||||||
recipientid: Number(state.recipientID),
|
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 (
|
return (
|
||||||
<ModalCom action={action} situation={situation}>
|
<ModalCom action={action} situation={situation}>
|
||||||
<div className="content-wrapper w-[90%] md:w-[600px]">
|
<div className="content-wrapper w-[90%] md:w-[600px]">
|
||||||
@@ -114,7 +106,7 @@ function ConfirmNairaWithdraw({ payment, wallet, action, situation, state }) {
|
|||||||
label="Processing Fee:"
|
label="Processing Fee:"
|
||||||
type="text"
|
type="text"
|
||||||
name="processingFee"
|
name="processingFee"
|
||||||
value={state?.fee || ""}
|
value={(state?.fee * 0.01).toFixed(2) || ""}
|
||||||
disable={true}
|
disable={true}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@@ -126,7 +118,7 @@ function ConfirmNairaWithdraw({ payment, wallet, action, situation, state }) {
|
|||||||
label="Total"
|
label="Total"
|
||||||
type="text"
|
type="text"
|
||||||
name="total"
|
name="total"
|
||||||
value={state?.total || ""}
|
value={(state?.total * 0.01).toFixed(2) || ""}
|
||||||
disable={true}
|
disable={true}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -28,24 +28,23 @@ const initialValues = {
|
|||||||
|
|
||||||
function NairaWithdraw({ wallet, action, situation, setShowConfirmNairaWithdraw }) {
|
function NairaWithdraw({ wallet, action, situation, setShowConfirmNairaWithdraw }) {
|
||||||
const apiCall = new usersService(); // API CLASS CALL
|
const apiCall = new usersService(); // API CLASS CALL
|
||||||
console.log('TESTING', wallet)
|
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
||||||
let [requestStatus, setRequestStatus] = useState(false);
|
let [requestStatus, setRequestStatus] = useState(false);
|
||||||
|
|
||||||
let [recipients, setRecipients] = useState({
|
let [recipients, setRecipients] = useState({
|
||||||
// FOR COUPON HISTORY
|
// FOR COUPON HISTORY
|
||||||
loading: true,
|
loading: true,
|
||||||
data: [],
|
data: [],
|
||||||
error: false,
|
error: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
let [sendMoneyFee, setSendMoneyFee] = useState({
|
let [sendMoneyFee, setSendMoneyFee] = useState({
|
||||||
loading: false,
|
loading: false,
|
||||||
fee: 0,
|
fee: 0,
|
||||||
total: 0,
|
total: 0,
|
||||||
}); // HOLD THE VALUE FOR SEND MONEY FEE
|
}); // HOLD THE VALUE FOR walletSEND MONEY FEE
|
||||||
|
|
||||||
//FUNCTION TO GET RECIPIENT LIST
|
//FUNCTION TO GET RECIPIENT LIST
|
||||||
const getRecipients = () => {
|
const getRecipients = () => {
|
||||||
apiCall
|
apiCall
|
||||||
@@ -76,7 +75,7 @@ console.log('TESTING', wallet)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
apiCall
|
apiCall
|
||||||
.getSendMoneyFee(Number(amount))
|
.getSendMoneyFee(Number(amount * 100))
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
setSendMoneyFee({
|
setSendMoneyFee({
|
||||||
loading: false,
|
loading: false,
|
||||||
@@ -88,7 +87,7 @@ console.log('TESTING', wallet)
|
|||||||
setSendMoneyFee({ loading: false, fee: 0, total: 0 });
|
setSendMoneyFee({ loading: false, fee: 0, total: 0 });
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
console.log('TESTING', sendMoneyFee)
|
||||||
//FUNCTION TO HANDLE SUBMIT
|
//FUNCTION TO HANDLE SUBMIT
|
||||||
const handleSubmit = (values, helpers) => {
|
const handleSubmit = (values, helpers) => {
|
||||||
if (!values?.amount && !values.recipientID) return;
|
if (!values?.amount && !values.recipientID) return;
|
||||||
@@ -170,7 +169,7 @@ console.log('TESTING', wallet)
|
|||||||
name="fee"
|
name="fee"
|
||||||
direction="rtl"
|
direction="rtl"
|
||||||
value={
|
value={
|
||||||
sendMoneyFee.loading ? "loading" : sendMoneyFee.fee
|
sendMoneyFee.loading ? "loading" : (sendMoneyFee.fee * 0.01).toFixed(2)
|
||||||
}
|
}
|
||||||
disable={true}
|
disable={true}
|
||||||
/>
|
/>
|
||||||
@@ -187,7 +186,7 @@ console.log('TESTING', wallet)
|
|||||||
name="total"
|
name="total"
|
||||||
direction="rtl"
|
direction="rtl"
|
||||||
value={
|
value={
|
||||||
sendMoneyFee.loading ? "loading" : sendMoneyFee.total
|
sendMoneyFee.loading ? "loading" : (sendMoneyFee.total * 0.01).toFixed(2)
|
||||||
}
|
}
|
||||||
disable={true}
|
disable={true}
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in New Issue
Block a user