Compare commits
26 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| fad38331db | |||
| 9e15c51c31 | |||
| b2bffb3b83 | |||
| dd1a2953da | |||
| ef784dc6ed | |||
| 682745c321 | |||
| c63fbfc147 | |||
| 9b0f847bc1 | |||
| c073be1ce6 | |||
| f43e10a75f | |||
| eb41751628 | |||
| fa7a0bd1da | |||
| 52ff30581f | |||
| 858bd7c0f7 | |||
| b995c36a8e | |||
| 2363bc3fd7 | |||
| ca375c4bae | |||
| 3e6e3d3910 | |||
| 747abfc47b | |||
| 520e74308d | |||
| 36c7fdd30d | |||
| 85269b9e56 | |||
| 95a918e01d | |||
| 3267414454 | |||
| 85607d81b8 | |||
| 5a1ea91b77 |
@@ -23,17 +23,19 @@ export default function ProductCardStyleTwo({
|
||||
|
||||
return (
|
||||
<div
|
||||
className={`card-style-two w-full h-[336px] p-[20px] bg-white dark:bg-dark-white rounded-2xl section-shadow ${
|
||||
className={`card-style-two w-full p-[20px] bg-white dark:bg-dark-white rounded-2xl section-shadow ${
|
||||
className || ""
|
||||
}`}
|
||||
>
|
||||
<div className="flex flex-col justify-between w-full h-full">
|
||||
<div className="thumbnail-area w-full">
|
||||
<div
|
||||
className="w-full h-[236px] p-6 rounded-xl overflow-hidden"
|
||||
className="w-full h-[140px] p-6 rounded-lg overflow-hidden"
|
||||
style={{
|
||||
// background: `url(${`https://blog.wrenchboard.com/wp-content/uploads/${datas.meta_value}`}) 0% 0% / cover no-repeat`,
|
||||
background: `url(${`${bg}${datas.meta_value}`}) 0% 0% / cover no-repeat`,
|
||||
// background: `url(${`${bg}${datas.meta_value}`}) 0% 0% / cover no-repeat`,
|
||||
background: `url(${`${bg}${datas.meta_value}`}) no-repeat`,
|
||||
backgroundSize: '100%',
|
||||
}}
|
||||
>
|
||||
<div className="product-two-options flex justify-between mb-5 relative">
|
||||
@@ -50,7 +52,7 @@ export default function ProductCardStyleTwo({
|
||||
</div>
|
||||
<div className="details-area">
|
||||
{/* title */}
|
||||
<Link to={`/blog-page?blog_id=${datas.ID}`} className="mb-2.5" rel="noreferrer">
|
||||
<Link to={`/blog-page?blog_id=${datas.ID}`} className="py-2 mb-2.5" rel="noreferrer">
|
||||
<h1 className="font-bold text-xl tracking-wide line-clamp-1 text-dark-gray dark:text-white capitalize">
|
||||
{datas.post_title || "dummy title..."}
|
||||
</h1>
|
||||
|
||||
@@ -5,6 +5,7 @@ import FamilyAddFundPopout from './FamilyAddFundPopout'
|
||||
|
||||
function Wallet({wallet, familyData, setFamilyWalletReload}) {
|
||||
const [addFundPopout, setAddFundPopout] = useState({ show: false, data: {} })
|
||||
|
||||
return (
|
||||
<div className='w-full p-4 bg-[aliceblue] rounded-lg'
|
||||
// style={{
|
||||
@@ -14,7 +15,7 @@ function Wallet({wallet, familyData, setFamilyWalletReload}) {
|
||||
<div className="w-full flex justify-start items-center gap-3">
|
||||
<div className="min-w-[50px] min-h-[50px] max-w-min md:max-w-[80px] max-h-min md:max-h-[80px] rounded-full bg-[#e3e3e3] flex justify-center items-center">
|
||||
<img
|
||||
src={localImgLoad(`images/currency/${(wallet.code).toLowerCase()}.svg`)}
|
||||
src={wallet.icon}
|
||||
className="w-full h-full"
|
||||
alt="currency-icon"
|
||||
/>
|
||||
@@ -52,7 +53,7 @@ function Wallet({wallet, familyData, setFamilyWalletReload}) {
|
||||
name="plan"
|
||||
// onClick={onClose}
|
||||
>
|
||||
Plan Wallet
|
||||
Add Card
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -28,7 +28,9 @@ export default function InputCom({
|
||||
direction,
|
||||
tabIndex,
|
||||
error,
|
||||
autoComplete="on"
|
||||
autoComplete="on",
|
||||
minDate='1900-01-01',
|
||||
maxDate='2099-09-13'
|
||||
}) {
|
||||
const inputRef = useRef(null);
|
||||
// Entry Validation
|
||||
@@ -90,26 +92,51 @@ export default function InputCom({
|
||||
: "text-[#5e6278] dark:text-gray-100 bg-[#f5f8fa] border"
|
||||
}`}
|
||||
>
|
||||
<input
|
||||
placeholder={placeholder}
|
||||
value={value}
|
||||
onChange={inputHandler}
|
||||
className={`input-field placeholder:text-base text-dark-gray w-full h-full ${iconName && 'pr-6'} ${
|
||||
inputBg && inputBg} tracking-wide focus:ring-0 focus:outline-none ${fieldClass}`}
|
||||
type={type}
|
||||
id={name}
|
||||
name={name}
|
||||
onInput={onInput}
|
||||
minLength={minLengthValidation()}
|
||||
maxLength={maxLengthValidation()}
|
||||
tabIndex={tabIndex}
|
||||
// pattern={inputPatterns()}
|
||||
ref={inputRef}
|
||||
readOnly={disable}
|
||||
onBlur={blurHandler}
|
||||
dir={direction}
|
||||
autoComplete={autoComplete}
|
||||
/>
|
||||
<>
|
||||
{type == 'date' ?
|
||||
<input
|
||||
placeholder={placeholder}
|
||||
value={value}
|
||||
onChange={inputHandler}
|
||||
className={`input-field placeholder:text-base text-dark-gray w-full h-full ${iconName && 'pr-6'} ${
|
||||
inputBg && inputBg} tracking-wide focus:ring-0 focus:outline-none ${fieldClass}`}
|
||||
type={type}
|
||||
id={name}
|
||||
name={name}
|
||||
onInput={onInput}
|
||||
min={minDate}
|
||||
max={maxDate}
|
||||
tabIndex={tabIndex}
|
||||
// pattern={inputPatterns()}
|
||||
ref={inputRef}
|
||||
readOnly={disable}
|
||||
onBlur={blurHandler}
|
||||
dir={direction}
|
||||
autoComplete={autoComplete}
|
||||
/>
|
||||
:
|
||||
<input
|
||||
placeholder={placeholder}
|
||||
value={value}
|
||||
onChange={inputHandler}
|
||||
className={`input-field placeholder:text-base text-dark-gray w-full h-full ${iconName && 'pr-6'} ${
|
||||
inputBg && inputBg} tracking-wide focus:ring-0 focus:outline-none ${fieldClass}`}
|
||||
type={type}
|
||||
id={name}
|
||||
name={name}
|
||||
onInput={onInput}
|
||||
minLength={minLengthValidation()}
|
||||
maxLength={maxLengthValidation()}
|
||||
tabIndex={tabIndex}
|
||||
// pattern={inputPatterns()}
|
||||
ref={inputRef}
|
||||
readOnly={disable}
|
||||
onBlur={blurHandler}
|
||||
dir={direction}
|
||||
autoComplete={autoComplete}
|
||||
/>
|
||||
}
|
||||
</>
|
||||
{iconName && (
|
||||
<div className="absolute right-6 bottom-3 z-10 flex gap-2">
|
||||
{iconName.split(" ").map((item, index) => (
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import React, { useEffect, useState } from "react";
|
||||
import usersService from "../../../services/UsersService";
|
||||
import LoadingSpinner from "../../Spinners/LoadingSpinner";
|
||||
import {PriceFormatter} from '../../Helpers/PriceFormatter'
|
||||
|
||||
export default function LockJob({
|
||||
details,
|
||||
|
||||
@@ -3,6 +3,7 @@ import background from "../../assets/images/bg-sky-blue.jpg";
|
||||
import { localImgLoad } from "../../lib";
|
||||
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
||||
import FamilyWalletRedeemOptions from "./FamilyWalletRedeemOptions";
|
||||
import {PriceFormatter} from '../Helpers/PriceFormatter'
|
||||
|
||||
/**
|
||||
* Renders a list of wallet items or a loading spinner depending on the state of the `wallet` object.
|
||||
@@ -20,7 +21,7 @@ export default function FamilyWalletBox({ wallet, payment }) {
|
||||
const handleChangeWallet = ({ target: { name } }) => {
|
||||
// FUNCTION TO SWITCH WALLET IF USER HAS MORE THAN TWO WALLETS
|
||||
const currentWalletSelected = wallet?.data?.filter(
|
||||
(item) => item.code == name
|
||||
(item) => item.description == name
|
||||
);
|
||||
setSelectedWallet(currentWalletSelected[0]);
|
||||
setActiveWalletBtn(name);
|
||||
@@ -33,7 +34,7 @@ export default function FamilyWalletBox({ wallet, payment }) {
|
||||
|
||||
useEffect(() => {
|
||||
setSelectedWallet(wallet.data[0]);
|
||||
setActiveWalletBtn(wallet?.data[0]?.code);
|
||||
setActiveWalletBtn(wallet?.data[0]?.description);
|
||||
}, [wallet]);
|
||||
|
||||
return (
|
||||
@@ -54,13 +55,13 @@ export default function FamilyWalletBox({ wallet, payment }) {
|
||||
<>
|
||||
{wallet?.data?.length > 1 && (
|
||||
<div className="wal-selection px-5 py-2 text-black dark:text-white flex items-center gap-2">
|
||||
{wallet?.data?.map((item) => (
|
||||
{wallet?.data?.map((item, index) => (
|
||||
<button
|
||||
className={`py-0.5 px-1 mb-1 rounded-lg border border-orange-500 ${
|
||||
activeWalletBtn == item?.code && "bg-orange-500"
|
||||
activeWalletBtn == item?.description && "bg-orange-500"
|
||||
}`}
|
||||
key={item?.wallet_uid}
|
||||
name={item?.code}
|
||||
key={item?.wallet_uid+index}
|
||||
name={item?.description}
|
||||
onClick={handleChangeWallet}
|
||||
>
|
||||
{item?.description}
|
||||
@@ -69,30 +70,32 @@ export default function FamilyWalletBox({ wallet, payment }) {
|
||||
</div>
|
||||
)}
|
||||
<div
|
||||
className="p-5 bg-white-opacity min-h-[240px]"
|
||||
className="p-5 bg-white-opacity min-h-[240px] flex justify-end items-center"
|
||||
style={{
|
||||
background: `url(${background}) 0% 0% / cover no-repeat`,
|
||||
background: `url(${selectedWallet?.banner}) 0% 0% / cover no-repeat`,
|
||||
}}
|
||||
>
|
||||
{/* image */}
|
||||
<div className="min-w-[100px] min-h-[100px] max-w-min md:max-w-[100px] max-h-min md:max-h-[100px] rounded-full bg-[#e3e3e3] flex justify-center items-center">
|
||||
{/* <div className="min-w-[100px] min-h-[100px] max-w-min md:max-w-[100px] max-h-min md:max-h-[100px] rounded-full bg-[#e3e3e3] flex justify-center items-center">
|
||||
<img
|
||||
src={localImgLoad(`images/currency/${image}`)}
|
||||
className="w-full h-full"
|
||||
alt="currency-icon"
|
||||
/>
|
||||
</div> */}
|
||||
<div className='flex flex-col justify-center'>
|
||||
<p className="text-base sm:text-lg text-white tracking-wide my-3 text-center">
|
||||
Current Balance
|
||||
</p>
|
||||
<p className="text-[44px] lg:text-[62px] font-bold text-white tracking-wide leading-10">
|
||||
{PriceFormatter(
|
||||
selectedWallet?.amount / 100,
|
||||
selectedWallet?.code,
|
||||
undefined,
|
||||
"text-[2rem]"
|
||||
)}
|
||||
</p>
|
||||
</div>
|
||||
<p className="text-base sm:text-lg text-white opacity-[70%] tracking-wide my-3">
|
||||
Current Balance
|
||||
</p>
|
||||
<p className="text-[44px] lg:text-[62px] font-bold text-white tracking-wide leading-10">
|
||||
{Formatter(
|
||||
selectedWallet?.amount / 100,
|
||||
selectedWallet?.code,
|
||||
undefined,
|
||||
"text-[2rem]"
|
||||
)}
|
||||
</p>
|
||||
</div>
|
||||
</>
|
||||
) : (
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import React, { Suspense, lazy, useEffect, useState } from "react";
|
||||
import React, { useEffect, useState } from "react";
|
||||
import { useSelector } from "react-redux";
|
||||
import usersService from "../../services/UsersService";
|
||||
import Layout from "../Partials/Layout";
|
||||
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
||||
const WalletBox = lazy(() => import("./WalletBox"));
|
||||
import WalletBox from "./WalletBox";
|
||||
|
||||
const WalletRoutes = () => {
|
||||
const apiCall = new usersService();
|
||||
@@ -62,13 +62,11 @@ const WalletRoutes = () => {
|
||||
|
||||
return (
|
||||
<Layout>
|
||||
<Suspense fallback={<LoadingSpinner size="16" color="sky-blue" />}>
|
||||
<WalletBox
|
||||
wallet={walletDetails}
|
||||
payment={paymentHistory}
|
||||
countries={allCountries.data}
|
||||
/>
|
||||
</Suspense>
|
||||
</Layout>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { useSelector } from "react-redux";
|
||||
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
||||
import WalletItemCard from "./WalletItemCard";
|
||||
import WalletItemCardFamily from "./WalletItemCardFamily";
|
||||
import WalletItemCardVirtual from './walletvirtual/WalletItemCardVirtual'
|
||||
|
||||
/**
|
||||
* Renders a list of wallet items or a loading spinner depending on the state of the `wallet` object.
|
||||
@@ -9,25 +9,32 @@ import WalletItemCardFamily from "./WalletItemCardFamily";
|
||||
export default function WalletBox({ wallet, payment, countries }) {
|
||||
const { loading, data } = wallet;
|
||||
|
||||
const { userDetails } = useSelector((state) => state.userDetails);
|
||||
const accountType = userDetails?.account_type === "FAMILY";
|
||||
// const { userDetails } = useSelector((state) => state.userDetails);
|
||||
// const accountType = userDetails?.account_type === "FAMILY";
|
||||
|
||||
// console.log('mumu', data)
|
||||
|
||||
return (
|
||||
<div className="my-wallet-wrapper w-full mb-10">
|
||||
<div className="main-wrapper w-full">
|
||||
<div className="balance-inquery w-auto grid md:grid-cols-2 lg:grid-cols-2 xl:grid-cols-[repeat(auto-fill,_minmax(354px,_1fr))] min-[1440px]:grid-cols-[repeat(auto-fill,_minmax(415px,_1fr))] gap-5 mb-11 h-auto">
|
||||
{/* xl:grid-cols[repeat(auto-fill,_minmax(354px,_1fr))] min-[1440px]:grid-cols-[repeat(auto-fill,_minmax(415px,_1fr))] */}
|
||||
{loading ? (
|
||||
<div className="w-full h-full flex items-center justify-center">
|
||||
<LoadingSpinner size="16" color="sky-blue" />
|
||||
</div>
|
||||
) : (
|
||||
data.length > 0 && data.map((item) => (
|
||||
<div key={item.wallet_uid} className="w-full md:max-w-[450px] h-full mb-10 lg:mb-0">
|
||||
<WalletItemCard walletItem={item} payment={payment} countries={countries} />
|
||||
</div>
|
||||
))
|
||||
<div className="w-auto grid md:grid-cols-2 xxl:grid-cols-3 gap-4 md:gap-10">
|
||||
{ data?.length > 0 && data.map((item, index) => (
|
||||
<div key={item.wallet_uid+index} className="w-full h-full">
|
||||
{item.country ?
|
||||
<WalletItemCard walletItem={item} payment={payment} countries={countries} />
|
||||
:
|
||||
<WalletItemCardVirtual walletItem={item} payment={payment} countries={countries} />
|
||||
}
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -67,7 +67,7 @@ export default function WalletHeader(props) {
|
||||
<div className="sm:flex justify-between items-center">
|
||||
<div className="account-name flex space-x-4 items-center mb-2 sm:mb-0">
|
||||
<div className="icon w-14 h-14 transition duration-300 ease-in-out rounded-full flex justify-center items-center bg-light-purple dark:bg-dark-light-purple ">
|
||||
<img src={localImgLoad(`images/currency/${image}`)} className="w-14 h-14" alt="" />
|
||||
<img src={value.icon} className="w-14 h-14" alt="currency icon" />
|
||||
</div>
|
||||
<div className="name">
|
||||
<p className="text-2xl font-bold text-dark-gray dark:text-white">
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import React, { useState } from "react";
|
||||
import { useDispatch, useSelector } from "react-redux";
|
||||
import background from "../../assets/images/bg-sky-blue.jpg"; //shape/balance-bg.svg";
|
||||
// import background from "../../assets/images/bg-sky-blue.jpg"; //shape/balance-bg.svg";
|
||||
import localImgLoad from "../../lib/localImgLoad";
|
||||
import { tableReload } from "../../store/TableReloads";
|
||||
import { PriceFormatter } from "../Helpers/PriceFormatter";
|
||||
@@ -44,25 +44,25 @@ export default function WalletItemCard({ walletItem, payment, countries }) {
|
||||
return (
|
||||
<>
|
||||
<div
|
||||
className="current-balance-widget w-full h-full rounded-2xl overflow-hidden flex flex-col items-center gap-4 p-4 justify-between"
|
||||
className="current-balance-widget w-full h-full min-h-[250px] rounded-2xl overflow-hidden flex flex-col items-center gap-4 p-4 justify-between bg-[#498FC3]"
|
||||
style={{
|
||||
background: `url(${background}) 0% 0% / cover no-repeat`,
|
||||
background: `url(${walletItem?.banner}) 0% 0% / cover no-repeat`,
|
||||
}}
|
||||
>
|
||||
<div className="wallet w-full flex justify-between items-start gap-3">
|
||||
<div className="min-w-[100px] min-h-[100px] max-w-min md:max-w-[150px] max-h-min md:max-h-[150px] rounded-full bg-[#e3e3e3] flex justify-center items-center">
|
||||
<div className="wallet w-full">
|
||||
{/* <div className="min-w-[100px] min-h-[100px] max-w-min md:max-w-[150px] max-h-min md:max-h-[150px] rounded-full bg-[#e3e3e3] flex justify-center items-center">
|
||||
<img
|
||||
src={localImgLoad(`images/currency/${image}`)}
|
||||
className="w-full h-full"
|
||||
alt="currency-icon"
|
||||
/>
|
||||
</div>
|
||||
<div className="balance w-full mt-2 flex justify-center">
|
||||
<div className="">
|
||||
<p className="text-base sm:text-lg text-white opacity-[70%] tracking-wide mb-2 sm:mb-6">
|
||||
</div> */}
|
||||
<div className="balance w-full mt-2 flex justify-end">
|
||||
<div className="flex flex-col items-center">
|
||||
<p className="text-base sm:text-lg text-white tracking-wide mb-2 sm:mb-6">
|
||||
Current Balance
|
||||
</p>
|
||||
<p className="text-[44px] lg:text-[62px] font-bold text-white tracking-wide leading-10 xxs:scale-100 lg:scale-100 xl:scale-125">
|
||||
<p className="text-[44px] lg:text-[62px] font-bold text-white tracking-wide leading-10">
|
||||
{PriceFormatter(
|
||||
walletItem.amount * 0.01,
|
||||
walletItem.code,
|
||||
@@ -75,9 +75,10 @@ export default function WalletItemCard({ walletItem, payment, countries }) {
|
||||
</div>
|
||||
|
||||
{walletItem.escrow > 0 ?
|
||||
<div className='w-full flex justify-end'>
|
||||
<p className="text-lg text-white tracking-wide flex justify-center items-center gap-8">
|
||||
HOLDINGS :{" "}
|
||||
<span className="xxs:scale-100 lg:scale-100 xl:scale-125">
|
||||
<span className="">
|
||||
{PriceFormatter(
|
||||
walletItem.escrow * 0.01,
|
||||
walletItem.code,
|
||||
@@ -86,17 +87,19 @@ export default function WalletItemCard({ walletItem, payment, countries }) {
|
||||
)}
|
||||
</span>
|
||||
</p>
|
||||
:
|
||||
null
|
||||
</div>
|
||||
:
|
||||
null
|
||||
}
|
||||
|
||||
<div className="w-full h-[1px] bg-white"></div>
|
||||
|
||||
<WalletAction
|
||||
walletItem={{ ...walletItem, walletCountry: currentWalletCurrency }}
|
||||
payment={payment}
|
||||
openPopUp={openPopUp}
|
||||
/>
|
||||
<div className='w-full'>
|
||||
<div className="w-full h-[1px] mb-2 bg-white"></div>
|
||||
<WalletAction
|
||||
walletItem={{ ...walletItem, walletCountry: currentWalletCurrency }}
|
||||
payment={payment}
|
||||
openPopUp={openPopUp}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{creditPopup.show && (
|
||||
|
||||
@@ -0,0 +1,599 @@
|
||||
import { useEffect, useState } from "react";
|
||||
import { Form, Formik } from "formik";
|
||||
import * as Yup from "yup";
|
||||
import { useSelector } from "react-redux";
|
||||
import ModalCom from "../../Helpers/ModalCom";
|
||||
import LoadingSpinner from "../../Spinners/LoadingSpinner";
|
||||
import CustomTimer from "../../countdown/CustomTimer";
|
||||
import InputCom from '../../Helpers/Inputs/InputCom'
|
||||
import usersService from "../../../services/UsersService";
|
||||
|
||||
|
||||
const validationSchema = Yup.object().shape({
|
||||
|
||||
country: Yup.string()
|
||||
.required("Required"),
|
||||
phone_number: Yup.string()
|
||||
.min(9, "Invalid")
|
||||
.max(11, "Invalid")
|
||||
.required("Required"),
|
||||
// birthYear: Yup.string()
|
||||
// .required("Required"),
|
||||
// birthMonth: Yup.string()
|
||||
// .required("Required"),
|
||||
// birthDay: Yup.string()
|
||||
// .required("Required"),
|
||||
address: Yup.string()
|
||||
.min(5, "Min 3 characters")
|
||||
.max(50, "Max 25 characters")
|
||||
.required("Required"),
|
||||
city: Yup.string()
|
||||
.min(2, "Min 3 characters")
|
||||
.max(25, "Max 25 characters")
|
||||
.required("Required"),
|
||||
state: Yup.string()
|
||||
.required("Required"),
|
||||
zipCode: Yup.string()
|
||||
.min(1, "Min 3 characters")
|
||||
.max(8, "Max 8 characters")
|
||||
.required("Required"),
|
||||
dob: Yup.string()
|
||||
.required("Required"),
|
||||
});
|
||||
|
||||
const VirtualAddCardPopout = ({ details, onClose, situation, walletItem }) => {
|
||||
|
||||
const { userDetails } = useSelector((state) => state.userDetails);
|
||||
|
||||
const countryCode = userDetails?.country
|
||||
|
||||
const userApi = new usersService()
|
||||
|
||||
const [requestStatus, setRequestStatus] = useState({loading: false, status:false, message: ''})
|
||||
|
||||
const [allCountries, setAllCountries] = useState({loading: true, data: []}) // VARIABLE TO HOLD COUNTRY LIST
|
||||
|
||||
const [state, setState] = useState({loading: true, data: {}}) // VARIABLE TO HOLD STATE LIST
|
||||
|
||||
|
||||
let initialValues = {
|
||||
// initial values for formik
|
||||
country: countryCode ? countryCode : '',
|
||||
phone_number: '',
|
||||
email: userDetails?.email,
|
||||
firstname: userDetails?.firstname,
|
||||
lastname: userDetails?.lastname,
|
||||
birthYear: '',
|
||||
birthMonth: '',
|
||||
birthDay: '',
|
||||
address: '',
|
||||
city: userDetails?.city ? userDetails.city : '',
|
||||
state: '',
|
||||
zipCode: '',
|
||||
dob: ''
|
||||
};
|
||||
|
||||
|
||||
const handleSubmit = (values) => {
|
||||
// const reqData1 = {
|
||||
// name: values.firstname + ' ' + values.firstname,
|
||||
// email: values.email,
|
||||
// phone_number: values.phone_number,
|
||||
// status: 'active',
|
||||
// type: 'individual',
|
||||
// individual: {
|
||||
// first_name: values.firstname,
|
||||
// last_name: values.lastname,
|
||||
// dob: {day: values.birthDay, month: values.birthMonth, year: values.birthYear}
|
||||
// },
|
||||
// billing:{
|
||||
// address : {
|
||||
// line1: values.address,
|
||||
// city: values.city,
|
||||
// state: values.state,
|
||||
// postal_code: values.zipCode,
|
||||
// country: values.country
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
const reqData = {
|
||||
request_type: '100',
|
||||
address: values.address,
|
||||
city: values.city,
|
||||
state: values.state,
|
||||
country: values.country,
|
||||
postal_code: values.zipCode,
|
||||
phone_number: values.phone_number,
|
||||
// dob_day: values.birthDay,
|
||||
// dob_month: values.birthMonth,
|
||||
// dob_year: values.birthYear,
|
||||
dob_day: Number(new Date(values.dob).getDate()),
|
||||
dob_month: Number(new Date(values.dob).getMonth()) + 1,
|
||||
dob_year: Number(new Date(values.dob).getFullYear()),
|
||||
dob: values.dob
|
||||
}
|
||||
// console.log('Values', reqData)
|
||||
setRequestStatus({loading: true, status:false, message: ''})
|
||||
userApi.walletCardRequest(reqData).then(res => {
|
||||
if(res?.data?.internal_return < 0){
|
||||
setRequestStatus({loading: false, status:false, message: 'Failed, try again'})
|
||||
setTimeout(()=>{
|
||||
setRequestStatus({loading: false, status:true, message: ''})
|
||||
},4000)
|
||||
return
|
||||
}
|
||||
setRequestStatus({loading: false, status:true, message: 'Successful'})
|
||||
setTimeout(()=>{
|
||||
setRequestStatus({loading: false, status:true, message: ''})
|
||||
onClose()
|
||||
},4000)
|
||||
}).catch(err => {
|
||||
console.log('ERR', err)
|
||||
setRequestStatus({loading: false, status:false, message: 'Unable to complete'})
|
||||
setTimeout(()=>{
|
||||
setRequestStatus({loading: false, status:false, message: ''})
|
||||
},4000)
|
||||
})
|
||||
}
|
||||
|
||||
useEffect(()=>{
|
||||
// Get Country Api
|
||||
userApi.getSignupCountryData().then(res =>{
|
||||
if(!res?.data?.result_list){
|
||||
return setAllCountries({ loading: false, data: [] });
|
||||
}
|
||||
// if(countryCode){
|
||||
// return setAllCountries({ loading: false, data: res?.data?.result_list?.filter(item => item?.code == countryCode) });
|
||||
// }
|
||||
setAllCountries({ loading: false, data: res?.data?.result_list });
|
||||
}).catch(err => {
|
||||
setAllCountries({ loading: false, data: [] });
|
||||
console.log('err', err)
|
||||
})
|
||||
},[])
|
||||
|
||||
useEffect(()=>{
|
||||
// GET STATE API
|
||||
setState({loading: true, data: {}})
|
||||
userApi.getStateFromCountry({country: countryCode}).then(res =>{
|
||||
if(!res?.data?.country_state){
|
||||
return setState({ loading: false, data: {} });
|
||||
}
|
||||
setState({ loading: false, data: res?.data?.country_state});
|
||||
}).catch(err => {
|
||||
setState({ loading: false, data: {} });
|
||||
console.log('err', err)
|
||||
})
|
||||
},[initialValues.country])
|
||||
|
||||
return (
|
||||
<ModalCom
|
||||
action={onClose}
|
||||
situation={situation}
|
||||
>
|
||||
<Formik
|
||||
initialValues={initialValues}
|
||||
validationSchema={validationSchema}
|
||||
onSubmit={handleSubmit}
|
||||
>
|
||||
{(props) => (
|
||||
<div className="logout-modal-wrapper mx-auto w-[90%] md:w-[768px] h-auto bg-white dark:bg-dark-white lg:rounded-2xl overflow-y-auto">
|
||||
<Form className="w-full">
|
||||
<div className="modal-header-con">
|
||||
<h1 className="modal-title">
|
||||
{walletItem?.description}
|
||||
</h1>
|
||||
<button
|
||||
type="button"
|
||||
className="modal-close-btn"
|
||||
onClick={onClose}
|
||||
>
|
||||
<svg
|
||||
width="36"
|
||||
height="36"
|
||||
viewBox="0 0 36 36"
|
||||
fill="none"
|
||||
className="fill-current"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<path
|
||||
d="M36 16.16C36 17.4399 36 18.7199 36 20.0001C35.7911 20.0709 35.8636 20.2554 35.8385 20.4001C34.5321 27.9453 30.246 32.9248 22.9603 35.2822C21.9006 35.6251 20.7753 35.7657 19.6802 35.9997C18.4003 35.9997 17.1204 35.9997 15.8401 35.9997C15.5896 35.7086 15.2189 35.7732 14.9034 35.7093C7.77231 34.2621 3.08728 30.0725 0.769671 23.187C0.435002 22.1926 0.445997 21.1199 0 20.1599C0 18.7198 0 17.2798 0 15.8398C0.291376 15.6195 0.214408 15.2656 0.270759 14.9808C1.71321 7.69774 6.02611 2.99691 13.0428 0.700951C14.0118 0.383805 15.0509 0.386897 15.9999 0C17.2265 0 18.4532 0 19.6799 0C19.7156 0.124041 19.8125 0.136067 19.9225 0.146719C27.3 0.868973 33.5322 6.21922 35.3801 13.427C35.6121 14.3313 35.7945 15.2484 36 16.16ZM33.011 18.0787C33.0433 9.77105 26.3423 3.00309 18.077 2.9945C9.78479 2.98626 3.00344 9.658 2.98523 17.8426C2.96667 26.1633 9.58859 32.9601 17.7602 33.0079C26.197 33.0577 32.9787 26.4186 33.011 18.0787Z"
|
||||
fill=""
|
||||
fillOpacity="0.6"
|
||||
/>
|
||||
<path
|
||||
d="M15.9309 18.023C13.9329 16.037 12.007 14.1207 10.0787 12.2072C9.60071 11.733 9.26398 11.2162 9.51996 10.506C9.945 9.32677 11.1954 9.0811 12.1437 10.0174C13.9067 11.7585 15.6766 13.494 17.385 15.2879C17.9108 15.8401 18.1633 15.7487 18.6375 15.258C20.3586 13.4761 22.1199 11.7327 23.8822 9.99096C24.8175 9.06632 26.1095 9.33639 26.4967 10.517C26.7286 11.2241 26.3919 11.7413 25.9133 12.2178C24.1757 13.9472 22.4477 15.6855 20.7104 17.4148C20.5228 17.6018 20.2964 17.7495 20.0466 17.9485C22.0831 19.974 24.0372 21.8992 25.9689 23.8468C26.9262 24.8119 26.6489 26.1101 25.4336 26.4987C24.712 26.7292 24.2131 26.3441 23.7455 25.8757C21.9945 24.1227 20.2232 22.3892 18.5045 20.6049C18.0698 20.1534 17.8716 20.2269 17.4802 20.6282C15.732 22.4215 13.9493 24.1807 12.1777 25.951C11.7022 26.4262 11.193 26.7471 10.4738 26.4537C9.31345 25.9798 9.06881 24.8398 9.98589 23.8952C11.285 22.5576 12.6138 21.2484 13.9387 19.9355C14.5792 19.3005 15.2399 18.6852 15.9309 18.023Z"
|
||||
fill="#"
|
||||
fillOpacity="0.6"
|
||||
/>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
<div className='p-4 w-full flex flex-col h-auto md:h-[28rem]'>
|
||||
<div className='pb-4'>
|
||||
<h1 className='text-lg md:text-xl flex gap-1'><span className='font-bold'>Name:</span>{userDetails.lastname} {userDetails.firstname}</h1>
|
||||
</div>
|
||||
<div className="grid md:grid-cols-2 gap-4">
|
||||
{/* left part */}
|
||||
<div className='w-full flex flex-col gap-4'>
|
||||
<div className="field w-full grid md:grid-cols-5 gap-4">
|
||||
<div className="md:col-span-2 field w-full">
|
||||
<label
|
||||
htmlFor="country"
|
||||
className="job-label job-label-flex"
|
||||
>
|
||||
<span>Country</span>
|
||||
{props.errors.country && props.touched.country && (
|
||||
<span className="text-[12px] text-red-500">
|
||||
{props.errors.country}
|
||||
</span>
|
||||
)}
|
||||
</label>
|
||||
<select
|
||||
id="country"
|
||||
name="country"
|
||||
value={props.values.country}
|
||||
className={`input-field p-2 mt-3 rounded-full placeholder:text-base text-dark-gray w-full h-[42px] bg-slate-100 focus:ring-0 focus:outline-none border`}
|
||||
onChange={props.handleChange}
|
||||
disabled={countryCode ? true : false}
|
||||
>
|
||||
{allCountries.loading ?
|
||||
<option className="text-slate-500 text-lg" value="">
|
||||
Loading...
|
||||
</option>
|
||||
: allCountries.data?.length > 0 ?
|
||||
<>
|
||||
<option className="text-slate-500 text-lg" value="">
|
||||
Select Country
|
||||
</option>
|
||||
{allCountries.data?.map(item => (
|
||||
<option key={item.uid} className="text-slate-500 text-lg" value={item.code}>
|
||||
{item.country}
|
||||
</option>
|
||||
))}
|
||||
</>
|
||||
:
|
||||
<option className="text-slate-500 text-lg" value="">
|
||||
Not Found
|
||||
</option>
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
<div className='md:col-span-3'>
|
||||
<InputCom
|
||||
fieldClass="px-6"
|
||||
label="Phone Number"
|
||||
labelClass="tracking-wide"
|
||||
inputBg="bg-slate-100"
|
||||
inputClass="w-full input-curve lg border border-light-purple"
|
||||
type="text"
|
||||
name="phone_number"
|
||||
value={props.values.phone_number}
|
||||
inputHandler={props.handleChange}
|
||||
error={(props.errors.phone_number && props.touched.phone_number) && props.errors.phone_number}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<InputCom
|
||||
disable={true}
|
||||
fieldClass="px-6"
|
||||
label="Email"
|
||||
labelClass="tracking-wide"
|
||||
inputBg="bg-slate-100"
|
||||
inputClass="input-curve lg border border-light-purple"
|
||||
type="text"
|
||||
name="email"
|
||||
value={props.values.email}
|
||||
inputHandler={props.handleChange}
|
||||
error={(props.errors.email && props.touched.email) && props.errors.email}
|
||||
/>
|
||||
<div className="hidden field w-full md:grid-cols-2 gap-4">
|
||||
<InputCom
|
||||
disable={true}
|
||||
fieldClass="px-6"
|
||||
label="Firstname"
|
||||
labelClass="tracking-wide"
|
||||
inputBg="bg-slate-100"
|
||||
inputClass="input-curve lg border border-light-purple"
|
||||
type="text"
|
||||
name="firstname"
|
||||
value={props.values.firstname}
|
||||
inputHandler={props.handleChange}
|
||||
error={(props.errors.firstname && props.touched.firstname) && props.errors.firstname}
|
||||
/>
|
||||
<InputCom
|
||||
disable={true}
|
||||
fieldClass="px-6"
|
||||
label="Lastname"
|
||||
labelClass="tracking-wide"
|
||||
inputBg="bg-slate-100"
|
||||
inputClass="input-curve lg border border-light-purple"
|
||||
type="text"
|
||||
name="lastname"
|
||||
value={props.values.lastname}
|
||||
inputHandler={props.handleChange}
|
||||
error={(props.errors.lastname && props.touched.lastname) && props.errors.lastname}
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* hidden section */}
|
||||
<div className="hidden field w-full flex-col gap-4">
|
||||
<p className='job-label'>Date of Birth</p>
|
||||
<div className='xxs:grid-cols-3 gap-4'>
|
||||
<div className="field w-full">
|
||||
<label
|
||||
htmlFor="birthDay"
|
||||
className="job-label job-label-flex"
|
||||
>
|
||||
<span>Day</span>
|
||||
{props.errors.birthDay && props.touched.birthDay && (
|
||||
<span className="text-[12px] text-red-500">
|
||||
{props.errors.birthDay}
|
||||
</span>
|
||||
)}
|
||||
</label>
|
||||
<select
|
||||
id="birthDay"
|
||||
name="birthDay"
|
||||
value={props.values.birthDay}
|
||||
className={`input-field p-2 mt-3 rounded-full placeholder:text-base text-dark-gray w-full h-[42px] bg-slate-100 focus:ring-0 focus:outline-none border`}
|
||||
onChange={props.handleChange}
|
||||
>
|
||||
<>
|
||||
<option className="text-slate-500 text-lg" value=''>
|
||||
select
|
||||
</option>
|
||||
{day.map(item => (
|
||||
<option key={item} className="text-slate-500 text-lg" value={item}>
|
||||
{item}
|
||||
</option>
|
||||
))}
|
||||
</>
|
||||
</select>
|
||||
</div>
|
||||
<div className="field w-full">
|
||||
<label
|
||||
htmlFor="birthMonth"
|
||||
className="job-label job-label-flex"
|
||||
>
|
||||
<span>Month</span>
|
||||
{props.errors.birthMonth && props.touched.birthMonth && (
|
||||
<span className="text-[12px] text-red-500">
|
||||
{props.errors.birthMonth}
|
||||
</span>
|
||||
)}
|
||||
</label>
|
||||
<select
|
||||
id="birthMonth"
|
||||
name="birthMonth"
|
||||
value={props.values.birthMonth}
|
||||
className={`input-field p-2 mt-3 rounded-full placeholder:text-base text-dark-gray w-full h-[42px] bg-slate-100 focus:ring-0 focus:outline-none border`}
|
||||
onChange={props.handleChange}
|
||||
>
|
||||
<>
|
||||
<option className="text-slate-500 text-lg" value=''>
|
||||
select
|
||||
</option>
|
||||
{month.map(item => (
|
||||
<option key={item.value} className="text-slate-500 text-lg" value={item.value}>
|
||||
{item.name}
|
||||
</option>
|
||||
))}
|
||||
</>
|
||||
</select>
|
||||
</div>
|
||||
<div className="field w-full">
|
||||
<label
|
||||
htmlFor="birthYear"
|
||||
className="job-label job-label-flex"
|
||||
>
|
||||
<span>Year</span>
|
||||
{props.errors.birthYear && props.touched.birthYear && (
|
||||
<span className="text-[12px] text-red-500">
|
||||
{props.errors.birthYear}
|
||||
</span>
|
||||
)}
|
||||
</label>
|
||||
<select
|
||||
id="birthYear"
|
||||
name="birthYear"
|
||||
value={props.values.birthYear}
|
||||
className={`input-field p-2 mt-3 rounded-full placeholder:text-base text-dark-gray w-full h-[42px] bg-slate-100 focus:ring-0 focus:outline-none border`}
|
||||
onChange={props.handleChange}
|
||||
>
|
||||
<>
|
||||
<option className="text-slate-500 text-lg" value=''>
|
||||
select
|
||||
</option>
|
||||
{year.map(item => (
|
||||
<option key={item} className="text-slate-500 text-lg" value={item}>
|
||||
{item}
|
||||
</option>
|
||||
))}
|
||||
</>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="field w-full grid md:grid-cols-3 gap-4">
|
||||
<p className='hidden md:flex w-full md:col-span-1 job-label items-center'>Date of Birth</p>
|
||||
<div className='w-full md:col-span-2 '>
|
||||
<InputCom
|
||||
fieldClass="px-6"
|
||||
label="Date of Birth"
|
||||
labelClass="md:hidden tracking-wide"
|
||||
inputBg="bg-slate-100"
|
||||
inputClass="input-curve lg border border-light-purple"
|
||||
type="date"
|
||||
name="dob"
|
||||
value={props.values.dob}
|
||||
inputHandler={props.handleChange}
|
||||
error={(props.errors.dob && props.touched.dob) && props.errors.dob}
|
||||
maxDate={year[0] + '-12-31'}
|
||||
minDate={year[year?.length - 1] + '-01-01'}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* right part */}
|
||||
<div className='w-full p-4 flex flex-col gap-4 bg-blue-200 dark:bg-slate-900 rounded-2xl'>
|
||||
<InputCom
|
||||
fieldClass="px-6"
|
||||
label="Address"
|
||||
labelClass="tracking-wide"
|
||||
inputBg="bg-slate-100"
|
||||
inputClass="input-curve lg border border-light-purple"
|
||||
type="text"
|
||||
name="address"
|
||||
value={props.values.address}
|
||||
inputHandler={props.handleChange}
|
||||
error={(props.errors.address && props.touched.address) && props.errors.address}
|
||||
/>
|
||||
<InputCom
|
||||
fieldClass="px-6"
|
||||
label="City"
|
||||
labelClass="tracking-wide"
|
||||
inputBg="bg-slate-100"
|
||||
inputClass="input-curve lg border border-light-purple"
|
||||
type="text"
|
||||
name="city"
|
||||
value={props.values.city}
|
||||
inputHandler={props.handleChange}
|
||||
error={(props.errors.city && props.touched.city) && props.errors.city}
|
||||
/>
|
||||
{/* <InputCom
|
||||
fieldClass="px-6"
|
||||
label="State/Province"
|
||||
labelClass="tracking-wide"
|
||||
inputBg="bg-slate-100"
|
||||
inputClass="input-curve lg border border-light-purple"
|
||||
type="text"
|
||||
name="state"
|
||||
value={props.values.state}
|
||||
inputHandler={props.handleChange}
|
||||
error={(props.errors.state && props.touched.state) && props.errors.state}
|
||||
/> */}
|
||||
|
||||
<div className="field w-full grid md:grid-cols-2 gap-4">
|
||||
<div className="field w-full">
|
||||
<label
|
||||
htmlFor="state"
|
||||
className="job-label job-label-flex"
|
||||
>
|
||||
<span>State/Province</span>
|
||||
{props.errors.state && props.touched.state && (
|
||||
<span className="text-[12px] text-red-500">
|
||||
{props.errors.state}
|
||||
</span>
|
||||
)}
|
||||
</label>
|
||||
<select
|
||||
id="state"
|
||||
name="state"
|
||||
value={props.values.state}
|
||||
className={`input-field p-2 mt-3 rounded-full placeholder:text-base text-dark-gray w-full h-[42px] bg-slate-100 focus:ring-0 focus:outline-none border`}
|
||||
onChange={props.handleChange}
|
||||
>
|
||||
{state.loading ?
|
||||
<option className="text-slate-500 text-lg" value="">
|
||||
Loading...
|
||||
</option>
|
||||
: Object.keys(state.data)?.length > 0 ?
|
||||
<>
|
||||
<option className="text-slate-500 text-lg" value="">
|
||||
Select State
|
||||
</option>
|
||||
{Object.keys(state.data)?.map((item, index) => (
|
||||
<option key={index} className="text-slate-500 text-lg" value={item}>
|
||||
{state?.data[item]}
|
||||
</option>
|
||||
))}
|
||||
</>
|
||||
:
|
||||
<option className="text-slate-500 text-lg" value="">
|
||||
Not Found
|
||||
</option>
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<InputCom
|
||||
fieldClass="px-6"
|
||||
label="Zip Code"
|
||||
labelClass="tracking-wide"
|
||||
inputBg="bg-slate-100"
|
||||
inputClass="input-curve lg border border-light-purple"
|
||||
type="text"
|
||||
name="zipCode"
|
||||
value={props.values.zipCode}
|
||||
inputHandler={props.handleChange}
|
||||
error={(props.errors.zipCode && props.touched.zipCode) && props.errors.zipCode}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{requestStatus.message &&
|
||||
<div className='px-4 my-1'>
|
||||
<p className={`text-center text-base py-1 font-bold ${requestStatus.status ? 'bg-emerald-600 text-white' : 'bg-red-100 text-red-600'}`}>{requestStatus.message}</p>
|
||||
</div>
|
||||
}
|
||||
<div className="modal-footer-wrapper grid grid-cols-1 xxs:grid-cols-3">
|
||||
<div className="w-full col-span-1 xxs:col-span-2 xxs:col-start-2 flex justify-between items-center">
|
||||
<button
|
||||
type="button"
|
||||
onClick={onClose}
|
||||
className="custom-btn bg-[#f5a430] text-black text-base"
|
||||
>
|
||||
Cancel
|
||||
</button>
|
||||
|
||||
<>
|
||||
{requestStatus.loading ?
|
||||
<LoadingSpinner size="6" color="sky-blue" />
|
||||
:
|
||||
<button
|
||||
type="submit"
|
||||
className="custom-btn btn-gradient text-base text-white"
|
||||
disabled={requestStatus.loading || requestStatus.status}
|
||||
>
|
||||
Continue
|
||||
</button>
|
||||
}
|
||||
</>
|
||||
</div>
|
||||
</div>
|
||||
</Form>
|
||||
</div>
|
||||
)}
|
||||
</Formik>
|
||||
</ModalCom>
|
||||
);
|
||||
};
|
||||
|
||||
export default VirtualAddCardPopout;
|
||||
|
||||
|
||||
|
||||
const day = new Array(31).fill(0).map((_,i) => i+1 )
|
||||
|
||||
const month = [
|
||||
{value: 1, name: 'January'},
|
||||
{value: 2, name: 'February'},
|
||||
{value: 3, name: 'March'},
|
||||
{value: 4, name: 'April'},
|
||||
{value: 5, name: 'May'},
|
||||
{value: 6, name: 'June'},
|
||||
{value: 7, name: 'July'},
|
||||
{value: 8, name: 'August'},
|
||||
{value: 9, name: 'September'},
|
||||
{value: 10, name: 'October'},
|
||||
{value: 11, name: 'November'},
|
||||
{value: 12, name: 'December'},
|
||||
]
|
||||
|
||||
const date = new Date().getFullYear()
|
||||
|
||||
const year = new Array(100).fill(0).map((_,i) => (date-2) - i+1 )
|
||||
@@ -0,0 +1,23 @@
|
||||
import React, { useEffect, useState } from "react";
|
||||
import usersService from "../../../services/UsersService";
|
||||
|
||||
|
||||
function WalletActionVirtual({ walletItem, openPopUp, btnText }) {
|
||||
|
||||
return (
|
||||
<div className="counters w-full flex justify-end gap-2">
|
||||
<div className="w-1/2 flex justify-end items-center">
|
||||
<button
|
||||
className="logout-btn btn-gradient text-white"
|
||||
onClick={() => {
|
||||
openPopUp(walletItem?.description, {walletItem});
|
||||
}}
|
||||
>
|
||||
{btnText}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default WalletActionVirtual;
|
||||
@@ -0,0 +1,131 @@
|
||||
import React, { useState } from "react";
|
||||
import { useDispatch, useSelector } from "react-redux";
|
||||
import localImgLoad from "../../../lib/localImgLoad";
|
||||
import { tableReload } from "../../../store/TableReloads";
|
||||
import { PriceFormatter } from "../../Helpers/PriceFormatter";
|
||||
import WalletActionVirtual from "./WalletActionVirtual";
|
||||
import VirtualAddCardPopout from "./VirtualAddCardPopout";
|
||||
import WrenchTokenPopout from './WrenchTokenPopout'
|
||||
import WrenchPointPopout from './WrenchPointPopout'
|
||||
|
||||
/**
|
||||
* Renders a card displaying information about a wallet item.
|
||||
*/
|
||||
export default function WalletItemCardVirtual({ walletItem, payment, countries }) {
|
||||
|
||||
const dispatch = useDispatch();
|
||||
const [virtualPopup, setVirtualPopup] = useState({ name: '', data: {} });
|
||||
|
||||
/**
|
||||
* Opens the credit popup.
|
||||
* @param {Object} value - The value object.
|
||||
*/
|
||||
const openPopUp = (name, value) => {
|
||||
setVirtualPopup({
|
||||
name: name.toLowerCase(),
|
||||
data: { ...value },
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Closes the credit popup and dispatches a table reload action.
|
||||
*/
|
||||
const closePopUp = () => {
|
||||
setVirtualPopup({ name: false, data: {} });
|
||||
// dispatch(tableReload({ type: "WALLETTABLE" }));
|
||||
};
|
||||
|
||||
const currentWalletCurrency = countries?.filter((country) => country.code === walletItem.country);
|
||||
|
||||
const image = walletItem.code
|
||||
? `${walletItem.code.toLowerCase()}.svg`
|
||||
: "default.png";
|
||||
|
||||
|
||||
return (
|
||||
<>
|
||||
<div
|
||||
className="current-balance-widget w-full h-full min-h-[250px] rounded-2xl overflow-hidden flex flex-col items-center gap-4 p-4 justify-between bg-[#498FC3]"
|
||||
style={{
|
||||
background: `url(${walletItem?.banner}) 0% 0% / cover no-repeat`,
|
||||
}}
|
||||
>
|
||||
<div className="wallet w-full">
|
||||
{/* <div className="min-w-[100px] min-h-[100px] max-w-min md:max-w-[150px] max-h-min md:max-h-[150px] rounded-full bg-[#e3e3e3] flex justify-center items-center">
|
||||
<img
|
||||
src={localImgLoad(`images/currency/${image}`)}
|
||||
className="w-full h-full"
|
||||
alt="currency-icon"
|
||||
/>
|
||||
</div> */}
|
||||
<div className="balance w-full mt-2 flex justify-end">
|
||||
<div className="">
|
||||
<p className="text-lg sm:text-2xl font-bold text-white tracking-wide mb-2 sm:mb-6">
|
||||
{walletItem?.description}
|
||||
</p>
|
||||
{/* <p className="text-[44px] lg:text-[62px] font-bold text-white tracking-wide leading-10 xxs:scale-100 lg:scale-100 xl:scale-125">
|
||||
{PriceFormatter(
|
||||
walletItem.amount * 0.01,
|
||||
walletItem.code,
|
||||
undefined,
|
||||
"text-[2rem]"
|
||||
)}
|
||||
</p> */}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* {walletItem.escrow > 0 ?
|
||||
<p className="text-lg text-white tracking-wide flex justify-center items-center gap-8">
|
||||
HOLDINGS :{" "}
|
||||
<span className="xxs:scale-100 lg:scale-100 xl:scale-125">
|
||||
{PriceFormatter(
|
||||
walletItem.escrow * 0.01,
|
||||
walletItem.code,
|
||||
undefined,
|
||||
"text-[1.5rem]"
|
||||
)}
|
||||
</span>
|
||||
</p>
|
||||
:
|
||||
null
|
||||
} */}
|
||||
<div className='w-full'>
|
||||
<div className="w-full h-[1px] mb-2 bg-white"></div>
|
||||
<WalletActionVirtual
|
||||
walletItem={walletItem}
|
||||
openPopUp={openPopUp}
|
||||
btnText={walletItem?.rt_action_text}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{virtualPopup.name == 'add virtual debit card' && (
|
||||
<VirtualAddCardPopout
|
||||
details={virtualPopup.data}
|
||||
walletItem={walletItem}
|
||||
onClose={closePopUp}
|
||||
situation={virtualPopup.name}
|
||||
/>
|
||||
)}
|
||||
|
||||
{virtualPopup.name == 'wrench token' && (
|
||||
<WrenchTokenPopout
|
||||
details={virtualPopup.data}
|
||||
walletItem={walletItem}
|
||||
onClose={closePopUp}
|
||||
situation={virtualPopup.name}
|
||||
/>
|
||||
)}
|
||||
|
||||
{virtualPopup.name == 'wrench points' && (
|
||||
<WrenchPointPopout
|
||||
details={virtualPopup.data}
|
||||
walletItem={walletItem}
|
||||
onClose={closePopUp}
|
||||
situation={virtualPopup.name}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
import { useState } from "react";
|
||||
import ModalCom from "../../Helpers/ModalCom";
|
||||
import LoadingSpinner from "../../Spinners/LoadingSpinner";
|
||||
import CustomTimer from "../../countdown/CustomTimer";
|
||||
|
||||
const WrenchPointPopout = ({ details, onClose, situation, walletItem }) => {
|
||||
const [input, setInput] = useState("");
|
||||
|
||||
return (
|
||||
<ModalCom
|
||||
action={onClose}
|
||||
situation={situation}
|
||||
>
|
||||
<div className="logout-modal-wrapper w-[90%] md:w-[768px] h-auto bg-white dark:bg-dark-white lg:rounded-2xl overflow-y-auto">
|
||||
<div className="modal-header-con">
|
||||
<h1 className="modal-title">
|
||||
{walletItem?.description}
|
||||
</h1>
|
||||
<button
|
||||
type="button"
|
||||
className="modal-close-btn"
|
||||
onClick={onClose}
|
||||
>
|
||||
<svg
|
||||
width="36"
|
||||
height="36"
|
||||
viewBox="0 0 36 36"
|
||||
fill="none"
|
||||
className="fill-current"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<path
|
||||
d="M36 16.16C36 17.4399 36 18.7199 36 20.0001C35.7911 20.0709 35.8636 20.2554 35.8385 20.4001C34.5321 27.9453 30.246 32.9248 22.9603 35.2822C21.9006 35.6251 20.7753 35.7657 19.6802 35.9997C18.4003 35.9997 17.1204 35.9997 15.8401 35.9997C15.5896 35.7086 15.2189 35.7732 14.9034 35.7093C7.77231 34.2621 3.08728 30.0725 0.769671 23.187C0.435002 22.1926 0.445997 21.1199 0 20.1599C0 18.7198 0 17.2798 0 15.8398C0.291376 15.6195 0.214408 15.2656 0.270759 14.9808C1.71321 7.69774 6.02611 2.99691 13.0428 0.700951C14.0118 0.383805 15.0509 0.386897 15.9999 0C17.2265 0 18.4532 0 19.6799 0C19.7156 0.124041 19.8125 0.136067 19.9225 0.146719C27.3 0.868973 33.5322 6.21922 35.3801 13.427C35.6121 14.3313 35.7945 15.2484 36 16.16ZM33.011 18.0787C33.0433 9.77105 26.3423 3.00309 18.077 2.9945C9.78479 2.98626 3.00344 9.658 2.98523 17.8426C2.96667 26.1633 9.58859 32.9601 17.7602 33.0079C26.197 33.0577 32.9787 26.4186 33.011 18.0787Z"
|
||||
fill=""
|
||||
fillOpacity="0.6"
|
||||
/>
|
||||
<path
|
||||
d="M15.9309 18.023C13.9329 16.037 12.007 14.1207 10.0787 12.2072C9.60071 11.733 9.26398 11.2162 9.51996 10.506C9.945 9.32677 11.1954 9.0811 12.1437 10.0174C13.9067 11.7585 15.6766 13.494 17.385 15.2879C17.9108 15.8401 18.1633 15.7487 18.6375 15.258C20.3586 13.4761 22.1199 11.7327 23.8822 9.99096C24.8175 9.06632 26.1095 9.33639 26.4967 10.517C26.7286 11.2241 26.3919 11.7413 25.9133 12.2178C24.1757 13.9472 22.4477 15.6855 20.7104 17.4148C20.5228 17.6018 20.2964 17.7495 20.0466 17.9485C22.0831 19.974 24.0372 21.8992 25.9689 23.8468C26.9262 24.8119 26.6489 26.1101 25.4336 26.4987C24.712 26.7292 24.2131 26.3441 23.7455 25.8757C21.9945 24.1227 20.2232 22.3892 18.5045 20.6049C18.0698 20.1534 17.8716 20.2269 17.4802 20.6282C15.732 22.4215 13.9493 24.1807 12.1777 25.951C11.7022 26.4262 11.193 26.7471 10.4738 26.4537C9.31345 25.9798 9.06881 24.8398 9.98589 23.8952C11.285 22.5576 12.6138 21.2484 13.9387 19.9355C14.5792 19.3005 15.2399 18.6852 15.9309 18.023Z"
|
||||
fill="#"
|
||||
fillOpacity="0.6"
|
||||
/>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
<div className="w-full h-[32rem]">
|
||||
{/* <div className="h-[32rem] flex items-center justify-center">
|
||||
<div className="h-[32rem] flex flex-col items-center justify-center gap-4">
|
||||
<p className="text-lg md:text-2xl text-emerald-600 tracking-wide font-bold">Processing payment</p>
|
||||
<p className="text-lg md:text-2xl text-emerald-600 tracking-wide font-bold">Please do not refresh</p>
|
||||
<LoadingSpinner size="6" color="sky-blue" height='h-20' />
|
||||
<CustomTimer className="text-lg text-center md:text-2xl text-emerald-600 tracking-wide font-bold" />
|
||||
</div>
|
||||
</div> */}
|
||||
</div>
|
||||
<div className="modal-footer-wrapper grid grid-cols-1 xxs:grid-cols-3">
|
||||
<div className="w-full col-span-1 xxs:col-span-2 xxs:col-start-2 flex justify-between items-center">
|
||||
<button
|
||||
type="button"
|
||||
onClick={onClose}
|
||||
className="custom-btn bg-[#f5a430] text-black text-base"
|
||||
>
|
||||
Cancel
|
||||
</button>
|
||||
|
||||
|
||||
<button
|
||||
onClick={()=>{}}
|
||||
className="custom-btn btn-gradient text-base text-white"
|
||||
>
|
||||
{/* {requestStatus.loading ? (
|
||||
<LoadingSpinner size="6" color="sky-blue" />
|
||||
) : completeNairaWithdraw.show ? (
|
||||
"Okay"
|
||||
) : completeNairaWithdraw?.state?.internal_return < 0 ? (
|
||||
"Cancel"
|
||||
) : (
|
||||
"Transfer"
|
||||
)} */}
|
||||
Continue
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ModalCom>
|
||||
);
|
||||
};
|
||||
|
||||
export default WrenchPointPopout;
|
||||
@@ -0,0 +1,88 @@
|
||||
import { useState } from "react";
|
||||
import ModalCom from "../../Helpers/ModalCom";
|
||||
import LoadingSpinner from "../../Spinners/LoadingSpinner";
|
||||
import CustomTimer from "../../countdown/CustomTimer";
|
||||
|
||||
const WrenchTokenPopout = ({ details, onClose, situation, walletItem }) => {
|
||||
const [input, setInput] = useState("");
|
||||
|
||||
return (
|
||||
<ModalCom
|
||||
action={onClose}
|
||||
situation={situation}
|
||||
>
|
||||
<div className="logout-modal-wrapper w-[90%] md:w-[768px] h-auto bg-white dark:bg-dark-white lg:rounded-2xl overflow-y-auto">
|
||||
<div className="modal-header-con">
|
||||
<h1 className="modal-title">
|
||||
{walletItem?.description}
|
||||
</h1>
|
||||
<button
|
||||
type="button"
|
||||
className="modal-close-btn"
|
||||
onClick={onClose}
|
||||
>
|
||||
<svg
|
||||
width="36"
|
||||
height="36"
|
||||
viewBox="0 0 36 36"
|
||||
fill="none"
|
||||
className="fill-current"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<path
|
||||
d="M36 16.16C36 17.4399 36 18.7199 36 20.0001C35.7911 20.0709 35.8636 20.2554 35.8385 20.4001C34.5321 27.9453 30.246 32.9248 22.9603 35.2822C21.9006 35.6251 20.7753 35.7657 19.6802 35.9997C18.4003 35.9997 17.1204 35.9997 15.8401 35.9997C15.5896 35.7086 15.2189 35.7732 14.9034 35.7093C7.77231 34.2621 3.08728 30.0725 0.769671 23.187C0.435002 22.1926 0.445997 21.1199 0 20.1599C0 18.7198 0 17.2798 0 15.8398C0.291376 15.6195 0.214408 15.2656 0.270759 14.9808C1.71321 7.69774 6.02611 2.99691 13.0428 0.700951C14.0118 0.383805 15.0509 0.386897 15.9999 0C17.2265 0 18.4532 0 19.6799 0C19.7156 0.124041 19.8125 0.136067 19.9225 0.146719C27.3 0.868973 33.5322 6.21922 35.3801 13.427C35.6121 14.3313 35.7945 15.2484 36 16.16ZM33.011 18.0787C33.0433 9.77105 26.3423 3.00309 18.077 2.9945C9.78479 2.98626 3.00344 9.658 2.98523 17.8426C2.96667 26.1633 9.58859 32.9601 17.7602 33.0079C26.197 33.0577 32.9787 26.4186 33.011 18.0787Z"
|
||||
fill=""
|
||||
fillOpacity="0.6"
|
||||
/>
|
||||
<path
|
||||
d="M15.9309 18.023C13.9329 16.037 12.007 14.1207 10.0787 12.2072C9.60071 11.733 9.26398 11.2162 9.51996 10.506C9.945 9.32677 11.1954 9.0811 12.1437 10.0174C13.9067 11.7585 15.6766 13.494 17.385 15.2879C17.9108 15.8401 18.1633 15.7487 18.6375 15.258C20.3586 13.4761 22.1199 11.7327 23.8822 9.99096C24.8175 9.06632 26.1095 9.33639 26.4967 10.517C26.7286 11.2241 26.3919 11.7413 25.9133 12.2178C24.1757 13.9472 22.4477 15.6855 20.7104 17.4148C20.5228 17.6018 20.2964 17.7495 20.0466 17.9485C22.0831 19.974 24.0372 21.8992 25.9689 23.8468C26.9262 24.8119 26.6489 26.1101 25.4336 26.4987C24.712 26.7292 24.2131 26.3441 23.7455 25.8757C21.9945 24.1227 20.2232 22.3892 18.5045 20.6049C18.0698 20.1534 17.8716 20.2269 17.4802 20.6282C15.732 22.4215 13.9493 24.1807 12.1777 25.951C11.7022 26.4262 11.193 26.7471 10.4738 26.4537C9.31345 25.9798 9.06881 24.8398 9.98589 23.8952C11.285 22.5576 12.6138 21.2484 13.9387 19.9355C14.5792 19.3005 15.2399 18.6852 15.9309 18.023Z"
|
||||
fill="#"
|
||||
fillOpacity="0.6"
|
||||
/>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
<div className="w-full h-[32rem]">
|
||||
{/* <div className="h-[32rem] flex items-center justify-center">
|
||||
<div className="h-[32rem] flex flex-col items-center justify-center gap-4">
|
||||
<p className="text-lg md:text-2xl text-emerald-600 tracking-wide font-bold">Processing payment</p>
|
||||
<p className="text-lg md:text-2xl text-emerald-600 tracking-wide font-bold">Please do not refresh</p>
|
||||
<LoadingSpinner size="6" color="sky-blue" height='h-20' />
|
||||
<CustomTimer className="text-lg text-center md:text-2xl text-emerald-600 tracking-wide font-bold" />
|
||||
</div>
|
||||
</div> */}
|
||||
</div>
|
||||
<div className="modal-footer-wrapper grid grid-cols-1 xxs:grid-cols-3">
|
||||
<div className="w-full col-span-1 xxs:col-span-2 xxs:col-start-2 flex justify-between items-center">
|
||||
<button
|
||||
type="button"
|
||||
onClick={onClose}
|
||||
className="custom-btn bg-[#f5a430] text-black text-base"
|
||||
>
|
||||
Cancel
|
||||
</button>
|
||||
|
||||
|
||||
<button
|
||||
onClick={()=>{}}
|
||||
className="custom-btn btn-gradient text-base text-white"
|
||||
>
|
||||
{/* {requestStatus.loading ? (
|
||||
<LoadingSpinner size="6" color="sky-blue" />
|
||||
) : completeNairaWithdraw.show ? (
|
||||
"Okay"
|
||||
) : completeNairaWithdraw?.state?.internal_return < 0 ? (
|
||||
"Cancel"
|
||||
) : (
|
||||
"Transfer"
|
||||
)} */}
|
||||
Continue
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ModalCom>
|
||||
);
|
||||
};
|
||||
|
||||
export default WrenchTokenPopout;
|
||||
@@ -24,10 +24,11 @@ export default function Resources(props) {
|
||||
const ownProducts = products.datas;
|
||||
// Resource Props
|
||||
const __resources = props.MyResourceData;
|
||||
|
||||
//debugger;
|
||||
// Collection Items
|
||||
const CreatedSell = __resources?.marketdata?.data;
|
||||
const tab_categories = __resources?.tab_categories?.data;
|
||||
const tab_categories = __resources?.tab_categories?.data?.sort((a, b) => b.name.localeCompare(a.name))
|
||||
const collectionProducts = __resources?.collectiondata?.data;
|
||||
const onSaleProducts = __resources?.marketdata?.data;
|
||||
const CreatedBits = __resources?.productdata?.datas;
|
||||
@@ -77,23 +78,22 @@ export default function Resources(props) {
|
||||
}
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
getUploadedFiles();
|
||||
}, [uploadsTable]);
|
||||
|
||||
// const [tab, setTab] = useState(tab_categories ? tab_categories[0]?.name : "");
|
||||
const [tab, setTab] = useState(
|
||||
props.activeTab
|
||||
? props.activeTab
|
||||
: tab_categories
|
||||
? tab_categories[0]?.name
|
||||
: ""
|
||||
: "onsale"
|
||||
);
|
||||
|
||||
const tabHandler = (value) => {
|
||||
setTab(value);
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
getUploadedFiles();
|
||||
}, [uploadsTable]);
|
||||
|
||||
|
||||
// Category Components
|
||||
const tabComponents = {
|
||||
blog: <BlogTab blogdata={blogItems} />,
|
||||
|
||||
@@ -78,6 +78,9 @@ export const apiConst = {
|
||||
WRENCHBOARD_START_JOBLIST: 11028,
|
||||
WRENCHBOARD_ACCOUNT_DASHDATA: 11029,
|
||||
|
||||
WRENCHBOARD_COUNTRY_STATE: 649,
|
||||
WRENCHBOARD_WALLET_CARD_REQUEST: 11080,
|
||||
|
||||
WRENCHBOARD_SEND_CONTACTUS: 11030,
|
||||
WRENCHBOARD_ACCOUNT_SENDREFER: 11032,
|
||||
WRENCHBOARD_ACCOUNT_REFERLINK: 11033,
|
||||
@@ -109,6 +112,7 @@ export const apiConst = {
|
||||
WRENCHBOARD_GETUSER_SETTINGS: 11059,
|
||||
|
||||
WRENCHBOARD_ACCOUNT_WALLETS: 11060,
|
||||
WRENCHBOARD_WALLET: 11200,
|
||||
|
||||
WRENCHBOARD_ACCOUNT_TOPUP_RESULT: 11061,
|
||||
WRENCHBOARD_ACCOUNT_PREPARE_TOPUP: 11062,
|
||||
|
||||
@@ -125,6 +125,9 @@ class usersService {
|
||||
uid: localStorage.getItem("uid"),
|
||||
member_id: localStorage.getItem("member_id"),
|
||||
sessionid: localStorage.getItem("session_token"),
|
||||
action: apiConst.WRENCHBOARD_WALLET,
|
||||
limit: 20,
|
||||
page: 1
|
||||
};
|
||||
return this.postAuxEnd("/wallets", postData);
|
||||
}
|
||||
@@ -1533,6 +1536,31 @@ class usersService {
|
||||
return this.postAuxEnd("/recentpastdue", postData);
|
||||
}
|
||||
|
||||
//API TO GET STATES FROM COUNTRY
|
||||
getStateFromCountry(reqData){
|
||||
var postData = {
|
||||
member_uid: localStorage.getItem("uid"),
|
||||
member_id: localStorage.getItem("member_id"),
|
||||
sessionid: localStorage.getItem("session_token"),
|
||||
action: apiConst.WRENCHBOARD_COUNTRY_STATE,
|
||||
...reqData
|
||||
};
|
||||
return this.postAuxEnd("/countrystate", postData);
|
||||
}
|
||||
|
||||
//API TO GET STATES FROM COUNTRY
|
||||
walletCardRequest(reqData){
|
||||
var postData = {
|
||||
uid: localStorage.getItem("uid"),
|
||||
member_id: localStorage.getItem("member_id"),
|
||||
sessionid: localStorage.getItem("session_token"),
|
||||
target_uid: localStorage.getItem("uid"),
|
||||
action: apiConst.WRENCHBOARD_WALLET_CARD_REQUEST,
|
||||
...reqData
|
||||
};
|
||||
return this.postAuxEnd("/wallets/card/request", postData);
|
||||
}
|
||||
|
||||
/*
|
||||
- 20:27:30.118 FLOG_MAX [757411]: REQ_STRING(username)
|
||||
- 20:27:30.118 FLOG_MAX [757411]: REQ_STRING(password)
|
||||
|
||||
Reference in New Issue
Block a user