Compare commits
25 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2391857309 | |||
| ea447a9366 | |||
| 4e2f120ab5 | |||
| 20ce9bf749 | |||
| 04e1bcc5f1 | |||
| cbaa8b6f7b | |||
| f6bdb1c299 | |||
| d4061d72da | |||
| 2d9a8b55b5 | |||
| 920eafed29 | |||
| 21d926eb5c | |||
| ec9d793d6b | |||
| 2fd04dc86d | |||
| d7752cb70b | |||
| dc592f60db | |||
| 675ba2989e | |||
| b201224fd6 | |||
| c24013eefd | |||
| 234f04ca8f | |||
| 5f222a2d88 | |||
| 258434a109 | |||
| ed148612a7 | |||
| 2287fb5ebb | |||
| ead7589c92 | |||
| 51bb8fc421 |
Binary file not shown.
|
After Width: | Height: | Size: 24 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 19 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 24 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 19 KiB |
@@ -63,7 +63,7 @@ export default function InputCom({
|
|||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
{/* displays error is any */}
|
{/* displays error is any */}
|
||||||
{error && <span className="text-[12px] text-red-500">{error}</span>}
|
{error && <span className="text-[12px] text-red-500 italic">{error}</span>}
|
||||||
</label>
|
</label>
|
||||||
)}
|
)}
|
||||||
{forgotPassword && (
|
{forgotPassword && (
|
||||||
|
|||||||
@@ -1,11 +1,18 @@
|
|||||||
import { useCallback, useEffect, useMemo, useState } from "react";
|
import { useMemo, useState } from "react";
|
||||||
import ModalCom from "../../Helpers/ModalCom";
|
|
||||||
import { toast } from "react-toastify";
|
import { toast } from "react-toastify";
|
||||||
import usersService from "../../../services/UsersService";
|
import usersService from "../../../services/UsersService";
|
||||||
import LoadingSpinner from "../../Spinners/LoadingSpinner";
|
import ModalCom from "../../Helpers/ModalCom";
|
||||||
import { PriceFormatter } from "../../Helpers/PriceFormatter";
|
import { PriceFormatter } from "../../Helpers/PriceFormatter";
|
||||||
|
import LoadingSpinner from "../../Spinners/LoadingSpinner";
|
||||||
|
|
||||||
const MarketPopUp = ({ details, onClose, situation, marketInt }) => {
|
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 MarketCalls = (details) => {
|
||||||
const [marketMsg, setMarketMsg] = useState({
|
const [marketMsg, setMarketMsg] = useState({
|
||||||
loading: false,
|
loading: false,
|
||||||
@@ -24,8 +31,8 @@ const MarketPopUp = ({ details, onClose, situation, marketInt }) => {
|
|||||||
|
|
||||||
const MarketDetail = async () => {
|
const MarketDetail = async () => {
|
||||||
try {
|
try {
|
||||||
setMarketMsg({ loading: true });
|
|
||||||
if (!textValue) return;
|
if (!textValue) return;
|
||||||
|
setMarketMsg({ loading: true });
|
||||||
|
|
||||||
reqData.yourmessage = textValue;
|
reqData.yourmessage = textValue;
|
||||||
|
|
||||||
@@ -87,22 +94,11 @@ const MarketPopUp = ({ details, onClose, situation, marketInt }) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// useEffect(() => {
|
|
||||||
// ManageInterest();
|
|
||||||
// }, []);
|
|
||||||
|
|
||||||
return { MarketDetail, ManageInterest, manageInt, marketMsg };
|
return { MarketDetail, ManageInterest, manageInt, marketMsg };
|
||||||
};
|
};
|
||||||
|
|
||||||
const [textValue, setTextValue] = useState("");
|
let { manageInt, ManageInterest, MarketDetail, marketMsg } =
|
||||||
|
MarketCalls(details);
|
||||||
const handleInputChange = ({ target: { value } }) => {
|
|
||||||
setTextValue(value);
|
|
||||||
};
|
|
||||||
|
|
||||||
const apiCall = useMemo(() => new usersService(), []);
|
|
||||||
|
|
||||||
let { manageInt, ManageInterest, MarketDetail, marketMsg } = MarketCalls(details);
|
|
||||||
|
|
||||||
let thePrice = PriceFormatter(
|
let thePrice = PriceFormatter(
|
||||||
details?.price * 0.01,
|
details?.price * 0.01,
|
||||||
@@ -270,9 +266,7 @@ const MarketPopUp = ({ details, onClose, situation, marketInt }) => {
|
|||||||
Interest: <b className="ml-1">{details.interest_count}</b>
|
Interest: <b className="ml-1">{details.interest_count}</b>
|
||||||
</p>
|
</p>
|
||||||
<hr />
|
<hr />
|
||||||
<p className="my-1">
|
<p className="my-1">Expire: {details.expire}</p>
|
||||||
Expire: {details.expire}
|
|
||||||
</p>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<button
|
<button
|
||||||
|
|||||||
@@ -1,48 +1,52 @@
|
|||||||
import React, {useState} from 'react'
|
import React, { useState } from "react";
|
||||||
import RecentActivityTable from './WalletComponent/RecentActivityTable'
|
import { useLocation, useNavigate } from "react-router-dom";
|
||||||
import LoadingSpinner from '../Spinners/LoadingSpinner'
|
import InputCom from "../Helpers/Inputs/InputCom";
|
||||||
import { useNavigate, useLocation } from 'react-router-dom'
|
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
||||||
import InputCom from '../Helpers/Inputs/InputCom'
|
import RecentActivityTable from "./WalletComponent/RecentActivityTable";
|
||||||
|
|
||||||
import AddFundDollars from './AddFundDollars'
|
import AddFundDollars from "./AddFundDollars";
|
||||||
|
|
||||||
function AddFund({payment}) {
|
function AddFund({ payment }) {
|
||||||
|
const navigate = useNavigate();
|
||||||
const navigate = useNavigate()
|
const { currency } = useLocation()?.state; //GETS THE USER CURRENCY FOR ADD FUND
|
||||||
const {currency} = useLocation()?.state //GETS THE USER CURRENCY FOR ADD FUND
|
|
||||||
|
|
||||||
//STATE FOR CONTROLLED INPUT
|
//STATE FOR CONTROLLED INPUT
|
||||||
let [input, setInput] = useState('')
|
let [input, setInput] = useState("");
|
||||||
|
|
||||||
let [inputError, setInputError] = useState('')
|
let [inputError, setInputError] = useState("");
|
||||||
|
|
||||||
// FUNCTION TO HANDLE INPUT CHANGE
|
// FUNCTION TO HANDLE INPUT CHANGE
|
||||||
const handleChange = ({target:{name, value}}) => {
|
const handleChange = ({ target: { name, value } }) => {
|
||||||
setInput(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
|
if (isNaN(input)) {
|
||||||
const handleSubmit = () => {
|
setInputError("Amount must be a Number");
|
||||||
setInputError('')
|
return setTimeout(() => {
|
||||||
if(!input || input == '0'){
|
setInputError("");
|
||||||
setInputError('Please Enter Amount')
|
}, 5000);
|
||||||
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('')
|
|
||||||
}
|
}
|
||||||
return (
|
|
||||||
<div>
|
const stateData = { amount: Number(input), currency: "naira" };
|
||||||
{/* heading */}
|
navigate("confirm-add-fund", { state: stateData });
|
||||||
{/* <div className="sm:flex justify-between items-center mb-6">
|
|
||||||
|
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">
|
<div className="w-full flex justify-start space-x-3 items-center">
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
@@ -73,68 +77,78 @@ function AddFund({payment}) {
|
|||||||
</div>
|
</div>
|
||||||
</div> */}
|
</div> */}
|
||||||
|
|
||||||
<div className="content-wrapper w-full lg:flex xl:space-x-8 lg:space-x-4 bottomMargin">
|
<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="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">
|
<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>*/}
|
{/*<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 />*/}
|
{/*<hr />*/}
|
||||||
<form className='md:p-8 p-4 add-fund-info'>
|
<form className="md:p-8 p-4 add-fund-info">
|
||||||
<div className="field w-full mb-6">
|
<div className="field w-full mb-6">
|
||||||
<InputCom
|
<InputCom
|
||||||
fieldClass="px-6"
|
fieldClass="px-6"
|
||||||
label={currency == 'US Dollars' ? "Amount (USD)" : "Amount (Naira)"}
|
label={
|
||||||
type="text"
|
currency == "US Dollars" ? "Amount (USD)" : "Amount (Naira)"
|
||||||
name="amount"
|
}
|
||||||
placeholder="0"
|
type="text"
|
||||||
value={input}
|
name="amount"
|
||||||
inputHandler={handleChange}
|
placeholder="0"
|
||||||
/>
|
value={input}
|
||||||
{inputError && <p className='text-base text-red-500'>{inputError}</p>}
|
inputHandler={handleChange}
|
||||||
</div>
|
/>
|
||||||
</form>
|
{inputError && (
|
||||||
<hr />
|
<p className="text-base text-red-500">{inputError}</p>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
<hr />
|
||||||
|
|
||||||
{/* SHOWS THIS IF USER CURRENCY IS DOLLARS */}
|
{/* SHOWS THIS IF USER CURRENCY IS DOLLARS */}
|
||||||
{currency == 'US Dollars' &&
|
{currency == "US Dollars" && (
|
||||||
<div className='w-full md:p-8 p-4 bg-white dark:bg-dark-white rounded-2xl shadow'>
|
<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} />
|
<AddFundDollars
|
||||||
</div>
|
setInputError={setInputError}
|
||||||
}
|
input={input}
|
||||||
|
setInput={setInput}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
{/* HIDES THIS BUTTON IF CURENCY IS NAIRA */}
|
{/* HIDES THIS BUTTON IF CURENCY IS NAIRA */}
|
||||||
{currency != 'US Dollars' &&
|
{currency != "US Dollars" && (
|
||||||
<div className='md:p-8 p-4 add-fund-btn flex justify-end items-center py-4'>
|
<div className="md:p-8 p-4 add-fund-btn flex justify-end items-center py-4">
|
||||||
<button
|
<button
|
||||||
onClick={handleSubmit}
|
onClick={handleSubmit}
|
||||||
type="button"
|
type="button"
|
||||||
className="px-2 py-1 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
|
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>
|
<span className="text-white">Continue</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
}
|
)}
|
||||||
</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>
|
</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;
|
||||||
|
|||||||
@@ -11,37 +11,37 @@ import Icons from "../Helpers/Icons";
|
|||||||
|
|
||||||
const validationSchema = Yup.object().shape({
|
const validationSchema = Yup.object().shape({
|
||||||
name: Yup.string()
|
name: Yup.string()
|
||||||
.min(3, "Minimum 3 characters")
|
.min(3, "3 chars min.")
|
||||||
.max(50, "Maximum 50 characters")
|
.max(50, "50 chars max.")
|
||||||
.required("Name is required"),
|
.required("required"),
|
||||||
cardNum: Yup.string()
|
cardNum: Yup.string()
|
||||||
.min(3, "Minimum 3 characters")
|
.min(3, "3 chars min.")
|
||||||
.max(25, "Maximum 25 characters")
|
.max(25, "25 chars max.")
|
||||||
.required("Card Number is required"),
|
.required("required"),
|
||||||
code: Yup.string()
|
code: Yup.string()
|
||||||
.min(3, "Minimum 3 characters")
|
.min(3, "3 chars min.")
|
||||||
.max(25, "Maximum 25 characters")
|
.max(25, "25 chars max.")
|
||||||
.required("Postal Code is required"),
|
.required("required"),
|
||||||
state: Yup.string()
|
state: Yup.string()
|
||||||
.min(3, "Minimum 3 characters")
|
.min(3, "3 chars min.")
|
||||||
.max(25, "Maximum 25 characters")
|
.max(25, "25 chars max.")
|
||||||
.required("State is required"),
|
.required("required"),
|
||||||
address: Yup.string()
|
address: Yup.string()
|
||||||
.min(3, "Minimum 3 characters")
|
.min(3, "3 chars min.")
|
||||||
.max(50, "Maximum 50 characters")
|
.max(50, "50 chars max.")
|
||||||
.required("Address is required"),
|
.required("required"),
|
||||||
expirationYear: Yup.string()
|
expirationYear: Yup.string()
|
||||||
.min(4, "Minimum 4 characters")
|
.min(4, "4 chars min.")
|
||||||
.max(4, "Maximum 4 characters")
|
.max(4, "4 chars max.")
|
||||||
.required("Expiration Year is required"),
|
.required("required"),
|
||||||
expirationMonth: Yup.string()
|
expirationMonth: Yup.string()
|
||||||
.min(1, "Minimum 1 characters")
|
.min(1, "1 chars min.")
|
||||||
.max(2, "Maximum 2 characters")
|
.max(2, "2 chars max.")
|
||||||
.required("Expiration Month is required"),
|
.required("required"),
|
||||||
cvv: Yup.string()
|
cvv: Yup.string()
|
||||||
.min(3, "Minimum 3 characters")
|
.min(3, "3 chars min.")
|
||||||
.max(4, "Maximum 4 characters")
|
.max(4, "4 chars max.")
|
||||||
.required("CVV Year is required"),
|
.required("required"),
|
||||||
});
|
});
|
||||||
|
|
||||||
const initialValues = {
|
const initialValues = {
|
||||||
@@ -57,15 +57,14 @@ const initialValues = {
|
|||||||
|
|
||||||
function AddFundDollars(props) {
|
function AddFundDollars(props) {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
let apiCall = new usersService();
|
const apiCall = new usersService();
|
||||||
|
|
||||||
let [tab, setTab] = useState("previous"); //STATE FOR SWITCHING BETWEEN TABS
|
const [tab, setTab] = useState("previous");
|
||||||
const [loader, setLoader] = useState(false);
|
const [loader, setLoader] = useState(false);
|
||||||
const { userDetails } = useSelector((state) => state?.userDetails);
|
const { userDetails } = useSelector((state) => state?.userDetails);
|
||||||
let { firstname, lastname } = userDetails;
|
const { firstname, lastname } = userDetails;
|
||||||
let [prevCardDetails, setPrevCardDetails] = useState({}); // STATE TO HOLD PREVIOUS CARD SELECTED
|
const [prevCardDetails, setPrevCardDetails] = useState({});
|
||||||
let [payListCards, setPayListCards] = useState({ loading: true, data: [] }); //USER PREVIOUS CARDS
|
const [payListCards, setPayListCards] = useState({ loading: true, data: [] });
|
||||||
// const [payListCard, setPayListCard] = useState({ data: "" }); //USER PAYLIST
|
|
||||||
|
|
||||||
const handleInputChange = (event) => {
|
const handleInputChange = (event) => {
|
||||||
const { name, value } = event.target;
|
const { name, value } = event.target;
|
||||||
@@ -83,27 +82,20 @@ function AddFundDollars(props) {
|
|||||||
indexOfLastItem
|
indexOfLastItem
|
||||||
);
|
);
|
||||||
|
|
||||||
// FUNCTION TO SUBMIT
|
|
||||||
const handleSubmit = (values, helpers) => {
|
const handleSubmit = (values, helpers) => {
|
||||||
props.setInputError("");
|
props.setInputError("");
|
||||||
if (!props.input || props.input == "0") {
|
if (!props.input || props.input === "0") {
|
||||||
props.setInputError("Please Enter Amount");
|
props.setInputError("Please Enter Amount");
|
||||||
return setTimeout(() => {
|
return;
|
||||||
props.setInputError("");
|
|
||||||
}, 5000);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isNaN(props.input)) {
|
if (isNaN(props.input)) {
|
||||||
props.setInputError("Amount must be a Number");
|
props.setInputError("Amount must be a Number");
|
||||||
return setTimeout(() => {
|
return;
|
||||||
props.setInputError("");
|
|
||||||
}, 5000);
|
|
||||||
}
|
}
|
||||||
if (tab == "previous") {
|
|
||||||
|
if (tab === "previous") {
|
||||||
if (!prevCardDetails) {
|
if (!prevCardDetails) {
|
||||||
// return setTimeout(() => {
|
|
||||||
// props.setInputError("");
|
|
||||||
// }, 5000);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
setLoader(true);
|
setLoader(true);
|
||||||
@@ -111,21 +103,21 @@ function AddFundDollars(props) {
|
|||||||
amount: Number(props.input),
|
amount: Number(props.input),
|
||||||
currency: props.currency,
|
currency: props.currency,
|
||||||
card: prevCardDetails["payment-card"],
|
card: prevCardDetails["payment-card"],
|
||||||
|
cardType: "prev",
|
||||||
};
|
};
|
||||||
|
|
||||||
setTimeout(() => {
|
return setTimeout(() => {
|
||||||
props.setConfirmCredit({ show: true, data: stateData });
|
props.setConfirmCredit({ show: true, data: stateData });
|
||||||
setLoader(false);
|
setLoader(false);
|
||||||
}, 1500);
|
}, 1500);
|
||||||
// navigate("confirm-add-fund", { state: stateData }); // State will change later dummy for now
|
|
||||||
}
|
}
|
||||||
if (tab == "new") {
|
|
||||||
|
if (tab === "new") {
|
||||||
const stateData = {
|
const stateData = {
|
||||||
amount: Number(props.input),
|
amount: Number(props.input),
|
||||||
currency: props.currency,
|
currency: props.currency,
|
||||||
values,
|
...values,
|
||||||
};
|
};
|
||||||
// navigate("confirm-add-fund", { state: stateData }); // State will change later dummy for now
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -141,6 +133,8 @@ function AddFundDollars(props) {
|
|||||||
});
|
});
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
const handleClose = props.onClose;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="w-full">
|
<div className="w-full">
|
||||||
@@ -190,13 +184,13 @@ function AddFundDollars(props) {
|
|||||||
{/* END OF switch button */}
|
{/* END OF switch button */}
|
||||||
|
|
||||||
{/* previous tab */}
|
{/* previous tab */}
|
||||||
{tab == "previous" ? (
|
{tab === "previous" ? (
|
||||||
<div className="p-4 previous-details w-full min-h-[16rem] flex flex-col justify-between items-center">
|
<div className="p-4 previous-details w-full min-h-[16rem] flex flex-col justify-between items-center">
|
||||||
{payListCards.loading ? (
|
{payListCards.loading ? (
|
||||||
<LoadingSpinner size="10" color="sky-blue" />
|
<LoadingSpinner size="10" color="sky-blue" />
|
||||||
) : payListCards?.data?.length ? (
|
) : payListCards?.data?.length ? (
|
||||||
<select
|
<select
|
||||||
className="my-3 w-full rounded-full p-4 outline-none border-none text-base text-black dark:text-gray-100 bg-[#dce2e6] dark:bg-[#5e6278] border"
|
className="my-3 w-full rounded-full p-2 outline-none text-base text-black dark:text-gray-100 bg-[#FAFAFA] dark:bg-[#11131F] border"
|
||||||
value={prevCardDetails["payment-card"]?.card_uid}
|
value={prevCardDetails["payment-card"]?.card_uid}
|
||||||
id="payment-card"
|
id="payment-card"
|
||||||
name="payment-card"
|
name="payment-card"
|
||||||
@@ -206,16 +200,10 @@ function AddFundDollars(props) {
|
|||||||
{currentPreviousCards.map((item, index) => (
|
{currentPreviousCards.map((item, index) => (
|
||||||
<option
|
<option
|
||||||
key={index}
|
key={index}
|
||||||
className={index != 0 && "border-t-2"}
|
className={index !== 0 && "border-t-2"}
|
||||||
value={JSON.stringify(item)}
|
value={JSON.stringify(item)}
|
||||||
>
|
>
|
||||||
<div className="my-2 flex items-center gap-5">
|
<div className="my-2 flex items-center gap-5">
|
||||||
{/* <input
|
|
||||||
type="radio"
|
|
||||||
className="w-8 h-8"
|
|
||||||
name="card"
|
|
||||||
value="value"
|
|
||||||
/> */}
|
|
||||||
<div className="card-details">
|
<div className="card-details">
|
||||||
<h1 className="text-lg font-bold text-dark-gray dark:text-white tracking-wide">
|
<h1 className="text-lg font-bold text-dark-gray dark:text-white tracking-wide">
|
||||||
{item.description} Card
|
{item.description} Card
|
||||||
@@ -244,7 +232,7 @@ function AddFundDollars(props) {
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<div className="new-details w-full max-h-[23rem] overflow-y-scroll">
|
<div className="new-details w-full max-h-[23rem]">
|
||||||
<div className="w-full flex flex-col justify-between">
|
<div className="w-full flex flex-col justify-between">
|
||||||
<Formik
|
<Formik
|
||||||
initialValues={initialValues}
|
initialValues={initialValues}
|
||||||
@@ -253,11 +241,11 @@ function AddFundDollars(props) {
|
|||||||
>
|
>
|
||||||
{(props) => {
|
{(props) => {
|
||||||
return (
|
return (
|
||||||
<Form>
|
<Form className="md:pl-8">
|
||||||
<div className="flex flex-col-reverse sm:flex-row">
|
<div className="flex flex-col-reverse sm:flex-row">
|
||||||
<div className="flex-1 sm:mr-10">
|
<div className="flex-1 sm:mr-10">
|
||||||
<div className="fields w-full">
|
<div className="fields w-full">
|
||||||
{/* inputs starts here */}
|
{/* Inputs */}
|
||||||
{/* Name */}
|
{/* Name */}
|
||||||
<div className="flex items-center field w-full my-2 flex-[0.4] gap-3">
|
<div className="flex items-center field w-full my-2 flex-[0.4] gap-3">
|
||||||
<label className="input-label text-[#181c32] dark:text-white text-[13.975px] leading-[20.9625px] font-semibold flex items-center gap-1">
|
<label className="input-label text-[#181c32] dark:text-white text-[13.975px] leading-[20.9625px] font-semibold flex items-center gap-1">
|
||||||
@@ -266,27 +254,8 @@ function AddFundDollars(props) {
|
|||||||
<p className="input-label text-[#181c32] dark:text-white text-[16px] leading-[20.9625px] font-semibold flex items-center gap-1">{`${firstname} ${lastname}`}</p>
|
<p className="input-label text-[#181c32] dark:text-white text-[16px] leading-[20.9625px] font-semibold flex items-center gap-1">{`${firstname} ${lastname}`}</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* <div className="field w-full my-2 flex-[0.4]">
|
<div className="flex items-center flex-1 gap-3 my-2">
|
||||||
<InputCom
|
{/* Card Number */}
|
||||||
fieldClass="px-6"
|
|
||||||
spanTag="*"
|
|
||||||
label="Name on Card"
|
|
||||||
type="text"
|
|
||||||
name="name"
|
|
||||||
placeholder="DUMMY NAME"
|
|
||||||
value={props.values.name}
|
|
||||||
inputHandler={props.handleChange}
|
|
||||||
blurHandler={props.handleBlur}
|
|
||||||
/>
|
|
||||||
{props.errors.name && props.touched.name && (
|
|
||||||
<p className="text-sm text-red-500">
|
|
||||||
{props.errors.name}
|
|
||||||
</p>
|
|
||||||
)}
|
|
||||||
</div> */}
|
|
||||||
|
|
||||||
<div className="flex items-center flex-1 gap-3 my-3">
|
|
||||||
{/* CARD NUMBER */}
|
|
||||||
<div className="field w-full flex-[0.6]">
|
<div className="field w-full flex-[0.6]">
|
||||||
<InputCom
|
<InputCom
|
||||||
fieldClass="px-6"
|
fieldClass="px-6"
|
||||||
@@ -299,15 +268,10 @@ function AddFundDollars(props) {
|
|||||||
value={props.values.cardNum}
|
value={props.values.cardNum}
|
||||||
inputHandler={props.handleChange}
|
inputHandler={props.handleChange}
|
||||||
blurHandler={props.handleBlur}
|
blurHandler={props.handleBlur}
|
||||||
|
error={props.errors.cardNum}
|
||||||
/>
|
/>
|
||||||
{props.errors.cardNum &&
|
|
||||||
props.touched.cardNum && (
|
|
||||||
<p className="text-sm text-red-500">
|
|
||||||
{props.errors.cardNum}
|
|
||||||
</p>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
{/* EXPIRE YEAR, YEAR */}
|
{/* Expire Year, Year */}
|
||||||
<div className="sm:grid gap-5 grid-cols-2 flex-[0.4]">
|
<div className="sm:grid gap-5 grid-cols-2 flex-[0.4]">
|
||||||
<div className="field w-full mb-6 xl:mb-0 col-span-1">
|
<div className="field w-full mb-6 xl:mb-0 col-span-1">
|
||||||
<div className="select-option">
|
<div className="select-option">
|
||||||
@@ -315,13 +279,16 @@ function AddFundDollars(props) {
|
|||||||
className={`flex items-center justify-between mb-2.5`}
|
className={`flex items-center justify-between mb-2.5`}
|
||||||
>
|
>
|
||||||
<label
|
<label
|
||||||
className="input-label text-[#181c32] dark:text-white text-[13.975px] leading-[20.9625px] font-semibold block"
|
className="input-label text-[#181c32] dark:text-white text-[13.975px] leading-[20.9625px] font-semibold line-clamp-3 flex items-center"
|
||||||
htmlFor="expiration"
|
htmlFor="expiration"
|
||||||
>
|
>
|
||||||
Exp Month{" "}
|
Exp Month{" "}
|
||||||
<span className="text-red-700 text-sm tracking-wide">
|
<span className="text-red-700 text-sm italic">
|
||||||
*
|
*
|
||||||
</span>
|
</span>
|
||||||
|
<span className="text-[12px] text-red-500 ml-1">
|
||||||
|
{props.errors.expirationMonth && "**"}
|
||||||
|
</span>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
@@ -352,12 +319,6 @@ function AddFundDollars(props) {
|
|||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{props.errors.expirationMonth &&
|
|
||||||
props.touched.expirationMonth && (
|
|
||||||
<p className="text-sm text-red-500">
|
|
||||||
{props.errors.expirationMonth}
|
|
||||||
</p>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
<div className="field w-full mb-6 xl:mb-0 col-span-1">
|
<div className="field w-full mb-6 xl:mb-0 col-span-1">
|
||||||
<div className="select-option">
|
<div className="select-option">
|
||||||
@@ -365,13 +326,16 @@ function AddFundDollars(props) {
|
|||||||
className={`flex items-center justify-between mb-2.5`}
|
className={`flex items-center justify-between mb-2.5`}
|
||||||
>
|
>
|
||||||
<label
|
<label
|
||||||
className="input-label text-[#181c32] dark:text-white text-[13.975px] leading-[20.9625px] font-semibold block"
|
className="input-label text-[#181c32] dark:text-white text-[13.975px] leading-[20.9625px] font-semibold flex items-center line-clamp-3"
|
||||||
htmlFor="expiration"
|
htmlFor="expiration"
|
||||||
>
|
>
|
||||||
Exp Year{" "}
|
Exp Year{" "}
|
||||||
<span className="text-red-700 text-sm tracking-wide">
|
<span className="text-red-700 text-sm tracking-wide">
|
||||||
*
|
*
|
||||||
</span>
|
</span>
|
||||||
|
<span className="text-[12px] text-red-500 italic">
|
||||||
|
{props.errors.expirationYear && "**"}
|
||||||
|
</span>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
@@ -384,7 +348,12 @@ function AddFundDollars(props) {
|
|||||||
onBlur={props.handleBlur}
|
onBlur={props.handleBlur}
|
||||||
name="expirationYear"
|
name="expirationYear"
|
||||||
>
|
>
|
||||||
<option value="" className="text-dark-gray">Year</option>
|
<option
|
||||||
|
value=""
|
||||||
|
className="text-dark-gray"
|
||||||
|
>
|
||||||
|
Year
|
||||||
|
</option>
|
||||||
{expireYear?.length &&
|
{expireYear?.length &&
|
||||||
expireYear.map((item, index) => (
|
expireYear.map((item, index) => (
|
||||||
<option key={index} value={item}>
|
<option key={index} value={item}>
|
||||||
@@ -394,18 +363,12 @@ function AddFundDollars(props) {
|
|||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{props.errors.expirationYear &&
|
|
||||||
props.touched.expirationYear && (
|
|
||||||
<p className="text-sm text-red-500">
|
|
||||||
{props.errors.expirationYear}
|
|
||||||
</p>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="flex items-center flex-1 gap-3 my-3">
|
<div className="flex items-center flex-1 gap-3 my-2">
|
||||||
{/* Address AND CVV */}
|
{/* Address and CVV */}
|
||||||
<div className="field w-full col-span-1 flex-[0.4]">
|
<div className="field w-full col-span-1 flex-[0.4]">
|
||||||
<InputCom
|
<InputCom
|
||||||
fieldClass="px-6"
|
fieldClass="px-6"
|
||||||
@@ -418,12 +381,8 @@ function AddFundDollars(props) {
|
|||||||
value={props.values.cvv}
|
value={props.values.cvv}
|
||||||
inputHandler={props.handleChange}
|
inputHandler={props.handleChange}
|
||||||
blurHandler={props.handleBlur}
|
blurHandler={props.handleBlur}
|
||||||
|
error={props.errors.cvv}
|
||||||
/>
|
/>
|
||||||
{props.errors.cvv && props.touched.cvv && (
|
|
||||||
<p className="text-sm text-red-500">
|
|
||||||
{props.errors.cvv}
|
|
||||||
</p>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
<div className="field w-full flex-[0.6]">
|
<div className="field w-full flex-[0.6]">
|
||||||
<InputCom
|
<InputCom
|
||||||
@@ -436,17 +395,13 @@ function AddFundDollars(props) {
|
|||||||
value={props.values.Address}
|
value={props.values.Address}
|
||||||
inputHandler={props.handleChange}
|
inputHandler={props.handleChange}
|
||||||
blurHandler={props.handleBlur}
|
blurHandler={props.handleBlur}
|
||||||
|
error={props.errors.address}
|
||||||
/>
|
/>
|
||||||
{props.errors.address &&
|
|
||||||
props.touched.address && (
|
|
||||||
<p className="text-sm text-red-500">
|
|
||||||
{props.errors.address}
|
|
||||||
</p>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{/* postal code and state */}
|
|
||||||
<div className="sm:grid gap-5 grid-cols-3 my-3">
|
{/* Postal Code and State */}
|
||||||
|
<div className="sm:grid gap-5 grid-cols-3 my-2">
|
||||||
<div className="field w-full mb-6 xl:mb-0 col-span-1">
|
<div className="field w-full mb-6 xl:mb-0 col-span-1">
|
||||||
<InputCom
|
<InputCom
|
||||||
fieldClass="px-6"
|
fieldClass="px-6"
|
||||||
@@ -458,12 +413,8 @@ function AddFundDollars(props) {
|
|||||||
value={props.values.code}
|
value={props.values.code}
|
||||||
inputHandler={props.handleChange}
|
inputHandler={props.handleChange}
|
||||||
blurHandler={props.handleBlur}
|
blurHandler={props.handleBlur}
|
||||||
|
error={props.errors.code}
|
||||||
/>
|
/>
|
||||||
{props.errors.code && props.touched.code && (
|
|
||||||
<p className="text-sm text-red-500">
|
|
||||||
{props.errors.code}
|
|
||||||
</p>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
<div className="field w-full col-span-1">
|
<div className="field w-full col-span-1">
|
||||||
<InputCom
|
<InputCom
|
||||||
@@ -476,60 +427,33 @@ function AddFundDollars(props) {
|
|||||||
value={props.values.state}
|
value={props.values.state}
|
||||||
inputHandler={props.handleChange}
|
inputHandler={props.handleChange}
|
||||||
blurHandler={props.handleBlur}
|
blurHandler={props.handleBlur}
|
||||||
|
error={props.errors.state}
|
||||||
/>
|
/>
|
||||||
{props.errors.state && props.touched.state && (
|
|
||||||
<p className="text-sm text-red-500">
|
|
||||||
{props.errors.state}
|
|
||||||
</p>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* <div className="w-full">
|
<div className="md:px-8 md:pt-4 px-4 pt-2 add-fund-btn flex justify-end items-center gap-3">
|
||||||
{requestStatus.message != "" && (
|
<button
|
||||||
<p
|
className="px-4 py-1 h-11 max-w-[100px] w-full flex justify-center items-center border-gradient text-base rounded-full"
|
||||||
className={`text-center text-base ${
|
onClick={handleClose}
|
||||||
requestStatus.status ? "text-green-800" : "text-red-600"
|
>
|
||||||
}`}
|
Cancel
|
||||||
>
|
</button>
|
||||||
{requestStatus.message}
|
|
||||||
</p>
|
|
||||||
)}
|
|
||||||
<div className="w-full h-[120px] border-t border-light-purple dark:border-[#5356fb29] flex justify-end items-center">
|
|
||||||
<div className="flex items-center space-x-4 mr-9">
|
|
||||||
<Link
|
|
||||||
to="/"
|
|
||||||
className="text-18 text-light-red tracking-wide "
|
|
||||||
>
|
|
||||||
<span className="border-b dark:border-[#5356fb29] border-light-red">
|
|
||||||
{" "}
|
|
||||||
Cancel
|
|
||||||
</span>
|
|
||||||
</Link>
|
|
||||||
|
|
||||||
{requestStatus.loading ? (
|
|
||||||
<LoadingSpinner size="8" color="sky-blue" />
|
|
||||||
) : (
|
|
||||||
<button
|
|
||||||
type="submit"
|
|
||||||
className="w-[152px] h-[46px] flex justify-center items-center btn-gradient text-base rounded-full text-white"
|
|
||||||
>
|
|
||||||
Update Profile
|
|
||||||
</button>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div> */}
|
|
||||||
<div className="md:px-8 md:pt-4 px-4 pt-2 add-fund-btn flex justify-end items-center">
|
|
||||||
<button
|
<button
|
||||||
type="submit"
|
type="submit"
|
||||||
className="py-1 px-4 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white gap-1"
|
className="px-4 py-1 h-11 max-w-[100px] w-full flex justify-center items-center btn-gradient text-base rounded-full text-white"
|
||||||
>
|
>
|
||||||
<span className="text-white">Continue</span>{" "}
|
{loader ? (
|
||||||
<Icons name="chevron-right" />
|
<LoadingSpinner size="6" color="sky-blue" />
|
||||||
|
) : (
|
||||||
|
<>
|
||||||
|
<span className="text-white">Continue</span>{" "}
|
||||||
|
<Icons name="chevron-right" />
|
||||||
|
</>
|
||||||
|
)}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</Form>
|
</Form>
|
||||||
|
|||||||
@@ -1,55 +1,71 @@
|
|||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
|
import usersService from "../../services/UsersService";
|
||||||
|
import Icons from "../Helpers/Icons";
|
||||||
import InputCom from "../Helpers/Inputs/InputCom";
|
import InputCom from "../Helpers/Inputs/InputCom";
|
||||||
|
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
||||||
import AddFundDollars from "./AddFundDollars";
|
import AddFundDollars from "./AddFundDollars";
|
||||||
|
|
||||||
function AddFundPop({ _payment, input, setInput, onClose, setConfirmCredit }) {
|
function AddFundPop({ _payment, input, setInput, onClose, setConfirmCredit }) {
|
||||||
const navigate = useNavigate();
|
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
|
const [inputError, setInputError] = useState("");
|
||||||
let [inputError, setInputError] = useState("");
|
const [loader, setLoader] = useState(false);
|
||||||
|
|
||||||
// FUNCTION TO HANDLE INPUT CHANGE
|
|
||||||
const handleChange = ({ target: { name, value } }) => {
|
const handleChange = ({ target: { name, value } }) => {
|
||||||
setInput(value);
|
setInput(value);
|
||||||
};
|
};
|
||||||
|
|
||||||
//FUNCTION TO HANDLE SUBMIT
|
const handleSubmit = async () => {
|
||||||
const handleSubmit = (e) => {
|
|
||||||
e.preventDefault();
|
|
||||||
setInputError("");
|
setInputError("");
|
||||||
if (!input || input == "0") {
|
setLoader(true);
|
||||||
|
|
||||||
|
if (!input || input === "0") {
|
||||||
|
setLoader(false);
|
||||||
setInputError("Please Enter Amount");
|
setInputError("Please Enter Amount");
|
||||||
return setTimeout(() => {
|
setTimeout(() => setInputError(""), 5000);
|
||||||
setInputError("");
|
return;
|
||||||
}, 5000);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isNaN(input)) {
|
if (isNaN(input)) {
|
||||||
|
setLoader(false);
|
||||||
setInputError("Amount must be a Number");
|
setInputError("Amount must be a Number");
|
||||||
return setTimeout(() => {
|
setTimeout(() => setInputError(""), 5000);
|
||||||
setInputError("");
|
return;
|
||||||
}, 5000);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (input) return;
|
let stateData = {
|
||||||
// setTimeout(
|
amount: Number(input),
|
||||||
// () =>
|
currency: currency.toUpperCase(),
|
||||||
// setConfirmCredit({
|
};
|
||||||
// show: true,
|
|
||||||
// data: { amount: Number(input), currency: "naira" },
|
|
||||||
// }),
|
|
||||||
// 1500
|
|
||||||
// );
|
|
||||||
|
|
||||||
// const stateData = { amount: Number(input), currency: "naira" };
|
try {
|
||||||
// navigate("confirm-add-fund", { state: stateData });
|
const res = await apiCall.getStartCredit(stateData);
|
||||||
|
if (res.data.internal_return < 0) {
|
||||||
|
setLoader(false);
|
||||||
|
setInputError("An Error Occurred");
|
||||||
|
setTimeout(() => setInputError(""), 5000);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// setInput("");
|
const _response = res.data;
|
||||||
|
stateData.amount = Number(input);
|
||||||
|
stateData.currency = currency;
|
||||||
|
stateData = { ...stateData, ..._response };
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
setLoader(false);
|
||||||
|
setConfirmCredit({
|
||||||
|
show: true,
|
||||||
|
data: stateData,
|
||||||
|
});
|
||||||
|
}, 1500);
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -57,11 +73,9 @@ 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="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="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">
|
<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]">
|
<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">
|
<h1 className="text-xl font-bold text-dark-gray dark:text-white tracking-tighter my-1">
|
||||||
{currency == "US Dollars" ? "Amount (USD)" : "Amount (Naira)"}
|
Amount({currency})
|
||||||
</h1>
|
</h1>
|
||||||
<div className="field w-full max-w-[250px]">
|
<div className="field w-full max-w-[250px]">
|
||||||
<InputCom
|
<InputCom
|
||||||
@@ -78,8 +92,7 @@ function AddFundPop({ _payment, input, setInput, onClose, setConfirmCredit }) {
|
|||||||
</div>
|
</div>
|
||||||
</form>
|
</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">
|
<div className="w-full md:px-8 md:pt-4 px-4 pt-2 bg-white dark:bg-dark-white rounded-2xl">
|
||||||
<AddFundDollars
|
<AddFundDollars
|
||||||
setInputError={setInputError}
|
setInputError={setInputError}
|
||||||
@@ -92,11 +105,12 @@ function AddFundPop({ _payment, input, setInput, onClose, setConfirmCredit }) {
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{/* HIDES THIS BUTTON IF CURENCY IS NAIRA */}
|
{currency !== "US Dollars" && <div className="h-[18rem]"></div>}
|
||||||
{currency != "US Dollars" && (
|
|
||||||
|
{currency !== "US Dollars" && (
|
||||||
<div className="md:p-8 p-4 add-fund-btn flex justify-end items-center py-4 gap-4">
|
<div className="md:p-8 p-4 add-fund-btn flex justify-end items-center py-4 gap-4">
|
||||||
<button
|
<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}
|
onClick={onClose}
|
||||||
>
|
>
|
||||||
Cancel
|
Cancel
|
||||||
@@ -104,34 +118,22 @@ function AddFundPop({ _payment, input, setInput, onClose, setConfirmCredit }) {
|
|||||||
<button
|
<button
|
||||||
onClick={handleSubmit}
|
onClick={handleSubmit}
|
||||||
type="button"
|
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>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</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>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,13 +2,16 @@ import React, { useState } from "react";
|
|||||||
import { useSelector } from "react-redux";
|
import { useSelector } from "react-redux";
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
import { toast } from "react-toastify";
|
import { toast } from "react-toastify";
|
||||||
import InputCom from "../Helpers/Inputs/InputCom";
|
|
||||||
|
|
||||||
import usersService from "../../services/UsersService";
|
import usersService from "../../services/UsersService";
|
||||||
|
|
||||||
import { FlutterWaveButton, closePaymentModal } from "flutterwave-react-v3";
|
import { FlutterWaveButton, closePaymentModal } from "flutterwave-react-v3";
|
||||||
|
|
||||||
function ConfirmAddFund({ confirmCredit, onClose, walletItem }) {
|
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 { userDetails } = useSelector((state) => state.userDetails); // TO GET LOGGEDIN USER DETAILS
|
||||||
|
|
||||||
let [pageLoading, setPageLoading] = useState(true);
|
let [pageLoading, setPageLoading] = useState(true);
|
||||||
@@ -87,16 +90,12 @@ function ConfirmAddFund({ confirmCredit, onClose, walletItem }) {
|
|||||||
onClose: () => {},
|
onClose: () => {},
|
||||||
};
|
};
|
||||||
|
|
||||||
// useEffect(() => {
|
const handlePrevCard = () => {
|
||||||
// // what happens if not data redirect user
|
console.log("Test me")
|
||||||
// if (!data) {
|
}
|
||||||
// navigate("/my-wallet/add-fund", { replace: true });
|
|
||||||
// } else {
|
|
||||||
// setPageLoading(false);
|
|
||||||
// }
|
|
||||||
// }, []);
|
|
||||||
|
|
||||||
let __confirmCard = JSON.parse(confirmCredit?.data.card);
|
|
||||||
const ThePaymentText = ({ value }) => (
|
const ThePaymentText = ({ value }) => (
|
||||||
<div className="my-2 flex items-center gap-5">
|
<div className="my-2 flex items-center gap-5">
|
||||||
<div className="card-details flex items-center gap-3">
|
<div className="card-details flex items-center gap-3">
|
||||||
@@ -110,67 +109,63 @@ function ConfirmAddFund({ confirmCredit, onClose, walletItem }) {
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// console.log(confirmCredit);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="content-wrapper w-full h-[32rem]">
|
<div className="content-wrapper w-full h-[32rem]">
|
||||||
<div className="w-full mb-10">
|
<div className="w-full mb-10">
|
||||||
<div className="add-fund w-full bg-white dark:bg-dark-white rounded-2xl">
|
<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="px-4 md:p-8 py-4 add-fund-info">
|
||||||
<div className="field w-full mb-3 min-h-[45px]">
|
<div className="field w-full mb-3 min-h-[45px]">
|
||||||
{confirmCredit?.show ? (
|
{confirmCredit?.show ? (
|
||||||
<div className="flex flex-col gap-4">
|
<div className="flex flex-col gap-4">
|
||||||
<div className="flex items-center 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">
|
<h1 className="text-xl font-bold text-dark-gray dark:text-white tracking-tighter my-1">
|
||||||
{confirmCredit?.data?.currency == "naira"
|
Amount({__confirmData?.currency})
|
||||||
? "Amount (Naira):"
|
|
||||||
: "Amount (Dollars):"}
|
|
||||||
</h1>
|
</h1>
|
||||||
<span className="text-xl font-bold text-dark-gray dark:text-white tracking-tighter my-1">
|
<span className="text-xl font-bold text-dark-gray dark:text-white tracking-tighter my-1">
|
||||||
{`${walletItem?.symbol} ${
|
{`${walletItem?.symbol} ${
|
||||||
Number(confirmCredit?.data?.amount).toLocaleString() ||
|
Number(__confirmData?.amount).toLocaleString() || ""
|
||||||
""
|
|
||||||
}`}
|
}`}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex items-center gap-4">
|
{__confirmData?.currency == "US Dollars" && (
|
||||||
{/* <h1 className="text-xl font-bold text-dark-gray dark:text-white tracking-tighter my-1"> */}
|
<div className="flex items-center gap-8">
|
||||||
<label
|
<label
|
||||||
htmlFor="payment"
|
htmlFor="payment"
|
||||||
className="text-xl font-bold text-dark-gray dark:text-white tracking-tighter my-1"
|
className="text-xl font-bold text-dark-gray dark:text-white tracking-tighter my-1"
|
||||||
>
|
>
|
||||||
{confirmCredit?.data?.currency && "Payment Method:"}
|
{__confirmData?.currency && "Payment Method"}
|
||||||
</label>
|
</label>
|
||||||
<span className="text-[#181c32] dark:text-white ">
|
<span className="text-[#181c32] dark:text-white ">
|
||||||
{__confirmCard && (
|
{__confirmCardDetails ? (
|
||||||
<ThePaymentText value={__confirmCard} />
|
<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>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : null}
|
||||||
<InputCom
|
|
||||||
fieldClass="px-6"
|
|
||||||
label={
|
|
||||||
confirmCredit?.data?.currency == "naira"
|
|
||||||
? "Amount (Naira):"
|
|
||||||
: "Amount (Dollars):"
|
|
||||||
}
|
|
||||||
type="text"
|
|
||||||
name="amount"
|
|
||||||
value={confirmCredit?.data?.amount || ""}
|
|
||||||
disable={true}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
</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 /> */}
|
{/* <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">
|
<div className="md:p-8 p-4 add-fund-btn flex justify-end items-center py-4 gap-4">
|
||||||
<button
|
<button
|
||||||
className="px-4 h-11 flex justify-center items-center border-gradient text-base rounded-full"
|
className="px-4 h-11 flex justify-center items-center border-gradient text-base rounded-full"
|
||||||
@@ -178,18 +173,23 @@ function ConfirmAddFund({ confirmCredit, onClose, walletItem }) {
|
|||||||
>
|
>
|
||||||
Cancel
|
Cancel
|
||||||
</button>
|
</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
|
<FlutterWaveButton
|
||||||
{...fwConfig}
|
{...fwConfig}
|
||||||
className="px-2 py-1 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
|
className="px-2 py-1 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
|
||||||
/>
|
/>
|
||||||
) : (
|
|
||||||
<button
|
|
||||||
className="px-4 py-1 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
|
|
||||||
onClick={() => console.log("WORKING")}
|
|
||||||
>
|
|
||||||
Continue
|
|
||||||
</button>
|
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -19,19 +19,6 @@ const CreditPopup = ({ details, onClose, situation, walletItem }) => {
|
|||||||
data: {},
|
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 }) => {
|
const switchNextStep = ({ target: value }) => {
|
||||||
setSuggestedNextStep(value);
|
setSuggestedNextStep(value);
|
||||||
};
|
};
|
||||||
@@ -47,8 +34,6 @@ const CreditPopup = ({ details, onClose, situation, walletItem }) => {
|
|||||||
onClose();
|
onClose();
|
||||||
};
|
};
|
||||||
|
|
||||||
console.log("prop drills >> ", state);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ModalCom
|
<ModalCom
|
||||||
action={onClose}
|
action={onClose}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { Link } from 'react-router-dom';
|
|||||||
|
|
||||||
function WalletAction({walletItem, payment, openPopUp}) {
|
function WalletAction({walletItem, payment, openPopUp}) {
|
||||||
return (
|
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'>
|
<div className='w-1/2 flex justify-center items-center'>
|
||||||
<Link
|
<Link
|
||||||
to="transfer-fund"
|
to="transfer-fund"
|
||||||
|
|||||||
@@ -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 LoadingSpinner from "../Spinners/LoadingSpinner";
|
||||||
import WalletItemCard from "./WalletItemCard";
|
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="my-wallet-wrapper w-full mb-10">
|
||||||
<div className="main-wrapper w-full">
|
<div className="main-wrapper w-full">
|
||||||
<div className="balance-inquery w-full lg:flex lg:space-x-11 mb-11">
|
<div className="balance-inquery w-full lg:grid grid-cols-[repeat(auto-fill,_minmax(325px,_1fr))] gap-5 mb-11 h-[22rem]">
|
||||||
{wallet.loading ? (
|
{wallet.loading ? (
|
||||||
<div className="w-full h-full flex items-center justify-center">
|
<div className="w-full h-full flex items-center justify-center">
|
||||||
<LoadingSpinner size="16" color="sky-blue" />
|
<LoadingSpinner size="16" color="sky-blue" />
|
||||||
</div>
|
</div>
|
||||||
) : wallet.data.length ? (
|
) : wallet.data.length ? (
|
||||||
wallet.data.map((item, index) => (
|
wallet.data.map((item, index) => (
|
||||||
<div className="lg:w-1/2 h-full mb-10 lg:mb-0">
|
<div className="lg:w-full h-full mb-10 lg:mb-0">
|
||||||
<WalletItemCard walletItem={item} payment={payment} />
|
<WalletItemCard walletItem={item} payment={payment} />
|
||||||
</div>
|
</div>
|
||||||
))
|
))
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
import React, { useState } from "react";
|
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 { 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 localImgLoad from "../../lib/localImgLoad";
|
||||||
|
import { PriceFormatter } from "../Helpers/PriceFormatter";
|
||||||
|
import CreditPopup from "./Popup/CreditPopup";
|
||||||
import WalletAction from "./WalletAction";
|
import WalletAction from "./WalletAction";
|
||||||
|
|
||||||
export default function WalletItemCard({ walletItem, payment }) {
|
export default function WalletItemCard({ walletItem, payment }) {
|
||||||
@@ -29,83 +28,61 @@ export default function WalletItemCard({ walletItem, payment }) {
|
|||||||
setCreditPopup({ show: false, data: {} });
|
setCreditPopup({ show: false, data: {} });
|
||||||
};
|
};
|
||||||
|
|
||||||
console.log("walletItem >>", walletItem, payment);
|
let image = walletItem.code
|
||||||
|
? `${walletItem.code.toLocaleLowerCase()}.svg`
|
||||||
let image = walletItem.code ? `${walletItem.code.toLocaleLowerCase()}.svg` : 'default.png' // HOLDS THE VALUE NAME PROPERTY FOR IMAGE ICON
|
: "default.png"; // HOLDS THE VALUE NAME PROPERTY FOR IMAGE ICON
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div
|
<div
|
||||||
className={`current-balance-widget w-full h-full rounded-2xl overflow-hidden flex flex-col gap-2 px-8 py-9`}
|
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={{
|
style={{
|
||||||
background: `url(${background}) 0% 0% / cover no-repeat`,
|
background: `url(${background}) 0% 0% / cover no-repeat`,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div className="wallet xxs:flex justify-around items-start gap-3">
|
{/* <div className="w-[350px]"> */}
|
||||||
<div className="min-w-[100px] min-h-[100px] max-w-[100px] max-h-[100px] rounded-full bg-[#e3e3e3] flex justify-center items-center">
|
<div className="wallet w-full flex justify-between items-start gap-3">
|
||||||
<img src={localImgLoad(`images/currency/${image}`)} className="w-full h-full" alt="curreny-icon" />
|
<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>
|
||||||
<div className="balance w-full">
|
|
||||||
<p className="text-lg text-white opacity-[70%] tracking-wide mb-6">
|
<p className="my-5 text-lg text-white tracking-wide flex justify-center items-center gap-2">
|
||||||
Current Balance
|
HOLDINGS :{" "}
|
||||||
</p>
|
<span className="mt-1">
|
||||||
<p className="text-[44px] font-bold text-white tracking-wide leading-10 mb-2">
|
|
||||||
{PriceFormatter(
|
{PriceFormatter(
|
||||||
walletItem.amount * 0.01,
|
walletItem.escrow * 0.01,
|
||||||
walletItem.code,
|
walletItem.code,
|
||||||
undefined,
|
undefined,
|
||||||
"text-[2rem]"
|
"text-[2rem]"
|
||||||
)}
|
)}
|
||||||
</p>
|
</span>
|
||||||
<p className="xxs:-ml-5 mt-10 text-lg text-white tracking-wide flex justify-start items-center gap-2">
|
</p>
|
||||||
HOLDINGS :{" "}
|
{/* for white underline */}
|
||||||
<span className="mt-1">
|
<div className="my-2 w-full h-[1px] bg-white"></div>
|
||||||
{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> */}
|
|
||||||
|
|
||||||
{/* for white underline */}
|
{!accountType ? (
|
||||||
<div className="my-2 w-full h-[1px] bg-white"></div>
|
<WalletAction walletItem={walletItem} payment={payment} openPopUp={openPopUp} />
|
||||||
|
)
|
||||||
{!accountType ? (
|
:
|
||||||
<WalletAction walletItem={walletItem} payment={payment} openPopUp={openPopUp} />
|
null
|
||||||
)
|
}
|
||||||
:
|
{/* </div> */}
|
||||||
null
|
|
||||||
}
|
|
||||||
</div>
|
</div>
|
||||||
{creditPopup.show && (
|
{creditPopup.show && (
|
||||||
<CreditPopup
|
<CreditPopup
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ export default function ChangePasswordTab() {
|
|||||||
};
|
};
|
||||||
return (
|
return (
|
||||||
<div className="changePasswordTab w-full">
|
<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="flex-1 mb-10">
|
||||||
<div className="input-field mb-6">
|
<div className="input-field mb-6">
|
||||||
<label
|
<label
|
||||||
|
|||||||
@@ -216,6 +216,17 @@ class usersService {
|
|||||||
return this.postAuxEnd("/sendmoneyfee", postData);
|
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() {
|
getFamilySampleTasks() {
|
||||||
var postData = {
|
var postData = {
|
||||||
uid: localStorage.getItem("uid"),
|
uid: localStorage.getItem("uid"),
|
||||||
|
|||||||
+2
-1
@@ -21,7 +21,8 @@ module.exports = {
|
|||||||
'alice-blue': '#f0f8ff'
|
'alice-blue': '#f0f8ff'
|
||||||
},
|
},
|
||||||
screens:{
|
screens:{
|
||||||
xxs: '400px'
|
xxs: '400px',
|
||||||
|
xxl:'1900px'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user