Compare commits

...

14 Commits

Author SHA1 Message Date
victorAnumudu 2391857309 flex display changed to suit mac screen 2023-07-14 12:58:49 +01:00
ameye ea447a9366 Merge branch 'my_wallet_layout' of WrenchBoard/Users-Wrench into master 2023-07-13 23:09:01 +00:00
Ebube 4e2f120ab5 Few changes 2023-07-13 23:12:29 +01:00
Ebube 20ce9bf749 Consumed Start credit Api 2023-07-13 22:34:09 +01:00
ameye 04e1bcc5f1 Merge branch 'my_wallet_layout' of WrenchBoard/Users-Wrench into master 2023-07-13 19:38:17 +00:00
Ebube cbaa8b6f7b Merge branch 'master' of https://gitlab.chiefsoft.net/WrenchBoard/Users-Wrench into my_wallet_layout 2023-07-13 20:14:54 +01:00
ameye f6bdb1c299 Merge branch 'wallet-card' of WrenchBoard/Users-Wrench into master 2023-07-13 19:11:32 +00:00
Ebube d4061d72da . 2023-07-13 18:20:20 +01:00
Ebube 2d9a8b55b5 . 2023-07-13 18:16:52 +01:00
Ebube 920eafed29 . 2023-07-13 18:10:19 +01:00
Ebube 21d926eb5c Merge branch 'master' of https://gitlab.chiefsoft.net/WrenchBoard/Users-Wrench into my_wallet_layout 2023-07-13 18:08:23 +01:00
Ebube ec9d793d6b . 2023-07-13 18:07:05 +01:00
victorAnumudu 2fd04dc86d wallet card adjustment 2023-07-13 16:44:05 +01:00
ameye d7752cb70b Merge branch 'wallet-layout-fix' of WrenchBoard/Users-Wrench into master 2023-07-13 13:05:32 +00:00
12 changed files with 297 additions and 306 deletions
@@ -1,11 +1,18 @@
import { useCallback, useEffect, useMemo, useState } from "react";
import ModalCom from "../../Helpers/ModalCom";
import { useMemo, useState } from "react";
import { toast } from "react-toastify";
import usersService from "../../../services/UsersService";
import LoadingSpinner from "../../Spinners/LoadingSpinner";
import ModalCom from "../../Helpers/ModalCom";
import { PriceFormatter } from "../../Helpers/PriceFormatter";
import LoadingSpinner from "../../Spinners/LoadingSpinner";
const MarketPopUp = ({ details, onClose, situation, marketInt }) => {
const [textValue, setTextValue] = useState("");
const apiCall = useMemo(() => new usersService(), []);
const handleInputChange = ({ target: { value } }) => {
setTextValue(value);
};
const MarketCalls = (details) => {
const [marketMsg, setMarketMsg] = useState({
loading: false,
@@ -24,8 +31,8 @@ const MarketPopUp = ({ details, onClose, situation, marketInt }) => {
const MarketDetail = async () => {
try {
setMarketMsg({ loading: true });
if (!textValue) return;
setMarketMsg({ loading: true });
reqData.yourmessage = textValue;
@@ -87,22 +94,11 @@ const MarketPopUp = ({ details, onClose, situation, marketInt }) => {
}
};
// useEffect(() => {
// ManageInterest();
// }, []);
return { MarketDetail, ManageInterest, manageInt, marketMsg };
};
const [textValue, setTextValue] = useState("");
const handleInputChange = ({ target: { value } }) => {
setTextValue(value);
};
const apiCall = useMemo(() => new usersService(), []);
let { manageInt, ManageInterest, MarketDetail, marketMsg } = MarketCalls(details);
let { manageInt, ManageInterest, MarketDetail, marketMsg } =
MarketCalls(details);
let thePrice = PriceFormatter(
details?.price * 0.01,
@@ -270,9 +266,7 @@ const MarketPopUp = ({ details, onClose, situation, marketInt }) => {
Interest: <b className="ml-1">{details.interest_count}</b>
</p>
<hr />
<p className="my-1">
Expire: {details.expire}
</p>
<p className="my-1">Expire: {details.expire}</p>
</div>
</div>
<button
+111 -97
View File
@@ -1,48 +1,52 @@
import React, {useState} from 'react'
import RecentActivityTable from './WalletComponent/RecentActivityTable'
import LoadingSpinner from '../Spinners/LoadingSpinner'
import { useNavigate, useLocation } from 'react-router-dom'
import InputCom from '../Helpers/Inputs/InputCom'
import React, { useState } from "react";
import { useLocation, useNavigate } from "react-router-dom";
import InputCom from "../Helpers/Inputs/InputCom";
import LoadingSpinner from "../Spinners/LoadingSpinner";
import RecentActivityTable from "./WalletComponent/RecentActivityTable";
import AddFundDollars from './AddFundDollars'
import AddFundDollars from "./AddFundDollars";
function AddFund({payment}) {
const navigate = useNavigate()
const {currency} = useLocation()?.state //GETS THE USER CURRENCY FOR ADD FUND
function AddFund({ payment }) {
const navigate = useNavigate();
const { currency } = useLocation()?.state; //GETS THE USER CURRENCY FOR ADD FUND
//STATE FOR CONTROLLED INPUT
let [input, setInput] = useState('')
//STATE FOR CONTROLLED INPUT
let [input, setInput] = useState("");
let [inputError, setInputError] = useState('')
let [inputError, setInputError] = useState("");
// FUNCTION TO HANDLE INPUT CHANGE
const handleChange = ({target:{name, value}}) => {
setInput(value)
// FUNCTION TO HANDLE INPUT CHANGE
const handleChange = ({ target: { name, value } }) => {
setInput(value);
};
//FUNCTION TO HANDLE SUBMIT
const handleSubmit = () => {
setInputError("");
if (!input || input == "0") {
setInputError("Please Enter Amount");
return setTimeout(() => {
setInputError("");
}, 5000);
}
//FUNCTION TO HANDLE SUBMIT
const handleSubmit = () => {
setInputError('')
if(!input || input == '0'){
setInputError('Please Enter Amount')
return setTimeout(()=>{setInputError('')}, 5000)
}
if(isNaN(input)){
setInputError('Amount must be a Number')
return setTimeout(()=>{setInputError('')}, 5000)
}
const stateData = {amount: Number(input), currency: 'naira'}
navigate('confirm-add-fund', {state: stateData})
setInput('')
if (isNaN(input)) {
setInputError("Amount must be a Number");
return setTimeout(() => {
setInputError("");
}, 5000);
}
return (
<div>
{/* heading */}
{/* <div className="sm:flex justify-between items-center mb-6">
const stateData = { amount: Number(input), currency: "naira" };
navigate("confirm-add-fund", { state: stateData });
setInput("");
};
return (
<div>
{/* heading */}
{/* <div className="sm:flex justify-between items-center mb-6">
<div className="w-full flex justify-start space-x-3 items-center">
<button
type="button"
@@ -73,68 +77,78 @@ function AddFund({payment}) {
</div>
</div> */}
<div className="content-wrapper w-full lg:flex xl:space-x-8 lg:space-x-4 bottomMargin">
<div className="lg:w-2/2 w-full mb-10 lg:mb-0">
<div className="add-fund w-full bg-white dark:bg-dark-white rounded-2xl shadow">
{/*<h2 className='md:p-8 p-4 text-slate-900 dark:text-white text-xl lg:text-2xl font-medium'>Add Credit with Account Deposit</h2>*/}
{/*<hr />*/}
<form className='md:p-8 p-4 add-fund-info'>
<div className="field w-full mb-6">
<InputCom
fieldClass="px-6"
label={currency == 'US Dollars' ? "Amount (USD)" : "Amount (Naira)"}
type="text"
name="amount"
placeholder="0"
value={input}
inputHandler={handleChange}
/>
{inputError && <p className='text-base text-red-500'>{inputError}</p>}
</div>
</form>
<hr />
<div className="content-wrapper w-full lg:flex xl:space-x-8 lg:space-x-4 bottomMargin">
<div className="lg:w-2/2 w-full mb-10 lg:mb-0">
<div className="add-fund w-full bg-white dark:bg-dark-white rounded-2xl shadow">
{/*<h2 className='md:p-8 p-4 text-slate-900 dark:text-white text-xl lg:text-2xl font-medium'>Add Credit with Account Deposit</h2>*/}
{/*<hr />*/}
<form className="md:p-8 p-4 add-fund-info">
<div className="field w-full mb-6">
<InputCom
fieldClass="px-6"
label={
currency == "US Dollars" ? "Amount (USD)" : "Amount (Naira)"
}
type="text"
name="amount"
placeholder="0"
value={input}
inputHandler={handleChange}
/>
{inputError && (
<p className="text-base text-red-500">{inputError}</p>
)}
</div>
</form>
<hr />
{/* SHOWS THIS IF USER CURRENCY IS DOLLARS */}
{currency == 'US Dollars' &&
<div className='w-full md:p-8 p-4 bg-white dark:bg-dark-white rounded-2xl shadow'>
<AddFundDollars setInputError={setInputError} input={input} setInput={setInput} />
</div>
}
{/* SHOWS THIS IF USER CURRENCY IS DOLLARS */}
{currency == "US Dollars" && (
<div className="w-full md:p-8 p-4 bg-white dark:bg-dark-white rounded-2xl shadow">
<AddFundDollars
setInputError={setInputError}
input={input}
setInput={setInput}
/>
</div>
)}
{/* HIDES THIS BUTTON IF CURENCY IS NAIRA */}
{currency != 'US Dollars' &&
<div className='md:p-8 p-4 add-fund-btn flex justify-end items-center py-4'>
<button
onClick={handleSubmit}
type="button"
className="px-2 py-1 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
>
<span className="text-white">Continue</span>
</button>
</div>
}
</div>
</div>
</div>
{/* HIDES THIS SECTION IF CURENCY IS NAIRA */}
{currency != 'US Dollars' &&
<div className="content-wrapper w-full lg:flex xl:space-x-8 lg:space-x-4 bottomMargin">
<div className="lg:w-2/2 w-full mb-10 lg:mb-0">
<div className="wallet w-full md:p-8 p-4 h-full min-h-[590px] bg-white dark:bg-dark-white rounded-2xl shadow">
<h2 className='text-gray-900 dark:text-white text-xl lg:text-2xl font-medium'>Recent Activity</h2>
{/* <p className='text-base text-gray-600 dark:text-white'>Activity Report</p> */}
{payment.loading ?
<LoadingSpinner size='16' color='sky-blue' />
:
<RecentActivityTable payment={payment}/>
}
</div>
</div>
</div>
}
{/* HIDES THIS BUTTON IF CURENCY IS NAIRA */}
{currency != "US Dollars" && (
<div className="md:p-8 p-4 add-fund-btn flex justify-end items-center py-4">
<button
onClick={handleSubmit}
type="button"
className="px-2 py-1 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
>
<span className="text-white">Continue</span>
</button>
</div>
)}
</div>
</div>
)
</div>
{/* HIDES THIS SECTION IF CURENCY IS NAIRA */}
{currency != "US Dollars" && (
<div className="content-wrapper w-full lg:flex xl:space-x-8 lg:space-x-4 bottomMargin">
<div className="lg:w-2/2 w-full mb-10 lg:mb-0">
<div className="wallet w-full md:p-8 p-4 h-full min-h-[590px] bg-white dark:bg-dark-white rounded-2xl shadow">
<h2 className="text-gray-900 dark:text-white text-xl lg:text-2xl font-medium">
Recent Activity
</h2>
{/* <p className='text-base text-gray-600 dark:text-white'>Activity Report</p> */}
{payment.loading ? (
<LoadingSpinner size="16" color="sky-blue" />
) : (
<RecentActivityTable payment={payment} />
)}
</div>
</div>
</div>
)}
</div>
);
}
export default AddFund
export default AddFund;
+2 -3
View File
@@ -103,6 +103,7 @@ function AddFundDollars(props) {
amount: Number(props.input),
currency: props.currency,
card: prevCardDetails["payment-card"],
cardType: "prev",
};
return setTimeout(() => {
@@ -132,9 +133,7 @@ function AddFundDollars(props) {
});
}, []);
console.log(props)
const handleClose = props.onClose
const handleClose = props.onClose;
return (
<>
+54 -51
View File
@@ -1,54 +1,71 @@
import React, { useState } from "react";
import { useNavigate } from "react-router-dom";
import usersService from "../../services/UsersService";
import Icons from "../Helpers/Icons";
import InputCom from "../Helpers/Inputs/InputCom";
import LoadingSpinner from "../Spinners/LoadingSpinner";
import AddFundDollars from "./AddFundDollars";
function AddFundPop({ _payment, input, setInput, onClose, setConfirmCredit }) {
const navigate = useNavigate();
// const { currency } = useLocation()?.state; //GETS THE USER CURRENCY FOR ADD FUND
const apiCall = new usersService();
let { payment, currency } = _payment;
const { payment, currency } = _payment;
//STATE FOR CONTROLLED INPUT
let [inputError, setInputError] = useState("");
const [inputError, setInputError] = useState("");
const [loader, setLoader] = useState(false);
// FUNCTION TO HANDLE INPUT CHANGE
const handleChange = ({ target: { name, value } }) => {
setInput(value);
};
//FUNCTION TO HANDLE SUBMIT
const handleSubmit = (e) => {
e.preventDefault();
const handleSubmit = async () => {
setInputError("");
if (!input || input == "0") {
setLoader(true);
if (!input || input === "0") {
setLoader(false);
setInputError("Please Enter Amount");
return setTimeout(() => {
setInputError("");
}, 5000);
setTimeout(() => setInputError(""), 5000);
return;
}
if (isNaN(input)) {
setLoader(false);
setInputError("Amount must be a Number");
return setTimeout(() => {
setInputError("");
}, 5000);
setTimeout(() => setInputError(""), 5000);
return;
}
const stateData = {
let stateData = {
amount: Number(input),
currency: currency,
currency: currency.toUpperCase(),
};
return setTimeout(
() =>
try {
const res = await apiCall.getStartCredit(stateData);
if (res.data.internal_return < 0) {
setLoader(false);
setInputError("An Error Occurred");
setTimeout(() => setInputError(""), 5000);
return;
}
const _response = res.data;
stateData.amount = Number(input);
stateData.currency = currency;
stateData = { ...stateData, ..._response };
setTimeout(() => {
setLoader(false);
setConfirmCredit({
show: true,
data: stateData,
}),
1500
);
});
}, 1500);
} catch (error) {
console.log(error);
}
};
return (
@@ -56,8 +73,6 @@ function AddFundPop({ _payment, input, setInput, onClose, setConfirmCredit }) {
<div className="content-wrapper w-full lg:flex xl:space-x-8 lg:space-x-4 bottomMargin">
<div className="lg:w-2/2 w-full mb-10 lg:mb-0">
<div className="add-fund w-full bg-white dark:bg-dark-white rounded-2xl">
{/*<h2 className='md:p-8 p-4 text-slate-900 dark:text-white text-xl lg:text-2xl font-medium'>Add Credit with Account Deposit</h2>*/}
{/*<hr />*/}
<form className="md:px-8 md:pt-4 px-4 pt-2 add-fund-info flex items-center gap-[2.1rem]">
<h1 className="text-xl font-bold text-dark-gray dark:text-white tracking-tighter my-1">
Amount({currency})
@@ -77,8 +92,7 @@ function AddFundPop({ _payment, input, setInput, onClose, setConfirmCredit }) {
</div>
</form>
{/* SHOWS THIS IF USER CURRENCY IS DOLLARS */}
{currency == "US Dollars" && (
{currency === "US Dollars" && (
<div className="w-full md:px-8 md:pt-4 px-4 pt-2 bg-white dark:bg-dark-white rounded-2xl">
<AddFundDollars
setInputError={setInputError}
@@ -91,12 +105,12 @@ function AddFundPop({ _payment, input, setInput, onClose, setConfirmCredit }) {
</div>
)}
{currency != "US Dollars" && <div className="h-[18rem]"></div>}
{/* HIDES THIS BUTTON IF CURENCY IS NAIRA */}
{currency != "US Dollars" && (
{currency !== "US Dollars" && <div className="h-[18rem]"></div>}
{currency !== "US Dollars" && (
<div className="md:p-8 p-4 add-fund-btn flex justify-end items-center py-4 gap-4">
<button
className="px-2 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
className="px-4 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
onClick={onClose}
>
Cancel
@@ -104,33 +118,22 @@ function AddFundPop({ _payment, input, setInput, onClose, setConfirmCredit }) {
<button
onClick={handleSubmit}
type="button"
className="px-2 py-1 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
className="px-4 py-1 h-11 flex justify-center space-x-1 items-center btn-gradient text-base rounded-full text-white max-w-[100px] w-full"
>
<span className="text-white">Continue</span>
{loader ? (
<LoadingSpinner size="6" color="sky-blue" />
) : (
<>
<span className="text-white">Continue</span>{" "}
<Icons name="chevron-right" />
</>
)}
</button>
</div>
)}
</div>
</div>
</div>
{/* HIDES THIS SECTION IF CURENCY IS NAIRA */}
{currency != "US Dollars" &&
// <div className="content-wrapper w-full lg:flex xl:space-x-8 lg:space-x-4 bottomMargin">
// <div className="lg:w-2/2 w-full mb-10 lg:mb-0">
// <div className="wallet w-full md:p-8 p-4 h-full min-h-[590px] bg-white dark:bg-dark-white rounded-2xl shadow">
// <h2 className="text-gray-900 dark:text-white text-xl lg:text-2xl font-medium">
// Recent Activity
// </h2>
// {/* <p className='text-base text-gray-600 dark:text-white'>Activity Report</p> */}
// {payment?.loading ? (
// <LoadingSpinner size="16" color="sky-blue" />
// ) : (
// <RecentActivityTable payment={payment} />
// )}
// </div>
// </div>
// </div>
null}
</div>
);
}
+56 -47
View File
@@ -2,13 +2,16 @@ import React, { useState } from "react";
import { useSelector } from "react-redux";
import { useNavigate } from "react-router-dom";
import { toast } from "react-toastify";
import InputCom from "../Helpers/Inputs/InputCom";
import usersService from "../../services/UsersService";
import { FlutterWaveButton, closePaymentModal } from "flutterwave-react-v3";
function ConfirmAddFund({ confirmCredit, onClose, walletItem }) {
const __confirmData = confirmCredit?.data;
const __confirmCardDetails = __confirmData.card
? JSON.parse(__confirmData.card)
: "";
let { userDetails } = useSelector((state) => state.userDetails); // TO GET LOGGEDIN USER DETAILS
let [pageLoading, setPageLoading] = useState(true);
@@ -87,18 +90,11 @@ function ConfirmAddFund({ confirmCredit, onClose, walletItem }) {
onClose: () => {},
};
// useEffect(() => {
// // what happens if not data redirect user
// if (!data) {
// navigate("/my-wallet/add-fund", { replace: true });
// } else {
// setPageLoading(false);
// }
// }, []);
const handlePrevCard = () => {
console.log("Test me")
}
const __confirmCard = confirmCredit?.data.card
? JSON.parse(confirmCredit?.data.card)
: "";
const ThePaymentText = ({ value }) => (
<div className="my-2 flex items-center gap-5">
@@ -113,61 +109,63 @@ function ConfirmAddFund({ confirmCredit, onClose, walletItem }) {
</div>
);
// console.log(confirmCredit);
return (
<div className="content-wrapper w-full h-[32rem]">
<div className="w-full mb-10">
<div className="add-fund w-full bg-white dark:bg-dark-white rounded-2xl">
{/* <h2 className="md:p-8 p-4 text-slate-900 dark:text-white text-xl lg:text-2xl font-medium">
Confirm Add Fund To Account
</h2>
<hr /> */}
<div className="px-4 md:p-8 py-4 add-fund-info">
<div className="field w-full mb-3 min-h-[45px]">
{confirmCredit?.show ? (
<div className="flex flex-col gap-4">
<div className="flex items-center gap-4">
<h1 className="text-xl font-bold text-dark-gray dark:text-white tracking-tighter my-1">
Amount({confirmCredit?.data?.currency})
Amount({__confirmData?.currency})
</h1>
<span className="text-xl font-bold text-dark-gray dark:text-white tracking-tighter my-1">
{`${walletItem?.symbol} ${
Number(confirmCredit?.data?.amount).toLocaleString() ||
""
Number(__confirmData?.amount).toLocaleString() || ""
}`}
</span>
</div>
<div className="flex items-center gap-4">
{/* <h1 className="text-xl font-bold text-dark-gray dark:text-white tracking-tighter my-1"> */}
<label
htmlFor="payment"
className="text-xl font-bold text-dark-gray dark:text-white tracking-tighter my-1"
>
{confirmCredit?.data?.currency && "Payment Method:"}
</label>
<span className="text-[#181c32] dark:text-white ">
{__confirmCard ? (
<ThePaymentText value={__confirmCard} />
) : null}
{__confirmData?.currency == "US Dollars" && (
<div className="flex items-center gap-8">
<label
htmlFor="payment"
className="text-xl font-bold text-dark-gray dark:text-white tracking-tighter my-1"
>
{__confirmData?.currency && "Payment Method"}
</label>
<span className="text-[#181c32] dark:text-white ">
{__confirmCardDetails ? (
<ThePaymentText value={__confirmCardDetails} />
) : null}
</span>
</div>
)}
<div
className={`${
__confirmData?.currency == "US Dollars"
? "gap-14"
: "gap-6"
} flex items-center`}
>
<h1 className="text-xl font-bold text-dark-gray dark:text-white tracking-tighter my-1">
Reference No
</h1>
<span className="text-xl font-bold text-dark-gray dark:text-white tracking-tighter my-1">
{__confirmCardDetails?.card_uid ||
__confirmData?.credit_reference}
</span>
</div>
</div>
) : (
<InputCom
fieldClass="px-6"
label={` Amount${confirmCredit?.data?.currency}`}
type="text"
name="amount"
value={confirmCredit?.data?.amount || ""}
disable={true}
/>
)}
) : null}
</div>
</div>
{/* <h1 className="mb-2 text-xl font-bold text-dark-gray dark:text-white px-4 h-5">
{confirmCredit?.data?.currency && "Payment Method"}
</h1> */}
{/* <hr /> */}
<div className="min-h-[220px]"></div>
<div className={__confirmData?.currency == "US Dollars" ? "min-h-[163px]":"min-h-[200px]"}></div>
<div className="md:p-8 p-4 add-fund-btn flex justify-end items-center py-4 gap-4">
<button
className="px-4 h-11 flex justify-center items-center border-gradient text-base rounded-full"
@@ -175,8 +173,19 @@ function ConfirmAddFund({ confirmCredit, onClose, walletItem }) {
>
Cancel
</button>
{confirmCredit?.data?.currency == "Naira" && (
{__confirmData?.currency == "US Dollars" && (
<button
className="px-4 h-11 flex justify-center items-center btn-gradient text-white text-base rounded-full"
onClick={
__confirmData?.cardType === "prev"
? handlePrevCard
: () => console.log("Test me")
}
>
Proceed
</button>
)}
{__confirmData?.currency == "Naira" && (
<FlutterWaveButton
{...fwConfig}
className="px-2 py-1 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
@@ -19,19 +19,6 @@ const CreditPopup = ({ details, onClose, situation, walletItem }) => {
data: {},
});
// const openConfirmCredit = (value) => {
// setConfirmCredit({ show: true, data: { ...value } });
// };
// const closeConfirmCredit = () => {
// setConfirmCredit({ show: false, data: {} });
// };
// const handleConfirmCredit = useMemo((input) => {
// if (input) {
// setConfirmCredit(true);
// } else setConfirmCredit(false);
// }, []);
const switchNextStep = ({ target: value }) => {
setSuggestedNextStep(value);
};
+1 -1
View File
@@ -3,7 +3,7 @@ import { Link } from 'react-router-dom';
function WalletAction({walletItem, payment, openPopUp}) {
return (
<div className="counters flex justify-between gap-2">
<div className="counters w-full flex justify-between gap-2">
<div className='w-1/2 flex justify-center items-center'>
<Link
to="transfer-fund"
+2 -6
View File
@@ -1,7 +1,3 @@
import CurrencyStaticsSection from "./CurrencyStaticsSection";
import CurrentBalanceWidget from "./CurrentBalanceWidget";
import InvestmentSection from "./InvestmentSection";
import RecentTransactionWidget from "./RecentTransactionWidget";
import LoadingSpinner from "../Spinners/LoadingSpinner";
import WalletItemCard from "./WalletItemCard";
@@ -10,14 +6,14 @@ export default function WalletBox({ wallet, coupon, payment }) {
<>
<div className="my-wallet-wrapper w-full mb-10">
<div className="main-wrapper w-full">
<div className="balance-inquery w-full flex flex-wrap justify-center gap-2">
<div className="balance-inquery w-full lg:grid grid-cols-[repeat(auto-fill,_minmax(325px,_1fr))] gap-5 mb-11 h-[22rem]">
{wallet.loading ? (
<div className="w-full h-full flex items-center justify-center">
<LoadingSpinner size="16" color="sky-blue" />
</div>
) : wallet.data.length ? (
wallet.data.map((item, index) => (
<div className="w-[350px] h-full flex justify-center">
<div className="lg:w-full h-full mb-10 lg:mb-0">
<WalletItemCard walletItem={item} payment={payment} />
</div>
))
+43 -66
View File
@@ -1,10 +1,9 @@
import React, { useState } from "react";
import background from "../../assets/images/bg-sky-blue.jpg"; //shape/balance-bg.svg";
import { PriceFormatter } from "../Helpers/PriceFormatter";
import { Link } from "react-router-dom";
import { useSelector } from "react-redux";
import CreditPopup from "./Popup/CreditPopup";
import background from "../../assets/images/bg-sky-blue.jpg"; //shape/balance-bg.svg";
import localImgLoad from "../../lib/localImgLoad";
import { PriceFormatter } from "../Helpers/PriceFormatter";
import CreditPopup from "./Popup/CreditPopup";
import WalletAction from "./WalletAction";
export default function WalletItemCard({ walletItem, payment }) {
@@ -29,83 +28,61 @@ export default function WalletItemCard({ walletItem, payment }) {
setCreditPopup({ show: false, data: {} });
};
console.log("walletItem >>", walletItem, payment);
let image = walletItem.code ? `${walletItem.code.toLocaleLowerCase()}.svg` : 'default.png' // HOLDS THE VALUE NAME PROPERTY FOR IMAGE ICON
let image = walletItem.code
? `${walletItem.code.toLocaleLowerCase()}.svg`
: "default.png"; // HOLDS THE VALUE NAME PROPERTY FOR IMAGE ICON
return (
<>
<div
className={`current-balance-widget w-[350px] h-full rounded-2xl overflow-hidden flex flex-col gap-2 px-8 pt-9 pb-20`}
className={`current-balance-widget w-full h-full rounded-2xl overflow-hidden flex flex-col items-center gap-2 px-8 pt-9 pb-20`}
style={{
background: `url(${background}) 0% 0% / cover no-repeat`,
}}
>
<div className="wallet xxs:flex justify-between items-start gap-3">
<div className="min-w-[100px] min-h-[100px] max-w-[100px] max-h-[100px] rounded-full bg-[#e3e3e3] flex justify-center items-center">
<img src={localImgLoad(`images/currency/${image}`)} className="w-full h-full" alt="curreny-icon" />
{/* <div className="w-[350px]"> */}
<div className="wallet w-full flex justify-between items-start gap-3">
<div className="min-w-[100px] min-h-[100px] max-w-[100px] max-h-[100px] rounded-full bg-[#e3e3e3] flex justify-center items-center">
<img src={localImgLoad(`images/currency/${image}`)} className="w-full h-full" alt="curreny-icon" />
</div>
<div className="balance w-full mt-2 flex justify-center">
<div className="">
<p className="text-lg text-white opacity-[70%] tracking-wide mb-6">
Current Balance
</p>
<p className="text-[44px] font-bold text-white tracking-wide leading-10 mb-2">
{PriceFormatter(
walletItem.amount * 0.01,
walletItem.code,
undefined,
"text-[2rem]"
)}
</p>
</div>
</div>
</div>
<div className="balance mt-2">
<p className="text-lg text-white opacity-[70%] tracking-wide mb-6">
Current Balance
</p>
<p className="text-[44px] font-bold text-white tracking-wide leading-10 mb-2">
<p className="my-5 text-lg text-white tracking-wide flex justify-center items-center gap-2">
HOLDINGS :{" "}
<span className="mt-1">
{PriceFormatter(
walletItem.amount * 0.01,
walletItem.escrow * 0.01,
walletItem.code,
undefined,
"text-[2rem]"
)}
</p>
<p className="xxs:-ml-5 mt-10 mb-5 text-lg text-white tracking-wide flex justify-start items-center gap-2">
HOLDINGS :{" "}
<span className="mt-1">
{PriceFormatter(
walletItem.escrow * 0.01,
walletItem.code,
undefined,
"text-[2rem]"
)}
</span>
</p>
</div>
</div>
{/* <div className="flex justify-center items-center">
<div className="balance">
<p className="text-lg text-white opacity-[70%] tracking-wide mb-6">
Current Balance
</p>
<p className="text-[44px] font-bold text-white tracking-wide leading-10 mb-2">
{PriceFormatter(
walletItem.amount * 0.01,
walletItem.code,
undefined,
"text-[2rem]"
)}
</p>
<p className="text-lg text-white tracking-wide">
HOLDINGS :{" "}
<span className="mt-1">
{PriceFormatter(
walletItem.escrow * 0.01,
walletItem.code,
undefined,
"text-[2rem]"
)}
</span>
</p>
</div>
</div> */}
</span>
</p>
{/* for white underline */}
<div className="my-2 w-full h-[1px] bg-white"></div>
{/* for white underline */}
<div className="my-2 w-full h-[1px] bg-white"></div>
{!accountType ? (
<WalletAction walletItem={walletItem} payment={payment} openPopUp={openPopUp} />
)
:
null
}
{!accountType ? (
<WalletAction walletItem={walletItem} payment={payment} openPopUp={openPopUp} />
)
:
null
}
{/* </div> */}
</div>
{creditPopup.show && (
<CreditPopup
@@ -40,7 +40,7 @@ export default function ChangePasswordTab() {
};
return (
<div className="changePasswordTab w-full">
<div className="w-full flex xl:flex-row flex-col-reverse space-x-5 xl:items-center">
<div className="w-full flex xxl:flex-row flex-col-reverse space-x-5 xl:items-center">
<div className="flex-1 mb-10">
<div className="input-field mb-6">
<label
+11
View File
@@ -216,6 +216,17 @@ class usersService {
return this.postAuxEnd("/sendmoneyfee", postData);
}
getStartCredit(value) {
var postData = {
uid: localStorage.getItem("uid"),
member_id: localStorage.getItem("member_id"),
sessionid: localStorage.getItem("session_token"),
action: 11053,
...value
};
return this.postAuxEnd("/startcredit", postData);
}
getFamilySampleTasks() {
var postData = {
uid: localStorage.getItem("uid"),
+2 -1
View File
@@ -21,7 +21,8 @@ module.exports = {
'alice-blue': '#f0f8ff'
},
screens:{
xxs: '400px'
xxs: '400px',
xxl:'1900px'
}
},
},