Compare commits
23 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 70ada36c00 | |||
| e6e41de965 | |||
| 0fbbf38d6c | |||
| 040c79e2e5 | |||
| 78b973e3d4 | |||
| 48df81e697 | |||
| 6ef31e5dbe | |||
| 530dbc9c6c | |||
| 28832fdab0 | |||
| 70c205ffca | |||
| fad38331db | |||
| 9e15c51c31 | |||
| b2bffb3b83 | |||
| dd1a2953da | |||
| ef784dc6ed | |||
| 682745c321 | |||
| c63fbfc147 | |||
| 9b0f847bc1 | |||
| c073be1ce6 | |||
| f43e10a75f | |||
| eb41751628 | |||
| fa7a0bd1da | |||
| 52ff30581f |
@@ -23,17 +23,19 @@ export default function ProductCardStyleTwo({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<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 || ""
|
className || ""
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
<div className="flex flex-col justify-between w-full h-full">
|
<div className="flex flex-col justify-between w-full h-full">
|
||||||
<div className="thumbnail-area w-full">
|
<div className="thumbnail-area w-full">
|
||||||
<div
|
<div
|
||||||
className="w-full h-[236px] p-6 rounded-xl overflow-hidden"
|
className="w-full h-[140px] p-6 rounded-lg overflow-hidden"
|
||||||
style={{
|
style={{
|
||||||
// background: `url(${`https://blog.wrenchboard.com/wp-content/uploads/${datas.meta_value}`}) 0% 0% / cover no-repeat`,
|
// 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">
|
<div className="product-two-options flex justify-between mb-5 relative">
|
||||||
@@ -50,7 +52,7 @@ export default function ProductCardStyleTwo({
|
|||||||
</div>
|
</div>
|
||||||
<div className="details-area">
|
<div className="details-area">
|
||||||
{/* title */}
|
{/* 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">
|
<h1 className="font-bold text-xl tracking-wide line-clamp-1 text-dark-gray dark:text-white capitalize">
|
||||||
{datas.post_title || "dummy title..."}
|
{datas.post_title || "dummy title..."}
|
||||||
</h1>
|
</h1>
|
||||||
|
|||||||
@@ -28,7 +28,9 @@ export default function InputCom({
|
|||||||
direction,
|
direction,
|
||||||
tabIndex,
|
tabIndex,
|
||||||
error,
|
error,
|
||||||
autoComplete="on"
|
autoComplete="on",
|
||||||
|
minDate='1900-01-01',
|
||||||
|
maxDate='2099-09-13'
|
||||||
}) {
|
}) {
|
||||||
const inputRef = useRef(null);
|
const inputRef = useRef(null);
|
||||||
// Entry Validation
|
// Entry Validation
|
||||||
@@ -90,26 +92,51 @@ export default function InputCom({
|
|||||||
: "text-[#5e6278] dark:text-gray-100 bg-[#f5f8fa] border"
|
: "text-[#5e6278] dark:text-gray-100 bg-[#f5f8fa] border"
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
<input
|
<>
|
||||||
placeholder={placeholder}
|
{type == 'date' ?
|
||||||
value={value}
|
<input
|
||||||
onChange={inputHandler}
|
placeholder={placeholder}
|
||||||
className={`input-field placeholder:text-base text-dark-gray w-full h-full ${iconName && 'pr-6'} ${
|
value={value}
|
||||||
inputBg && inputBg} tracking-wide focus:ring-0 focus:outline-none ${fieldClass}`}
|
onChange={inputHandler}
|
||||||
type={type}
|
className={`input-field placeholder:text-base text-dark-gray w-full h-full ${iconName && 'pr-6'} ${
|
||||||
id={name}
|
inputBg && inputBg} tracking-wide focus:ring-0 focus:outline-none ${fieldClass}`}
|
||||||
name={name}
|
type={type}
|
||||||
onInput={onInput}
|
id={name}
|
||||||
minLength={minLengthValidation()}
|
name={name}
|
||||||
maxLength={maxLengthValidation()}
|
onInput={onInput}
|
||||||
tabIndex={tabIndex}
|
min={minDate}
|
||||||
// pattern={inputPatterns()}
|
max={maxDate}
|
||||||
ref={inputRef}
|
tabIndex={tabIndex}
|
||||||
readOnly={disable}
|
// pattern={inputPatterns()}
|
||||||
onBlur={blurHandler}
|
ref={inputRef}
|
||||||
dir={direction}
|
readOnly={disable}
|
||||||
autoComplete={autoComplete}
|
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 && (
|
{iconName && (
|
||||||
<div className="absolute right-6 bottom-3 z-10 flex gap-2">
|
<div className="absolute right-6 bottom-3 z-10 flex gap-2">
|
||||||
{iconName.split(" ").map((item, index) => (
|
{iconName.split(" ").map((item, index) => (
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import React, { useEffect, useState } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
import usersService from "../../../services/UsersService";
|
import usersService from "../../../services/UsersService";
|
||||||
import LoadingSpinner from "../../Spinners/LoadingSpinner";
|
import LoadingSpinner from "../../Spinners/LoadingSpinner";
|
||||||
|
import {PriceFormatter} from '../../Helpers/PriceFormatter'
|
||||||
|
|
||||||
export default function LockJob({
|
export default function LockJob({
|
||||||
details,
|
details,
|
||||||
|
|||||||
@@ -1,15 +1,27 @@
|
|||||||
import { useSelector } from "react-redux";
|
import {useEffect} from 'react'
|
||||||
|
import { useSelector, useDispatch} from "react-redux";
|
||||||
import Layout from "../Partials/Layout";
|
import Layout from "../Partials/Layout";
|
||||||
import CommonHead from "../UserHeader/CommonHead";
|
import CommonHead from "../UserHeader/CommonHead";
|
||||||
import MainSection from "./MainSection";
|
import MainSection from "./MainSection";
|
||||||
import CustomBreadcrumb from "../Breadcrumb/CustomBreadcrumb";
|
import CustomBreadcrumb from "../Breadcrumb/CustomBreadcrumb";
|
||||||
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
||||||
|
import { tableReload } from '../../store/TableReloads';
|
||||||
|
|
||||||
export default function MarketPlace({ commonHeadData }) {
|
export default function MarketPlace({ commonHeadData }) {
|
||||||
|
|
||||||
|
const dispatch = useDispatch()
|
||||||
|
|
||||||
let { jobLists } = useSelector((state) => state.jobLists);
|
let { jobLists } = useSelector((state) => state.jobLists);
|
||||||
const marketData = jobLists?.result_list;
|
const marketData = jobLists?.result_list;
|
||||||
const categories = jobLists?.categories;
|
const categories = jobLists?.categories;
|
||||||
const image_server = jobLists?.session_image_server;
|
const image_server = jobLists?.session_image_server;
|
||||||
|
console.log('Lenth', marketData?.length )
|
||||||
|
|
||||||
|
useEffect(()=>{
|
||||||
|
if(!jobLists.loading && (marketData?.length < 1 || !marketData)){
|
||||||
|
dispatch(tableReload({ type: "MARKETTABLELIST" })); // reloads market page
|
||||||
|
}
|
||||||
|
},[])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -1,11 +1,14 @@
|
|||||||
import React, { useEffect, useState } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
import { useSelector } from "react-redux";
|
import { useSelector, useDispatch } from "react-redux";
|
||||||
import usersService from "../../services/UsersService";
|
import usersService from "../../services/UsersService";
|
||||||
import Layout from "../Partials/Layout";
|
import Layout from "../Partials/Layout";
|
||||||
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
||||||
import WalletBox from "./WalletBox";
|
import WalletBox from "./WalletBox";
|
||||||
|
import { tableReload } from '../../store/TableReloads';
|
||||||
|
|
||||||
const WalletRoutes = () => {
|
const WalletRoutes = () => {
|
||||||
|
const dispatch = useDispatch()
|
||||||
|
|
||||||
const apiCall = new usersService();
|
const apiCall = new usersService();
|
||||||
const { walletDetails } = useSelector((state) => state?.walletDetails); // WALLET STORE
|
const { walletDetails } = useSelector((state) => state?.walletDetails); // WALLET STORE
|
||||||
const { walletTable } = useSelector((state) => state.tableReload);
|
const { walletTable } = useSelector((state) => state.tableReload);
|
||||||
@@ -60,6 +63,12 @@ const WalletRoutes = () => {
|
|||||||
getPaymentHistory();
|
getPaymentHistory();
|
||||||
}, [walletTable]);
|
}, [walletTable]);
|
||||||
|
|
||||||
|
useEffect(()=>{
|
||||||
|
if(!walletDetails.loading && walletDetails?.data?.length < 1){
|
||||||
|
dispatch(tableReload({ type: "WALLETTABLE" })); // reloads wallet page
|
||||||
|
}
|
||||||
|
},[])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Layout>
|
<Layout>
|
||||||
<WalletBox
|
<WalletBox
|
||||||
|
|||||||
@@ -2,8 +2,28 @@ import React, { useEffect, useState } from "react";
|
|||||||
import usersService from "../../services/UsersService";
|
import usersService from "../../services/UsersService";
|
||||||
import ConfirmNairaWithdraw from "./Popup/ConfirmNairaWithdraw";
|
import ConfirmNairaWithdraw from "./Popup/ConfirmNairaWithdraw";
|
||||||
import NairaWithdraw from "./Popup/NairaWithdraw";
|
import NairaWithdraw from "./Popup/NairaWithdraw";
|
||||||
|
import VirtualAddCardPopout from "./walletvirtual/VirtualAddCardPopout";
|
||||||
|
import WalletExtraActionBtn from "./WalletExtraActionBtn";
|
||||||
|
|
||||||
function WalletAction({ walletItem, payment, openPopUp }) {
|
function WalletAction({ walletItem, payment, openPopUp }) {
|
||||||
|
|
||||||
|
// virtual add card popout
|
||||||
|
const [virtualPopup, setVirtualPopup] = useState({ show: false, data: {} });
|
||||||
|
|
||||||
|
/*OPENS the virtual add card popout*/
|
||||||
|
const openVirtualPopUp = (value) => {
|
||||||
|
setVirtualPopup({
|
||||||
|
show: true,
|
||||||
|
data: { ...value },
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/*Closes the virtual add card popout*/
|
||||||
|
const closeVirtualPopUp = () => {
|
||||||
|
setVirtualPopup({ show: false, data: {} });
|
||||||
|
// dispatch(tableReload({ type: "WALLETTABLE" }));
|
||||||
|
};
|
||||||
|
|
||||||
const [showNairaWithdraw, setShowNairaWithdraw] = useState({
|
const [showNairaWithdraw, setShowNairaWithdraw] = useState({
|
||||||
show: false,
|
show: false,
|
||||||
state: {},
|
state: {},
|
||||||
@@ -19,14 +39,27 @@ function WalletAction({ walletItem, payment, openPopUp }) {
|
|||||||
<div className="w-1/2 flex justify-start items-center">
|
<div className="w-1/2 flex justify-start items-center">
|
||||||
<button
|
<button
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setShowNairaWithdraw((prev) => ({ ...prev, show: true }));
|
walletItem?.code == 'NAIRA' ?
|
||||||
|
setShowNairaWithdraw((prev) => ({ ...prev, show: true }))
|
||||||
|
: walletItem?.code == 'USD' ?
|
||||||
|
openVirtualPopUp({walletItem})
|
||||||
|
:
|
||||||
|
()=>{}
|
||||||
}}
|
}}
|
||||||
className={`${
|
className={`${
|
||||||
walletItem.code != "NAIRA" && "invisible"
|
walletItem?.code != "NAIRA" && ""
|
||||||
} logout-btn btn-gradient text-white`}
|
} logout-btn btn-gradient text-white`}
|
||||||
>
|
>
|
||||||
Spend
|
{/* Spend */}
|
||||||
|
{walletItem?.code == 'NAIRA' ?
|
||||||
|
walletItem?.extra_actions?.SPEND_FROM_BALANCE[0]?.text
|
||||||
|
: walletItem?.code == 'USD' ?
|
||||||
|
walletItem?.extra_actions?.ADD_VIRTUAL_CARD[0]?.text
|
||||||
|
:
|
||||||
|
'View'
|
||||||
|
}
|
||||||
</button>
|
</button>
|
||||||
|
{/* <WalletExtraActionBtn /> // TO BE USED lATER */}
|
||||||
</div>
|
</div>
|
||||||
<div className="w-1/2 flex justify-end items-center">
|
<div className="w-1/2 flex justify-end items-center">
|
||||||
<button
|
<button
|
||||||
@@ -71,6 +104,17 @@ function WalletAction({ walletItem, payment, openPopUp }) {
|
|||||||
situation={showConfirmNairaWithdraw.show}
|
situation={showConfirmNairaWithdraw.show}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
{/* VIRTUAL CARD POPOUT */}
|
||||||
|
{virtualPopup.show && (
|
||||||
|
<VirtualAddCardPopout
|
||||||
|
details={virtualPopup.data}
|
||||||
|
walletItem={walletItem}
|
||||||
|
onClose={closeVirtualPopUp}
|
||||||
|
situation={virtualPopup.show}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,11 +9,11 @@ import WalletItemCardVirtual from './walletvirtual/WalletItemCardVirtual'
|
|||||||
export default function WalletBox({ wallet, payment, countries }) {
|
export default function WalletBox({ wallet, payment, countries }) {
|
||||||
const { loading, data } = wallet;
|
const { loading, data } = wallet;
|
||||||
|
|
||||||
|
// console.log('LOG', data[0]?.extra_actions?.SPEND_FROM_BALANCE[0])
|
||||||
|
|
||||||
// const { userDetails } = useSelector((state) => state.userDetails);
|
// const { userDetails } = useSelector((state) => state.userDetails);
|
||||||
// const accountType = userDetails?.account_type === "FAMILY";
|
// const accountType = userDetails?.account_type === "FAMILY";
|
||||||
|
|
||||||
// console.log('mumu', data)
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<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">
|
||||||
@@ -24,7 +24,7 @@ export default function WalletBox({ wallet, payment, countries }) {
|
|||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<div className="w-auto grid md:grid-cols-2 xxl:grid-cols-3 gap-4 md:gap-10">
|
<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) => (
|
{ data?.length > 0 && data.map((item, index) => (
|
||||||
<div key={item.wallet_uid+index} className="w-full h-full">
|
<div key={item.wallet_uid+index} className="w-full h-full">
|
||||||
{item.country ?
|
{item.country ?
|
||||||
<WalletItemCard walletItem={item} payment={payment} countries={countries} />
|
<WalletItemCard walletItem={item} payment={payment} countries={countries} />
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
import React from 'react'
|
||||||
|
|
||||||
|
export default function WalletExtraActionBtn() {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
{/* <button
|
||||||
|
onClick={() => {
|
||||||
|
walletItem?.code == 'NAIRA' ? setShowNairaWithdraw((prev) => ({ ...prev, show: true })) : openVirtualPopUp({walletItem})
|
||||||
|
}}
|
||||||
|
className={`${
|
||||||
|
walletItem?.code != "NAIRA" && ""
|
||||||
|
} logout-btn btn-gradient text-white`}
|
||||||
|
>
|
||||||
|
{walletItem?.code == 'NAIRA' ? walletItem?.extra_actions?.SPEND_FROM_BALANCE[0]?.text : walletItem?.extra_actions?.ADD_VIRTUAL_CARD[0]?.text}
|
||||||
|
</button> */}
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -58,12 +58,27 @@ export default function WalletHeader(props) {
|
|||||||
props.myWalletList.map((value, index) =>
|
props.myWalletList.map((value, index) =>
|
||||||
{
|
{
|
||||||
let image = value.code ? `${value.code.toLocaleLowerCase()}.svg` : 'default.png'
|
let image = value.code ? `${value.code.toLocaleLowerCase()}.svg` : 'default.png'
|
||||||
|
|
||||||
return(
|
return(
|
||||||
<li
|
<li
|
||||||
key={index}
|
key={value?.wallet_uid || index}
|
||||||
className="content-item py-4 border-b dark:border-[#5356fb29] border-light-purple hover:border-purple dark:hover:border-purple"
|
className="content-item py-4 border-b dark:border-[#5356fb29] border-light-purple hover:border-purple dark:hover:border-purple"
|
||||||
onClick={onWalletClick}
|
onClick={onWalletClick}
|
||||||
>
|
>
|
||||||
|
{value?.brand && value?.card_last4 ? // FOR VIRTUAL CARD NUMBER ELSE WALLET BALANCE DISPLAY
|
||||||
|
<div className="w-full">
|
||||||
|
<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={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">
|
||||||
|
{value.brand} <span> **** **** ***** </span> {value?.card_last4}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
:
|
||||||
<div className="sm:flex justify-between items-center">
|
<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="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 ">
|
<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 ">
|
||||||
@@ -81,6 +96,7 @@ export default function WalletHeader(props) {
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
</li>
|
</li>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,15 +14,15 @@ const validationSchema = Yup.object().shape({
|
|||||||
country: Yup.string()
|
country: Yup.string()
|
||||||
.required("Required"),
|
.required("Required"),
|
||||||
phone_number: Yup.string()
|
phone_number: Yup.string()
|
||||||
.min(9, "Minimum 9 characters")
|
.min(9, "Invalid")
|
||||||
.max(20, "Maximum 25 characters")
|
.max(11, "Invalid")
|
||||||
.required("Required"),
|
|
||||||
birthYear: Yup.string()
|
|
||||||
.required("Required"),
|
|
||||||
birthMonth: Yup.string()
|
|
||||||
.required("Required"),
|
|
||||||
birthDay: Yup.string()
|
|
||||||
.required("Required"),
|
.required("Required"),
|
||||||
|
// birthYear: Yup.string()
|
||||||
|
// .required("Required"),
|
||||||
|
// birthMonth: Yup.string()
|
||||||
|
// .required("Required"),
|
||||||
|
// birthDay: Yup.string()
|
||||||
|
// .required("Required"),
|
||||||
address: Yup.string()
|
address: Yup.string()
|
||||||
.min(5, "Min 3 characters")
|
.min(5, "Min 3 characters")
|
||||||
.max(50, "Max 25 characters")
|
.max(50, "Max 25 characters")
|
||||||
@@ -37,13 +37,15 @@ const validationSchema = Yup.object().shape({
|
|||||||
.min(1, "Min 3 characters")
|
.min(1, "Min 3 characters")
|
||||||
.max(8, "Max 8 characters")
|
.max(8, "Max 8 characters")
|
||||||
.required("Required"),
|
.required("Required"),
|
||||||
|
dob: Yup.string()
|
||||||
|
.required("Required"),
|
||||||
});
|
});
|
||||||
|
|
||||||
const VirtualAddCardPopout = ({ details, onClose, situation, walletItem }) => {
|
const VirtualAddCardPopout = ({ details, onClose, situation, walletItem }) => {
|
||||||
|
|
||||||
const { userDetails } = useSelector((state) => state.userDetails);
|
const { userDetails } = useSelector((state) => state.userDetails);
|
||||||
|
|
||||||
const countryCode = userDetails?.country
|
const countryCode = walletItem?.country
|
||||||
|
|
||||||
const userApi = new usersService()
|
const userApi = new usersService()
|
||||||
|
|
||||||
@@ -65,35 +67,73 @@ const VirtualAddCardPopout = ({ details, onClose, situation, walletItem }) => {
|
|||||||
birthMonth: '',
|
birthMonth: '',
|
||||||
birthDay: '',
|
birthDay: '',
|
||||||
address: '',
|
address: '',
|
||||||
city: '',
|
city: userDetails?.city ? userDetails.city : '',
|
||||||
state: '',
|
state: '',
|
||||||
zipCode: ''
|
zipCode: '',
|
||||||
|
dob: ''
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
const handleSubmit = (values) => {
|
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 = {
|
const reqData = {
|
||||||
name: values.firstname + ' ' + values.firstname,
|
request_type: '100',
|
||||||
email: values.email,
|
address: values.address,
|
||||||
|
city: values.city,
|
||||||
|
state: values.state,
|
||||||
|
country: values.country,
|
||||||
|
postal_code: values.zipCode,
|
||||||
phone_number: values.phone_number,
|
phone_number: values.phone_number,
|
||||||
status: 'active',
|
// dob_day: values.birthDay,
|
||||||
type: 'individual',
|
// dob_month: values.birthMonth,
|
||||||
individual: {
|
// dob_year: values.birthYear,
|
||||||
first_name: values.firstname,
|
dob_day: Number(new Date(values.dob).getDate()),
|
||||||
last_name: values.lastname,
|
dob_month: Number(new Date(values.dob).getMonth()) + 1,
|
||||||
dob: {day: values.birthDay, month: values.birthMonth, year: values.birthYear}
|
dob_year: Number(new Date(values.dob).getFullYear()),
|
||||||
},
|
dob: values.dob
|
||||||
billing:{
|
|
||||||
address : {
|
|
||||||
line1: values.address,
|
|
||||||
city: values.city,
|
|
||||||
state: values.state,
|
|
||||||
postal_code: values.zipCode,
|
|
||||||
country: values.country
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
console.log('Values', reqData)
|
// 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(()=>{
|
useEffect(()=>{
|
||||||
@@ -137,8 +177,8 @@ const VirtualAddCardPopout = ({ details, onClose, situation, walletItem }) => {
|
|||||||
onSubmit={handleSubmit}
|
onSubmit={handleSubmit}
|
||||||
>
|
>
|
||||||
{(props) => (
|
{(props) => (
|
||||||
<Form className="w-full overflow-y-auto">
|
<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">
|
||||||
<div className="logout-modal-wrapper mx-auto w-[90%] lg:w-[900px] h-auto bg-white dark:bg-dark-white lg:rounded-2xl">
|
<Form className="w-full">
|
||||||
<div className="modal-header-con">
|
<div className="modal-header-con">
|
||||||
<h1 className="modal-title">
|
<h1 className="modal-title">
|
||||||
{walletItem?.description}
|
{walletItem?.description}
|
||||||
@@ -169,304 +209,337 @@ const VirtualAddCardPopout = ({ details, onClose, situation, walletItem }) => {
|
|||||||
</svg>
|
</svg>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div className="p-4 w-full grid lg:grid-cols-2 gap-4">
|
<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>
|
||||||
|
|
||||||
{/* left part */}
|
{/* hidden section */}
|
||||||
<div className='w-full flex flex-col gap-4'>
|
<div className="hidden field w-full flex-col gap-4">
|
||||||
<div className="field w-full grid md:grid-cols-2 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">
|
<div className="field w-full">
|
||||||
<label
|
<label
|
||||||
htmlFor="country"
|
htmlFor="state"
|
||||||
className="job-label job-label-flex"
|
className="job-label job-label-flex"
|
||||||
>
|
>
|
||||||
<span>Country</span>
|
<span>State/Province</span>
|
||||||
{props.errors.country && props.touched.country && (
|
{props.errors.state && props.touched.state && (
|
||||||
<span className="text-[12px] text-red-500">
|
<span className="text-[12px] text-red-500">
|
||||||
{props.errors.country}
|
{props.errors.state}
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
</label>
|
</label>
|
||||||
<select
|
<select
|
||||||
id="country"
|
id="state"
|
||||||
name="country"
|
name="state"
|
||||||
value={props.values.country}
|
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`}
|
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}
|
onChange={props.handleChange}
|
||||||
disabled={countryCode ? true : false}
|
|
||||||
>
|
>
|
||||||
{allCountries.loading ?
|
{state.loading ?
|
||||||
<option className="text-slate-500 text-lg" value="">
|
<option className="text-slate-500 text-lg" value="">
|
||||||
Loading...
|
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>
|
||||||
))}
|
: Object.keys(state.data)?.length > 0 ?
|
||||||
</>
|
<>
|
||||||
:
|
<option className="text-slate-500 text-lg" value="">
|
||||||
<option className="text-slate-500 text-lg" value="">
|
Select State
|
||||||
Not Found
|
</option>
|
||||||
</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>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<InputCom
|
<InputCom
|
||||||
fieldClass="px-6"
|
fieldClass="px-6"
|
||||||
label="Phone Number"
|
label="Zip Code"
|
||||||
labelClass="tracking-wide"
|
labelClass="tracking-wide"
|
||||||
inputBg="bg-slate-100"
|
inputBg="bg-slate-100"
|
||||||
inputClass="w-full input-curve lg border border-light-purple"
|
inputClass="input-curve lg border border-light-purple"
|
||||||
type="text"
|
type="text"
|
||||||
name="phone_number"
|
name="zipCode"
|
||||||
value={props.values.phone_number}
|
value={props.values.zipCode}
|
||||||
inputHandler={props.handleChange}
|
inputHandler={props.handleChange}
|
||||||
error={(props.errors.phone_number && props.touched.phone_number) && props.errors.phone_number}
|
error={(props.errors.zipCode && props.touched.zipCode) && props.errors.zipCode}
|
||||||
/>
|
/>
|
||||||
</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="field w-full grid 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>
|
|
||||||
<div className="field w-full flex flex-col gap-4">
|
|
||||||
<p className='job-label'>Date of Birth</p>
|
|
||||||
<div className='grid 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>
|
|
||||||
|
|
||||||
{/* right part */}
|
|
||||||
<div className='p-4 w-full 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>
|
</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>
|
||||||
</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="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">
|
<div className="w-full col-span-1 xxs:col-span-2 xxs:col-start-2 flex justify-between items-center">
|
||||||
<button
|
<button
|
||||||
@@ -484,6 +557,7 @@ const VirtualAddCardPopout = ({ details, onClose, situation, walletItem }) => {
|
|||||||
<button
|
<button
|
||||||
type="submit"
|
type="submit"
|
||||||
className="custom-btn btn-gradient text-base text-white"
|
className="custom-btn btn-gradient text-base text-white"
|
||||||
|
disabled={requestStatus.loading || requestStatus.status}
|
||||||
>
|
>
|
||||||
Continue
|
Continue
|
||||||
</button>
|
</button>
|
||||||
@@ -491,8 +565,8 @@ const VirtualAddCardPopout = ({ details, onClose, situation, walletItem }) => {
|
|||||||
</>
|
</>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</Form>
|
||||||
</Form>
|
</div>
|
||||||
)}
|
)}
|
||||||
</Formik>
|
</Formik>
|
||||||
</ModalCom>
|
</ModalCom>
|
||||||
@@ -502,29 +576,24 @@ const VirtualAddCardPopout = ({ details, onClose, situation, walletItem }) => {
|
|||||||
export default VirtualAddCardPopout;
|
export default VirtualAddCardPopout;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const day = new Array(31).fill(0).map((_,i) => i+1 )
|
const day = new Array(31).fill(0).map((_,i) => i+1 )
|
||||||
|
|
||||||
const month = [
|
const month = [
|
||||||
{value: 0, name: 'January'},
|
{value: 1, name: 'January'},
|
||||||
{value: 1, name: 'February'},
|
{value: 2, name: 'February'},
|
||||||
{value: 2, name: 'March'},
|
{value: 3, name: 'March'},
|
||||||
{value: 3, name: 'April'},
|
{value: 4, name: 'April'},
|
||||||
{value: 4, name: 'May'},
|
{value: 5, name: 'May'},
|
||||||
{value: 5, name: 'June'},
|
{value: 6, name: 'June'},
|
||||||
{value: 6, name: 'July'},
|
{value: 7, name: 'July'},
|
||||||
{value: 7, name: 'August'},
|
{value: 8, name: 'August'},
|
||||||
{value: 8, name: 'September'},
|
{value: 9, name: 'September'},
|
||||||
{value: 9, name: 'October'},
|
{value: 10, name: 'October'},
|
||||||
{value: 10, name: 'November'},
|
{value: 11, name: 'November'},
|
||||||
{value: 11, name: 'December'},
|
{value: 12, name: 'December'},
|
||||||
]
|
]
|
||||||
|
|
||||||
const date = new Date().getFullYear()
|
const date = new Date().getFullYear()
|
||||||
|
|
||||||
const year = new Array(100).fill(0).map((_,i) => (date-2) - i+1 )
|
const year = new Array(100).fill(0).map((_,i) => (date-2) - i+1 )
|
||||||
|
|
||||||
// const state = [
|
|
||||||
// {value: 'abia', name: 'Abia'},
|
|
||||||
// {value: 'imo', name: 'Imo'},
|
|
||||||
// {value: 'anambra', name: 'Anambra'},
|
|
||||||
// ]
|
|
||||||
@@ -24,10 +24,12 @@ export default function Resources(props) {
|
|||||||
const ownProducts = products.datas;
|
const ownProducts = products.datas;
|
||||||
// Resource Props
|
// Resource Props
|
||||||
const __resources = props.MyResourceData;
|
const __resources = props.MyResourceData;
|
||||||
|
|
||||||
//debugger;
|
//debugger;
|
||||||
// Collection Items
|
// Collection Items
|
||||||
const CreatedSell = __resources?.marketdata?.data;
|
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)) // SORT REMOVED
|
||||||
|
const tab_categories = __resources?.tab_categories?.data
|
||||||
const collectionProducts = __resources?.collectiondata?.data;
|
const collectionProducts = __resources?.collectiondata?.data;
|
||||||
const onSaleProducts = __resources?.marketdata?.data;
|
const onSaleProducts = __resources?.marketdata?.data;
|
||||||
const CreatedBits = __resources?.productdata?.datas;
|
const CreatedBits = __resources?.productdata?.datas;
|
||||||
@@ -77,23 +79,22 @@ export default function Resources(props) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
getUploadedFiles();
|
|
||||||
}, [uploadsTable]);
|
|
||||||
|
|
||||||
// const [tab, setTab] = useState(tab_categories ? tab_categories[0]?.name : "");
|
// const [tab, setTab] = useState(tab_categories ? tab_categories[0]?.name : "");
|
||||||
const [tab, setTab] = useState(
|
const [tab, setTab] = useState(
|
||||||
props.activeTab
|
props.activeTab
|
||||||
? props.activeTab
|
? props.activeTab
|
||||||
: tab_categories
|
: "onsale"
|
||||||
? tab_categories[0]?.name
|
|
||||||
: ""
|
|
||||||
);
|
);
|
||||||
|
|
||||||
const tabHandler = (value) => {
|
const tabHandler = (value) => {
|
||||||
setTab(value);
|
setTab(value);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
getUploadedFiles();
|
||||||
|
}, [uploadsTable]);
|
||||||
|
|
||||||
|
|
||||||
// Category Components
|
// Category Components
|
||||||
const tabComponents = {
|
const tabComponents = {
|
||||||
blog: <BlogTab blogdata={blogItems} />,
|
blog: <BlogTab blogdata={blogItems} />,
|
||||||
|
|||||||
@@ -79,6 +79,7 @@ export const apiConst = {
|
|||||||
WRENCHBOARD_ACCOUNT_DASHDATA: 11029,
|
WRENCHBOARD_ACCOUNT_DASHDATA: 11029,
|
||||||
|
|
||||||
WRENCHBOARD_COUNTRY_STATE: 649,
|
WRENCHBOARD_COUNTRY_STATE: 649,
|
||||||
|
WRENCHBOARD_WALLET_CARD_REQUEST: 11080,
|
||||||
|
|
||||||
WRENCHBOARD_SEND_CONTACTUS: 11030,
|
WRENCHBOARD_SEND_CONTACTUS: 11030,
|
||||||
WRENCHBOARD_ACCOUNT_SENDREFER: 11032,
|
WRENCHBOARD_ACCOUNT_SENDREFER: 11032,
|
||||||
|
|||||||
@@ -211,6 +211,7 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
|
|||||||
getMyJobList();
|
getMyJobList();
|
||||||
}, [jobListTable, isLogin.status]);
|
}, [jobListTable, isLogin.status]);
|
||||||
|
|
||||||
|
//FUNCTION TO GET FULL USER WALLETS
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if((!loggedIn && !isLogin.status) || account_type == 'FAMILY'){ // DO NOT CALL THIS, IF USER ACCOUNT TYPE IS FAMILY
|
if((!loggedIn && !isLogin.status) || account_type == 'FAMILY'){ // DO NOT CALL THIS, IF USER ACCOUNT TYPE IS FAMILY
|
||||||
return
|
return
|
||||||
@@ -231,6 +232,8 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
|
|||||||
getMyWalletList();
|
getMyWalletList();
|
||||||
}, [walletTable, isLogin.status]);
|
}, [walletTable, isLogin.status]);
|
||||||
|
|
||||||
|
|
||||||
|
// FUNCTION TO GET MARKET JOB LIST
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if((!loggedIn && !isLogin.status) || account_type == 'FAMILY'){ // DO NOT CALL THIS, IF USER ACCOUNT TYPE IS FAMILY
|
if((!loggedIn && !isLogin.status) || account_type == 'FAMILY'){ // DO NOT CALL THIS, IF USER ACCOUNT TYPE IS FAMILY
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -1548,6 +1548,19 @@ class usersService {
|
|||||||
return this.postAuxEnd("/countrystate", postData);
|
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(username)
|
||||||
- 20:27:30.118 FLOG_MAX [757411]: REQ_STRING(password)
|
- 20:27:30.118 FLOG_MAX [757411]: REQ_STRING(password)
|
||||||
|
|||||||
Reference in New Issue
Block a user