Compare commits
65 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1a65b1daa3 | |||
| ba2c009896 | |||
| bc2b71ecda | |||
| 1d315018a4 | |||
| 56f8b75525 | |||
| 59531df377 | |||
| 06a7386211 | |||
| 4bb3a11261 | |||
| f308eeca8d | |||
| 8e562ed1a5 | |||
| 23dd7571a3 | |||
| 8530b2d1a0 | |||
| acdbddbc79 | |||
| 15fc5f4f14 | |||
| 2ba3b01646 | |||
| 4e960a2f53 | |||
| ab700edcf2 | |||
| 42e80c7a11 | |||
| d4472a881a | |||
| 5d12ab4f62 | |||
| 8b3c586456 | |||
| e456b55e16 | |||
| 89c5936212 | |||
| 7bedf76945 | |||
| 54bf020c55 | |||
| 78145eee77 | |||
| d75b6ee26c | |||
| bf5c9d4671 | |||
| d2db38ba21 | |||
| eecbca6b0e | |||
| dd1430a350 | |||
| 0eca0c52ce | |||
| c2c7ad7bb4 | |||
| 98ccbce4c0 | |||
| 6484640e1a | |||
| ba3c4e1918 | |||
| fa4fe35bdf | |||
| c106e66f44 | |||
| 222c739663 | |||
| 96972dbe2f | |||
| 7146048aee | |||
| 39f1f5bc73 | |||
| fb7913c563 | |||
| feb301c3c0 | |||
| 752fc6a4a8 | |||
| 608d5b92f1 | |||
| 45563cc59b | |||
| b027e20c20 | |||
| bbe0777496 | |||
| 27efbe362b | |||
| 878539a56a | |||
| 6ae408029d | |||
| 8016d1bd12 | |||
| 0e9fef218f | |||
| 8116665045 | |||
| e4addc47d9 | |||
| 1682f11efd | |||
| 80b2abf9e3 | |||
| 5edecb6464 | |||
| 3a479b3573 | |||
| 4034909836 | |||
| 8fc61a6289 | |||
| 940a12a2e9 | |||
| a9f671eeaa | |||
| 481924fa02 |
@@ -68,6 +68,8 @@ REACT_APP_APPLE_REDIRECT_URL='http://localhost:9082/login/auth/apple'
|
|||||||
REACT_APP_MAX_FILE_SIZE=1000000
|
REACT_APP_MAX_FILE_SIZE=1000000
|
||||||
REACT_APP_TOTAL_NUM_FILE=4
|
REACT_APP_TOTAL_NUM_FILE=4
|
||||||
|
|
||||||
|
REACT_APP_LOGOUT_TEXT="Sign Out"
|
||||||
|
|
||||||
|
|
||||||
#apigate.lotus.g1.wrenchboard.com:76.209.103.227
|
#apigate.lotus.g1.wrenchboard.com:76.209.103.227
|
||||||
#apigate.orion.g1.wrenchboard.com:76.209.103.227
|
#apigate.orion.g1.wrenchboard.com:76.209.103.227
|
||||||
|
|||||||
+3
-1
@@ -41,4 +41,6 @@ REACT_APP_GOOGLE_CLIENT_SCOPE="https://www.googleapis.com/auth/plus.login https:
|
|||||||
REACT_APP_GOOGLE_REDIRECT_URL=http://localhost:9082/login/auth/
|
REACT_APP_GOOGLE_REDIRECT_URL=http://localhost:9082/login/auth/
|
||||||
|
|
||||||
REACT_APP_MAX_FILE_SIZE=1000000
|
REACT_APP_MAX_FILE_SIZE=1000000
|
||||||
REACT_APP_TOTAL_NUM_FILE=4
|
REACT_APP_TOTAL_NUM_FILE=4
|
||||||
|
|
||||||
|
REACT_APP_LOGOUT_TEXT="Sign Out"
|
||||||
+3
-1
@@ -48,4 +48,6 @@ REACT_APP_FACEBOOK_REDIRECT_URL="https://users.wrenchboard.com/login/auth/flogin
|
|||||||
DISABLE_ESLINT_PLUGIN=true
|
DISABLE_ESLINT_PLUGIN=true
|
||||||
|
|
||||||
REACT_APP_MAX_FILE_SIZE=1000000
|
REACT_APP_MAX_FILE_SIZE=1000000
|
||||||
REACT_APP_TOTAL_NUM_FILE=4
|
REACT_APP_TOTAL_NUM_FILE=4
|
||||||
|
|
||||||
|
REACT_APP_LOGOUT_TEXT="Sign Out"
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 94 KiB |
@@ -275,8 +275,8 @@ export default function Login() {
|
|||||||
<div className="input-item mb-5">
|
<div className="input-item mb-5">
|
||||||
<InputCom
|
<InputCom
|
||||||
labelClass="tracking-wider"
|
labelClass="tracking-wider"
|
||||||
fieldClass="sm:px-6 px-2"
|
fieldClass="sm:px-6 px-2 tracking-[0.25em] text-2xl"
|
||||||
value={password}
|
value={password.replace(/./g, "●")}
|
||||||
inputHandler={handlePassword}
|
inputHandler={handlePassword}
|
||||||
placeholder="● ● ● ● ● ●"
|
placeholder="● ● ● ● ● ●"
|
||||||
label="Password"
|
label="Password"
|
||||||
|
|||||||
@@ -205,7 +205,7 @@ export default function SignUp() {
|
|||||||
</div>
|
</div>
|
||||||
<div className="input-item mb-5">
|
<div className="input-item mb-5">
|
||||||
<InputCom
|
<InputCom
|
||||||
fieldClass="px-6"
|
fieldClass="sm:px-6 px-2 tracking-[0.25em] text-2xl"
|
||||||
placeholder="● ● ● ● ● ●"
|
placeholder="● ● ● ● ● ●"
|
||||||
label="Password"
|
label="Password"
|
||||||
name="password"
|
name="password"
|
||||||
@@ -214,7 +214,7 @@ export default function SignUp() {
|
|||||||
passIcon={
|
passIcon={
|
||||||
showPassword ? "show-password" : "hide-password"
|
showPassword ? "show-password" : "hide-password"
|
||||||
}
|
}
|
||||||
value={formData.password}
|
value={formData.password.replace(/./g, "●")}
|
||||||
inputHandler={handleInputChange}
|
inputHandler={handleInputChange}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -158,8 +158,8 @@ const SuccessfulComponent = ({
|
|||||||
{/* INPUT */}
|
{/* INPUT */}
|
||||||
<div className="mb-5">
|
<div className="mb-5">
|
||||||
<InputCom
|
<InputCom
|
||||||
fieldClass="px-6"
|
fieldClass="sm:px-6 px-2 tracking-[0.25em] text-2xl"
|
||||||
value={password}
|
value={password?.replace(/./g, "●")}
|
||||||
inputHandler={handlePassword}
|
inputHandler={handlePassword}
|
||||||
placeholder="● ● ● ● ● ●"
|
placeholder="● ● ● ● ● ●"
|
||||||
label="Password"
|
label="Password"
|
||||||
@@ -171,8 +171,8 @@ const SuccessfulComponent = ({
|
|||||||
</div>
|
</div>
|
||||||
<div className="mb-5">
|
<div className="mb-5">
|
||||||
<InputCom
|
<InputCom
|
||||||
fieldClass="px-6"
|
fieldClass="sm:px-6 px-2 tracking-[0.25em] text-2xl"
|
||||||
value={confirmPassword}
|
value={confirmPassword?.replace(/./g, "●")}
|
||||||
inputHandler={handlePassword}
|
inputHandler={handlePassword}
|
||||||
placeholder="● ● ● ● ● ●"
|
placeholder="● ● ● ● ● ●"
|
||||||
label="Confirm Password"
|
label="Confirm Password"
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ export default function BlogItem(props) {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
Blog Items Details
|
Blog Items Details need implenet
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ const AssignTaskPopout = React.memo(({ action, details, situation, familyDetail
|
|||||||
// API PAYLOADS
|
// API PAYLOADS
|
||||||
job_id: activeTask.data?.job_id,
|
job_id: activeTask.data?.job_id,
|
||||||
job_uid: activeTask.data?.job_uid,
|
job_uid: activeTask.data?.job_uid,
|
||||||
family_uid: familyDetails.uid,
|
family_uid: familyDetails?.uid || details?.family_uid,
|
||||||
job_description: activeTask.data?.description,
|
job_description: activeTask.data?.description,
|
||||||
assign_mode: 110011,
|
assign_mode: 110011,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import { handlePagingFunc } from "../Pagination/HandlePagination";
|
|||||||
import PaginatedList from "../Pagination/PaginatedList";
|
import PaginatedList from "../Pagination/PaginatedList";
|
||||||
|
|
||||||
import familyImage from '../../assets/images/no-family-side.png'
|
import familyImage from '../../assets/images/no-family-side.png'
|
||||||
|
import localImgLoad from "../../lib/localImgLoad";
|
||||||
|
|
||||||
export default function FamilyTable({ className, familyList, loader, popUpHandler }) {
|
export default function FamilyTable({ className, familyList, loader, popUpHandler }) {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
@@ -54,6 +55,7 @@ export default function FamilyTable({ className, familyList, loader, popUpHandle
|
|||||||
last_login,
|
last_login,
|
||||||
task_count,
|
task_count,
|
||||||
family_uid,
|
family_uid,
|
||||||
|
banner
|
||||||
} = props;
|
} = props;
|
||||||
let addedDate = added?.split(" ")[0];
|
let addedDate = added?.split(" ")[0];
|
||||||
let LoginDate = last_login?.split(" ")[0];
|
let LoginDate = last_login?.split(" ")[0];
|
||||||
@@ -64,9 +66,10 @@ export default function FamilyTable({ className, familyList, loader, popUpHandle
|
|||||||
>
|
>
|
||||||
<td className=" py-4">
|
<td className=" py-4">
|
||||||
<div className="flex space-x-2 items-center w-full">
|
<div className="flex space-x-2 items-center w-full">
|
||||||
<div className="w-full h-[60px] rounded-full overflow-hidden flex justify-center items-center flex-[0.1] min-w-[60px]">
|
<div className="w-[60px] h-[60px] rounded-full overflow-hidden flex justify-center items-center flex-[0.1]">
|
||||||
<img
|
<img
|
||||||
src={dataImage1}
|
// src={dataImage1}
|
||||||
|
src={localImgLoad(`images/icons/${banner}`)}
|
||||||
alt="data"
|
alt="data"
|
||||||
className="w-full h-full"
|
className="w-full h-full"
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
|
import localImgLoad from "../../../lib/localImgLoad";
|
||||||
|
|
||||||
|
|
||||||
export default function ProfileInfo({
|
export default function ProfileInfo({
|
||||||
profileImg,
|
profileImg,
|
||||||
@@ -12,7 +14,7 @@ export default function ProfileInfo({
|
|||||||
<div className="flex justify-center">
|
<div className="flex justify-center">
|
||||||
<div className="w-full relative">
|
<div className="w-full relative">
|
||||||
<img
|
<img
|
||||||
src={profileImg}
|
src={localImgLoad(`images/icons/${accountDetails.banner}`)}
|
||||||
alt=""
|
alt=""
|
||||||
className="sm:w-[180px] sm:h-[180px] w-[120px] h-[120px] rounded-full overflow-hidden object-cover"
|
className="sm:w-[180px] sm:h-[180px] w-[120px] h-[120px] rounded-full overflow-hidden object-cover"
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -504,11 +504,11 @@ export default function Icons({ name }) {
|
|||||||
></path>
|
></path>
|
||||||
</svg>
|
</svg>
|
||||||
) : name === "atm-card" ? (
|
) : name === "atm-card" ? (
|
||||||
<img className="w-[20px]" src={ATMCard} alt="card" />
|
<img className="w-[30px]" src={ATMCard} alt="card" />
|
||||||
) : name === "visa-card" ? (
|
) : name === "visa-card" ? (
|
||||||
<img className="w-[20px]" src={VisaCard} alt="card" />
|
<img className="w-[30px]" src={VisaCard} alt="card" />
|
||||||
) : name === "master-card" ? (
|
) : name === "master-card" ? (
|
||||||
<img className="w-[20px]" src={MasterCard} alt="card" />
|
<img className="w-[30px]" src={MasterCard} alt="card" />
|
||||||
) : name === "new-dashboard" ? (
|
) : name === "new-dashboard" ? (
|
||||||
<img className="w-[17px] h-[17px]" src={localImgLoad('images/icons/dashboard.svg')} alt="dashboard" />
|
<img className="w-[17px] h-[17px]" src={localImgLoad('images/icons/dashboard.svg')} alt="dashboard" />
|
||||||
) : name === "new-family" ? (
|
) : name === "new-family" ? (
|
||||||
|
|||||||
@@ -21,6 +21,9 @@ export default function InputCom({
|
|||||||
blurHandler,
|
blurHandler,
|
||||||
spanTag,
|
spanTag,
|
||||||
inputBg,
|
inputBg,
|
||||||
|
onInput,
|
||||||
|
maxLength = 30,
|
||||||
|
minLength = 0,
|
||||||
direction,
|
direction,
|
||||||
error,
|
error,
|
||||||
}) {
|
}) {
|
||||||
@@ -29,13 +32,13 @@ export default function InputCom({
|
|||||||
// for Min Length:
|
// for Min Length:
|
||||||
const minLengthValidation = () => {
|
const minLengthValidation = () => {
|
||||||
const inputConfig = inputConfigs[inputRef?.current?.name]?.minLength;
|
const inputConfig = inputConfigs[inputRef?.current?.name]?.minLength;
|
||||||
return inputConfig || 0;
|
return inputConfig || minLength;
|
||||||
};
|
};
|
||||||
|
|
||||||
// for MaxLength
|
// for MaxLength
|
||||||
const maxLengthValidation = () => {
|
const maxLengthValidation = () => {
|
||||||
const inputConfig = inputConfigs[inputRef?.current?.name]?.maxLength;
|
const inputConfig = inputConfigs[inputRef?.current?.name]?.maxLength;
|
||||||
return inputConfig || 30;
|
return inputConfig || maxLength;
|
||||||
};
|
};
|
||||||
|
|
||||||
// for Patterns
|
// for Patterns
|
||||||
@@ -63,7 +66,9 @@ export default function InputCom({
|
|||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
{/* displays error is any */}
|
{/* displays error is any */}
|
||||||
{error && <span className="text-[12px] text-red-500 italic">{error}</span>}
|
{error && (
|
||||||
|
<span className="text-[12px] text-red-500 italic">{error}</span>
|
||||||
|
)}
|
||||||
</label>
|
</label>
|
||||||
)}
|
)}
|
||||||
{forgotPassword && (
|
{forgotPassword && (
|
||||||
@@ -76,7 +81,11 @@ export default function InputCom({
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
className={`input-wrapper w-full rounded-full h-[42px] overflow-hidden relative font-medium leading-6 bg-clip-padding text-base ${inputClass ? inputClass : "text-[#5e6278] dark:text-gray-100 bg-[#f5f8fa] dark:bg-[#5e6278] border"}`}
|
className={`input-wrapper w-full rounded-full h-[42px] overflow-hidden relative font-medium leading-6 bg-clip-padding text-base ${
|
||||||
|
inputClass
|
||||||
|
? inputClass
|
||||||
|
: "text-[#5e6278] dark:text-gray-100 bg-[#f5f8fa] dark:bg-[#5e6278] border"
|
||||||
|
}`}
|
||||||
>
|
>
|
||||||
<input
|
<input
|
||||||
placeholder={placeholder}
|
placeholder={placeholder}
|
||||||
@@ -88,6 +97,7 @@ export default function InputCom({
|
|||||||
type={type}
|
type={type}
|
||||||
id={name}
|
id={name}
|
||||||
name={name}
|
name={name}
|
||||||
|
onInput={onInput}
|
||||||
minLength={minLengthValidation()}
|
minLength={minLengthValidation()}
|
||||||
maxLength={maxLengthValidation()}
|
maxLength={maxLengthValidation()}
|
||||||
// pattern={inputPatterns()}
|
// pattern={inputPatterns()}
|
||||||
@@ -104,10 +114,7 @@ export default function InputCom({
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{passIcon && (
|
{passIcon && (
|
||||||
<div
|
<div className="absolute right-6 bottom-3 z-10" onClick={onClick}>
|
||||||
className="absolute right-6 bottom-3 z-10"
|
|
||||||
onClick={onClick}
|
|
||||||
>
|
|
||||||
<Icons name={passIcon} />
|
<Icons name={passIcon} />
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
@@ -128,7 +135,8 @@ const inputConfigs = {
|
|||||||
amount: { minLength: 1, maxLength: 9, pattern: "[0-9]+" },
|
amount: { minLength: 1, maxLength: 9, pattern: "[0-9]+" },
|
||||||
description: { minLength: 5, maxLength: 299 },
|
description: { minLength: 5, maxLength: 299 },
|
||||||
title: { minLength: 5, maxLength: 149 },
|
title: { minLength: 5, maxLength: 149 },
|
||||||
job_detail: { minLength: 4, maxLength: 1440 }
|
job_detail: { minLength: 4, maxLength: 1440 },
|
||||||
|
cardNum: { minLength: 4, maxLength: 19 },
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Numbers Only: <input type="text" pattern="[0-9]*" /> strictly numbers
|
/* Numbers Only: <input type="text" pattern="[0-9]*" /> strictly numbers
|
||||||
|
|||||||
@@ -217,22 +217,22 @@ export default function History() {
|
|||||||
{/* <TopHxBox className="mb-11" /> */}
|
{/* <TopHxBox className="mb-11" /> */}
|
||||||
<div className='w-full p-4 md:p-8 bg-white dark:bg-dark-white rounded-2xl shadow bottomMargin'>
|
<div className='w-full p-4 md:p-8 bg-white dark:bg-dark-white rounded-2xl shadow bottomMargin'>
|
||||||
{/* switch button */}
|
{/* switch button */}
|
||||||
<div className="my-1 flex items-center border-b border-slate-300">
|
<div className="pl-7 my-2 flex items-center border-b border-slate-300 gap-3">
|
||||||
<button
|
<button
|
||||||
name="purchases"
|
name="purchases"
|
||||||
onClick={(e) => setTab(e.target.name)}
|
onClick={(e) => setTab(e.target.name)}
|
||||||
className={`p-2 text-lg font-bold text-slate-600 dark:text-white border ${
|
className={`px-4 py-1 rounded-t-2xl ${
|
||||||
tab == "purchases" ? "border-sky-blue" : "border-slate-300"
|
tab == "purchases" ? "bg-[#4687ba] border-[2px] border-[#4687ba] text-white" : "bg-white text-[#000] border-t-[2px]"
|
||||||
} tracking-wide transition duration-200`}
|
}`}
|
||||||
>
|
>
|
||||||
Purchases
|
Purchases
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
name="recent"
|
name="recent"
|
||||||
onClick={(e) => setTab(e.target.name)}
|
onClick={(e) => setTab(e.target.name)}
|
||||||
className={`p-2 text-lg font-bold text-slate-600 dark:text-white border ${
|
className={`px-4 py-1 rounded-t-2xl ${
|
||||||
tab == "recent" ? "border-sky-blue" : "border-slate-300"
|
tab == "recent" ? "bg-[#4687ba] border-[2px] border-[#4687ba] text-white" : "bg-white text-[#000] border-t-[2px]"
|
||||||
} tracking-wide transition duration-200`}
|
}`}
|
||||||
>
|
>
|
||||||
Recent Activity
|
Recent Activity
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -9,59 +9,61 @@ import PaginatedList from "../Pagination/PaginatedList";
|
|||||||
import { handlePagingFunc } from "../Pagination/HandlePagination";
|
import { handlePagingFunc } from "../Pagination/HandlePagination";
|
||||||
|
|
||||||
export default function ActiveJobMessage({ activeJobMesList }) {
|
export default function ActiveJobMessage({ activeJobMesList }) {
|
||||||
const [currentPage, setCurrentPage] = useState(0);
|
// const [currentPage, setCurrentPage] = useState(0);
|
||||||
const indexOfFirstItem = Number(currentPage);
|
// const indexOfFirstItem = Number(currentPage);
|
||||||
const indexOfLastItem = Number(indexOfFirstItem)+Number(process.env.REACT_APP_ITEM_PER_PAGE);
|
// const indexOfLastItem = Number(indexOfFirstItem)+Number(process.env.REACT_APP_ITEM_PER_PAGE);
|
||||||
const currentActiveJobMesList = activeJobMesList?.data?.slice(indexOfFirstItem, indexOfLastItem);
|
// const currentActiveJobMesList = activeJobMesList?.data?.slice(indexOfFirstItem, indexOfLastItem);
|
||||||
|
|
||||||
const handlePagination = (e) => {
|
// const handlePagination = (e) => {
|
||||||
handlePagingFunc(e,setCurrentPage)
|
// handlePagingFunc(e,setCurrentPage)
|
||||||
}
|
// }
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='flex flex-col justify-between h-full'>
|
<div className='flex flex-col justify-between'>
|
||||||
<table className="wallet-activity w-full table-auto border-collapse text-left">
|
<div className="w-full min-h-[450px] max-h-[450px] overflow-y-scroll">
|
||||||
<thead className='border-b-2'>
|
<table className="wallet-activity w-full table-auto border-collapse text-left">
|
||||||
<tr className='text-slate-600'>
|
<thead className='border-b-2'>
|
||||||
<th className="p-2"></th>
|
<tr className='text-slate-600'>
|
||||||
</tr>
|
<th className="p-2"></th>
|
||||||
</thead>
|
</tr>
|
||||||
{activeJobMesList.data.length ?
|
</thead>
|
||||||
(
|
{activeJobMesList?.data?.length ?
|
||||||
<tbody>
|
(
|
||||||
{currentActiveJobMesList.map((item, index) => (
|
<tbody>
|
||||||
<tr key={index} className='text-slate-500'>
|
{activeJobMesList.data.map((item, index) => (
|
||||||
<td>
|
<tr key={index} className='text-slate-500'>
|
||||||
<div className="msg_box">
|
<td>
|
||||||
<div className="msg_header">{item.msg_date} {item.msg_firstname}</div>
|
<div className={`msg_box ${item.who}`}>
|
||||||
<span className="p-2" dangerouslySetInnerHTML={{__html: item.message}}></span>
|
<div className="msg_header">{item.msg_date} {item.msg_firstname}</div>
|
||||||
</div>
|
<span className="p-2" dangerouslySetInnerHTML={{__html: item.message}}></span>
|
||||||
|
</div>
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
))}
|
))}
|
||||||
</tbody>
|
</tbody>
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
activeJobMesList.error ?
|
activeJobMesList.error ?
|
||||||
(
|
(
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr className='text-slate-500'>
|
<tr className='text-slate-500'>
|
||||||
<td className="p-2" colSpan={4}>Opps! an error occurred. Please try again!</td>
|
<td className="p-2" colSpan={4}>Opps! an error occurred. Please try again!</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr className='text-slate-500'>
|
<tr className='text-slate-500'>
|
||||||
<td className="p-2" colSpan={4}>No Message Found!</td>
|
<td className="p-2" colSpan={4}>No Message Found!</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
}
|
}
|
||||||
</table>
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
{/* PAGINATION BUTTON */}
|
{/* PAGINATION BUTTON */}
|
||||||
<PaginatedList onClick={handlePagination} prev={currentPage == 0 ? true : false} next={currentPage+Number(process.env.REACT_APP_ITEM_PER_PAGE) >= activeJobMesList?.data?.length ? true : false} data={activeJobMesList?.data} start={indexOfFirstItem} stop={indexOfLastItem} />
|
{/* <PaginatedList onClick={handlePagination} prev={currentPage == 0 ? true : false} next={currentPage+Number(process.env.REACT_APP_ITEM_PER_PAGE) >= activeJobMesList?.data?.length ? true : false} data={activeJobMesList?.data} start={indexOfFirstItem} stop={indexOfLastItem} /> */}
|
||||||
{/* END OF PAGINATION BUTTON */}
|
{/* END OF PAGINATION BUTTON */}
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -353,7 +353,7 @@ function ActiveJobs(props) {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="my-4 py-[20px] bg-white dark:bg-black px-4 rounded-2xl shadow-md lg:flex justify-between items-start space-y-4 lg:space-x-4 lg:space-y-0">
|
<div className="my-4 py-[20px] bg-white dark:bg-black px-4 rounded-2xl shadow-md lg:flex justify-between items-start space-y-4 lg:space-x-4 lg:space-y-0">
|
||||||
<div className="w-full lg:w-1/2">
|
<div className="w-full lg:w-1/2 mb-4 border-b pb-4 lg:pb-0 lg:mb-0 lg:border-b-0">
|
||||||
<div className="">
|
<div className="">
|
||||||
<h1 className="text-lg font-bold text-dark-gray dark:text-white tracking-wide">
|
<h1 className="text-lg font-bold text-dark-gray dark:text-white tracking-wide">
|
||||||
Actions
|
Actions
|
||||||
@@ -367,23 +367,25 @@ function ActiveJobs(props) {
|
|||||||
{/* TEXTAREA SECTION */}
|
{/* TEXTAREA SECTION */}
|
||||||
<div className="mt-5">
|
<div className="mt-5">
|
||||||
<div className="">
|
<div className="">
|
||||||
{/* <p className="relative py-2 my-2 text-lg font-bold text-slate-600 dark:text-black border-b-2 border-slate-300 tracking-wide after:absolute after:-bottom-0.5 after:content-[''] after:w-[100px] after:h-[2px] after:bg-sky-blue after:left-0">Message(s)</p> */}
|
<div
|
||||||
<div className="my-2 flex items-center border-b border-slate-300">
|
className="pl-7 my-2 flex items-center border-b border-slate-300 gap-3"
|
||||||
|
// className='ml-7 flex justify-start items-center gap-3'
|
||||||
|
>
|
||||||
<button
|
<button
|
||||||
name="message"
|
name="message"
|
||||||
onClick={(e) => setTab(e.target.name)}
|
onClick={(e) => setTab(e.target.name)}
|
||||||
className={`p-2 text-lg font-bold text-slate-600 dark:text-white border ${
|
className={`px-4 py-1 rounded-t-2xl ${
|
||||||
tab == "message" ? "border-sky-blue" : "border-slate-300"
|
tab == "message" ? "bg-[#4687ba] border-[2px] border-[#4687ba] text-white" : "bg-white text-[#000] border-t-[2px]"
|
||||||
} tracking-wide transition duration-200`}
|
}`}
|
||||||
>
|
>
|
||||||
Send Message
|
Send Message
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
name="files"
|
name="files"
|
||||||
onClick={(e) => setTab(e.target.name)}
|
onClick={(e) => setTab(e.target.name)}
|
||||||
className={`p-2 text-lg font-bold text-slate-600 dark:text-white border ${
|
className={`px-4 py-1 rounded-t-2xl ${
|
||||||
tab == "files" ? "border-sky-blue" : "border-slate-300"
|
tab == "files" ? "bg-[#4687ba] border-[2px] border-[#4687ba] text-white" : "bg-white text-[#000] border-t-[2px]"
|
||||||
} tracking-wide transition duration-200`}
|
}`}
|
||||||
>
|
>
|
||||||
Send Files
|
Send Files
|
||||||
</button>
|
</button>
|
||||||
@@ -402,7 +404,7 @@ function ActiveJobs(props) {
|
|||||||
<div className="files">
|
<div className="files">
|
||||||
<label
|
<label
|
||||||
htmlFor="file"
|
htmlFor="file"
|
||||||
className="h-20 btn-gradient text-base tracking-wide px-4 py-2 rounded-full text-white cursor-pointer"
|
className="btn-gradient text-base tracking-wide px-4 py-2 rounded-full text-white cursor-pointer"
|
||||||
>
|
>
|
||||||
Select Files to Upload
|
Select Files to Upload
|
||||||
</label>
|
</label>
|
||||||
@@ -457,11 +459,11 @@ function ActiveJobs(props) {
|
|||||||
|
|
||||||
{/* Buttons Sections */}
|
{/* Buttons Sections */}
|
||||||
<div className="py-2 sm:flex sm:justify-end sm:items-center">
|
<div className="py-2 sm:flex sm:justify-end sm:items-center">
|
||||||
<div className="w-full sm:w-2/4 flex justify-between items-center space-x-2">
|
<div className="w-full sm:w-3/4 flex justify-between items-center space-x-2">
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
onClick={handleClearAll}
|
onClick={handleClearAll}
|
||||||
className="border-gradient text-base tracking-wide px-4 py-3 rounded-full"
|
className="border-gradient text-base tracking-wide px-4 py-2 rounded-full"
|
||||||
>
|
>
|
||||||
<span className="text-gradient">Clear</span>
|
<span className="text-gradient">Clear</span>
|
||||||
</button>
|
</button>
|
||||||
@@ -469,7 +471,7 @@ function ActiveJobs(props) {
|
|||||||
<button
|
<button
|
||||||
onClick={sendFile}
|
onClick={sendFile}
|
||||||
type="button"
|
type="button"
|
||||||
className="btn-gradient text-base tracking-wide px-4 py-3 rounded-full flex justify-center items-center"
|
className='btn-gradient text-base tracking-wide px-4 py-2 rounded-full text-white cursor-pointer flex justify-center items-center'
|
||||||
>
|
>
|
||||||
{requestStatus.loading ? (
|
{requestStatus.loading ? (
|
||||||
<LoadingSpinner size="6" color="sky-blue" />
|
<LoadingSpinner size="6" color="sky-blue" />
|
||||||
@@ -493,7 +495,7 @@ function ActiveJobs(props) {
|
|||||||
<button
|
<button
|
||||||
onClick={sendTaskMessage}
|
onClick={sendTaskMessage}
|
||||||
type="button"
|
type="button"
|
||||||
className="btn-gradient text-base text-white tracking-wide px-4 py-3 rounded-full"
|
className='btn-gradient text-base tracking-wide px-4 py-2 rounded-full text-white cursor-pointer'
|
||||||
>
|
>
|
||||||
{requestStatus.loading ? (
|
{requestStatus.loading ? (
|
||||||
<LoadingSpinner size="6" color="sky-blue" />
|
<LoadingSpinner size="6" color="sky-blue" />
|
||||||
@@ -518,9 +520,9 @@ function ActiveJobs(props) {
|
|||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
onClick={popUpHandler}
|
onClick={popUpHandler}
|
||||||
className="px-2 py-1 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
|
className="btn-gradient text-base tracking-wide px-4 py-2 rounded-full text-white cursor-pointer flex justify-center items-center"
|
||||||
>
|
>
|
||||||
view all
|
View all
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
{props.activeJobMesList.loading ? (
|
{props.activeJobMesList.loading ? (
|
||||||
|
|||||||
@@ -4,15 +4,15 @@ function CurrentJobAction() {
|
|||||||
return (
|
return (
|
||||||
<div className='job-action dark:bg-black'>
|
<div className='job-action dark:bg-black'>
|
||||||
<p className="my-3 py-1 text-base active-owner">
|
<p className="my-3 py-1 text-base active-owner">
|
||||||
<table className="w-full text-sm text-left text-gray-500">
|
<table className="w-full text-sm text-left text-gray-500 ">
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<div className="flex space-x-2 items-center w-full">
|
<div className="flex space-x-2 items-center w-full task_action_panel">
|
||||||
|
|
||||||
<h1 className="text-xl text-dark-gray dark:text-white">
|
<div>
|
||||||
Waiting for the completion message from the client before you can approve.
|
Waiting for the completion message from the client before you can approve.
|
||||||
</h1>
|
</div>
|
||||||
{/*<div className="flex flex-col flex-[0.9]"> </div>*/}
|
{/*<div className="flex flex-col flex-[0.9]"> </div>*/}
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
|
|||||||
@@ -62,14 +62,14 @@ function CurrentTaskAction({jobDetails}) {
|
|||||||
return (
|
return (
|
||||||
<div className='job-action dark:bg-black'>
|
<div className='job-action dark:bg-black'>
|
||||||
|
|
||||||
<table className="w-full text-sm text-left text-gray-500 active-worker">
|
<table className="w-full text-sm text-left text-gray-500 active-worker ">
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<div className="flex space-x-2 items-center w-full">
|
<div className="flex space-x-2 items-center w-full task_action_panel">
|
||||||
<h1 className="text-xl text-dark-gray dark:text-white">
|
<div>
|
||||||
I completed this task and ready for review and acceptance.
|
I completed this task and ready for review and acceptance.
|
||||||
</h1>
|
</div>
|
||||||
{/*<div className="flex flex-col flex-[0.9]">*/}
|
{/*<div className="flex flex-col flex-[0.9]">*/}
|
||||||
|
|
||||||
{/*</div>*/}
|
{/*</div>*/}
|
||||||
|
|||||||
@@ -107,19 +107,18 @@ function PastDueJobAction({jobDetails}) {
|
|||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<div className="flex space-x-2 items-center w-full">
|
<div className="flex space-x-2 items-center w-full task_action_panel">
|
||||||
|
|
||||||
<h1 className="text-xl text-dark-gray dark:text-white">
|
<div className="dark:text-red-700">
|
||||||
Time allocated has passed
|
Time allocated has passed
|
||||||
</h1>
|
</div>
|
||||||
{/*<div className="flex flex-col flex-[0.9]"> </div>*/}
|
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<div className="flex justify-center items-center">
|
<div className="flex justify-center items-center">
|
||||||
<button type="button" onClick={popUpHandler} className="w-[150px] h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white">
|
<button type="button" onClick={popUpHandler} className="w-[180px] h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white">
|
||||||
Cancel or Extend Timeline
|
Cancel or Extend Timeline
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -8,11 +8,11 @@ function PastDueTaskAction() {
|
|||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<div className="flex space-x-2 items-center w-full">
|
<div className="flex space-x-2 items-center w-full task_action_panel">
|
||||||
|
|
||||||
<h1 className="text-xl text-dark-gray dark:text-white">
|
<div>
|
||||||
You have missed the allocated time
|
You have missed the allocated time
|
||||||
</h1>
|
</div>
|
||||||
{/*<div className="flex flex-col flex-[0.9]"> </div>*/}
|
{/*<div className="flex flex-col flex-[0.9]"> </div>*/}
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
|
|||||||
@@ -96,11 +96,11 @@ function ReviewJobAction({jobDetails}) {
|
|||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<div className="flex space-x-2 items-center w-full">
|
<div className="flex space-x-2 items-center w-full task_action_panel">
|
||||||
|
|
||||||
<h1 className="text-xl text-dark-gray dark:text-white">
|
<div>
|
||||||
This Job is Ready for your review
|
This Job is Ready for your review
|
||||||
</h1>
|
</div>
|
||||||
{/*<div className="flex flex-col flex-[0.9]"> </div>*/}
|
{/*<div className="flex flex-col flex-[0.9]"> </div>*/}
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import React from 'react'
|
|||||||
|
|
||||||
function ReviewTaskAction() {
|
function ReviewTaskAction() {
|
||||||
return (
|
return (
|
||||||
<div className='job-action dark:bg-black'>
|
<div className='job-action dark:bg-black task_action_panel'>
|
||||||
<p className="my-3 py-1 text-base text-dark-gray dark:text-white">
|
<p className="my-3 py-1 text-base text-dark-gray dark:text-white">
|
||||||
Waiting for the completion message from the client before you can approve. Worker True & Review Job
|
Waiting for the completion message from the client before you can approve. Worker True & Review Job
|
||||||
</p>
|
</p>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { useRef, useState } from "react";
|
|||||||
import OfferCard from "../Cards/OfferCard";
|
import OfferCard from "../Cards/OfferCard";
|
||||||
import Icons from "../Helpers/Icons";
|
import Icons from "../Helpers/Icons";
|
||||||
import SliderCom from "../Helpers/SliderCom";
|
import SliderCom from "../Helpers/SliderCom";
|
||||||
import OfferJobPopout from "../jobPopout/OfferJobPopout";
|
import FamilyOfferJobPopout from "../jobPopout/FamilyOfferJobPopout";
|
||||||
|
|
||||||
export default function MyOffersFamilyTable({ className, familyOffers }) {
|
export default function MyOffersFamilyTable({ className, familyOffers }) {
|
||||||
let [offerPopout, setOfferPopout] = useState({ show: false, data: {} }); // STATE TO HOLD THE VALUE OF THE ALERT DETAILS AND DETERMINE WHEN TO SHOW
|
let [offerPopout, setOfferPopout] = useState({ show: false, data: {} }); // STATE TO HOLD THE VALUE OF THE ALERT DETAILS AND DETERMINE WHEN TO SHOW
|
||||||
@@ -127,7 +127,7 @@ export default function MyOffersFamilyTable({ className, familyOffers }) {
|
|||||||
|
|
||||||
{/* Offer Job Popout */}
|
{/* Offer Job Popout */}
|
||||||
{offerPopout.show && (
|
{offerPopout.show && (
|
||||||
<OfferJobPopout
|
<FamilyOfferJobPopout
|
||||||
details={offerPopout.data}
|
details={offerPopout.data}
|
||||||
onClose={() => {
|
onClose={() => {
|
||||||
setOfferPopout({ show: false, data: {} });
|
setOfferPopout({ show: false, data: {} });
|
||||||
|
|||||||
@@ -1,235 +0,0 @@
|
|||||||
import React, { useState } from "react";
|
|
||||||
import { useSelector } from "react-redux";
|
|
||||||
import { useNavigate } from "react-router-dom";
|
|
||||||
import { toast } from "react-toastify";
|
|
||||||
|
|
||||||
import usersService from "../../services/UsersService";
|
|
||||||
|
|
||||||
import { FlutterWaveButton, closePaymentModal } from "flutterwave-react-v3";
|
|
||||||
|
|
||||||
function ConfirmAddFund({ confirmCredit, onClose, walletItem }) {
|
|
||||||
const __confirmData = confirmCredit?.data;
|
|
||||||
const __confirmCountry = walletItem?.country;
|
|
||||||
const __confirmCardDetails = __confirmData.card
|
|
||||||
? JSON.parse(__confirmData.card)
|
|
||||||
: "";
|
|
||||||
let { userDetails } = useSelector((state) => state.userDetails); // TO GET LOGGEDIN USER DETAILS
|
|
||||||
|
|
||||||
let [confirmLoading, setConfirmLoading] = useState(false);
|
|
||||||
|
|
||||||
let [requestStatus, setRequestStatus] = useState({
|
|
||||||
message: "",
|
|
||||||
loading: false,
|
|
||||||
status: false,
|
|
||||||
}); // STATE FOR API REQUEST
|
|
||||||
|
|
||||||
const apiURL = new usersService();
|
|
||||||
const navigate = useNavigate();
|
|
||||||
|
|
||||||
//FUNCTION TO HANDLE SUBMIT
|
|
||||||
const onSuccessPayment = () => {
|
|
||||||
setRequestStatus({ message: "", loading: true, status: false });
|
|
||||||
let reqData = { amount: confirmCredit?.data?.account, currency: "NGN" };
|
|
||||||
apiURL
|
|
||||||
.startTopUp(reqData)
|
|
||||||
.then((res) => {
|
|
||||||
if (res.data.internal_return < 0) {
|
|
||||||
setRequestStatus({
|
|
||||||
message: "Could not finish transaction",
|
|
||||||
loading: false,
|
|
||||||
status: false,
|
|
||||||
});
|
|
||||||
toast.success("Opps! something went wrong");
|
|
||||||
}
|
|
||||||
// do something
|
|
||||||
setRequestStatus({
|
|
||||||
message: "Topup successful",
|
|
||||||
loading: false,
|
|
||||||
status: true,
|
|
||||||
});
|
|
||||||
toast.success("Account Topup was successful");
|
|
||||||
setTimeout(() => {
|
|
||||||
navigate("/my-wallet", { replace: true });
|
|
||||||
}, 1000);
|
|
||||||
})
|
|
||||||
.catch((err) => {
|
|
||||||
// do something
|
|
||||||
setRequestStatus({
|
|
||||||
message: "Opps! An Error Occured",
|
|
||||||
loading: false,
|
|
||||||
status: false,
|
|
||||||
});
|
|
||||||
toast.success("Opps! something went wrong");
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
const config = {
|
|
||||||
public_key: process.env.REACT_APP_FLUTTERWAVE_APIKEY,
|
|
||||||
tx_ref: Date.now(),
|
|
||||||
amount: confirmCredit?.data?.amount,
|
|
||||||
currency: "NGN",
|
|
||||||
payment_options: "card,mobilemoney,ussd",
|
|
||||||
customer: {
|
|
||||||
email: `${userDetails.email}`,
|
|
||||||
phone_number: userDetails.phone,
|
|
||||||
name: `${userDetails.lastname} ${userDetails.firstname}`,
|
|
||||||
},
|
|
||||||
customizations: {
|
|
||||||
title: "WrenchBoard",
|
|
||||||
description: "Topup Payment",
|
|
||||||
logo: "https://st2.depositphotos.com/4403291/7418/v/450/depositphotos_74189661-stock-illustration-online-shop-log.jpg",
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
const fwConfig = {
|
|
||||||
...config,
|
|
||||||
text: "Proceed",
|
|
||||||
callback: (response) => {
|
|
||||||
onSuccessPayment();
|
|
||||||
closePaymentModal(); // this will close the modal programmatically
|
|
||||||
},
|
|
||||||
onClose: () => {},
|
|
||||||
};
|
|
||||||
|
|
||||||
const handlePrevCard = async () => {
|
|
||||||
setConfirmLoading(true);
|
|
||||||
let reqData = {
|
|
||||||
amount: __confirmData.amount * 100,
|
|
||||||
card_uid: __confirmCardDetails.card_uid,
|
|
||||||
credit_reference: __confirmData.credit_reference,
|
|
||||||
currency: __confirmData.currency,
|
|
||||||
};
|
|
||||||
|
|
||||||
try {
|
|
||||||
const res = await apiURL.getPaidPrevCard(reqData);
|
|
||||||
setConfirmLoading(false);
|
|
||||||
console.log(res.data);
|
|
||||||
} catch (error) {
|
|
||||||
setConfirmLoading(false);
|
|
||||||
console.log(error);
|
|
||||||
}
|
|
||||||
console.log("Test me");
|
|
||||||
};
|
|
||||||
|
|
||||||
const ThePaymentText = ({ value }) => (
|
|
||||||
<div className="my-2 flex items-center gap-5">
|
|
||||||
<div className="card-details flex items-center gap-3">
|
|
||||||
<h1 className="text-xl font-bold text-dark-gray dark:text-white tracking-tighter my-1">
|
|
||||||
{value.description} Card
|
|
||||||
</h1>
|
|
||||||
<p className="text-base font-bold text-dark-gray dark:text-white tracking-wide">
|
|
||||||
Bank **************{value.digits}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
|
|
||||||
console.log(confirmCredit);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div className="content-wrapper w-full h-[32rem]">
|
|
||||||
<div className="w-full mb-10">
|
|
||||||
<div className="add-fund w-full bg-white dark:bg-dark-white rounded-2xl">
|
|
||||||
<div className="px-4 md:p-8 py-4 add-fund-info">
|
|
||||||
<div className="field w-full mb-3 min-h-[45px]">
|
|
||||||
{confirmCredit?.show ? (
|
|
||||||
<div className="flex flex-col gap-4">
|
|
||||||
<div
|
|
||||||
className={`flex items-center ${
|
|
||||||
__confirmCountry == "US" ? "gap-14" : "gap-4"
|
|
||||||
}`}
|
|
||||||
>
|
|
||||||
<h1 className="text-xl font-bold text-dark-gray dark:text-white tracking-tighter my-1">
|
|
||||||
Amount({__confirmData?.currency})
|
|
||||||
</h1>
|
|
||||||
<span className="text-xl font-bold text-dark-gray dark:text-white tracking-tighter my-1">
|
|
||||||
{`${walletItem?.symbol} ${
|
|
||||||
Number(__confirmData?.amount).toLocaleString() || ""
|
|
||||||
}`}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
{__confirmCountry == "US" && (
|
|
||||||
<div className="flex items-center gap-8">
|
|
||||||
<label
|
|
||||||
htmlFor="payment"
|
|
||||||
className="text-xl font-bold text-dark-gray dark:text-white tracking-tighter my-1"
|
|
||||||
>
|
|
||||||
{__confirmCountry == "US" && "Payment Method"}
|
|
||||||
</label>
|
|
||||||
<span className="text-[#181c32] dark:text-white ">
|
|
||||||
{__confirmCardDetails ? (
|
|
||||||
<ThePaymentText value={__confirmCardDetails} />
|
|
||||||
) : null}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
|
|
||||||
<div
|
|
||||||
className={`${
|
|
||||||
__confirmCountry == "US" ? "gap-[3.7rem]" : "gap-8"
|
|
||||||
} flex items-center`}
|
|
||||||
>
|
|
||||||
<h1 className="text-xl font-bold text-dark-gray dark:text-white tracking-tighter my-1">
|
|
||||||
Reference No
|
|
||||||
</h1>
|
|
||||||
<span className="text-xl font-bold text-dark-gray dark:text-white tracking-tighter my-1">
|
|
||||||
{__confirmData?.credit_reference}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
) : null}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{/* <hr /> */}
|
|
||||||
<div
|
|
||||||
className={
|
|
||||||
__confirmCountry == "US" ? "min-h-[163px]" : "min-h-[200px]"
|
|
||||||
}
|
|
||||||
></div>
|
|
||||||
<div className="md:p-8 p-4 add-fund-btn flex justify-end items-center py-4 gap-4">
|
|
||||||
<button
|
|
||||||
className="px-4 h-11 flex justify-center items-center border-gradient text-base rounded-full"
|
|
||||||
onClick={onClose}
|
|
||||||
>
|
|
||||||
Cancel
|
|
||||||
</button>
|
|
||||||
{__confirmCountry == "US" && (
|
|
||||||
<button
|
|
||||||
className="px-4 h-11 flex justify-center items-center btn-gradient text-white text-base rounded-full"
|
|
||||||
onClick={
|
|
||||||
__confirmData?.cardType === "prev"
|
|
||||||
? handlePrevCard
|
|
||||||
: () => console.log("Test me")
|
|
||||||
}
|
|
||||||
>
|
|
||||||
Proceed
|
|
||||||
</button>
|
|
||||||
)}
|
|
||||||
{__confirmCountry == "NG" && (
|
|
||||||
<FlutterWaveButton
|
|
||||||
{...fwConfig}
|
|
||||||
className="px-2 py-1 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* <div className="w-full mb-10">
|
|
||||||
<div className="wallet w-full md:p-8 p-4 h-full bg-white dark:bg-dark-white rounded-2xl shadow">
|
|
||||||
<h2 className="text-gray-900 dark:text-white text-xl lg:text-2xl font-medium">
|
|
||||||
Recent Activity
|
|
||||||
</h2>
|
|
||||||
<p className='text-base text-gray-600 dark:text-white'>Activity Report</p>
|
|
||||||
{payment.loading ? (
|
|
||||||
<LoadingSpinner size="16" color="sky-blue" />
|
|
||||||
) : (
|
|
||||||
<RecentActivityTable payment={payment} />
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
</div> */}
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default ConfirmAddFund;
|
|
||||||
+138
-76
@@ -1,29 +1,38 @@
|
|||||||
import React, { useEffect, useState } from "react";
|
|
||||||
import { useNavigate } from "react-router-dom";
|
|
||||||
import usersService from "../../services/UsersService";
|
|
||||||
import InputCom from "../Helpers/Inputs/InputCom";
|
|
||||||
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
|
||||||
|
|
||||||
import { Form, Formik } from "formik";
|
import { Form, Formik } from "formik";
|
||||||
|
import { useEffect, useState } from "react";
|
||||||
import { useSelector } from "react-redux";
|
import { useSelector } from "react-redux";
|
||||||
import * as Yup from "yup";
|
import * as Yup from "yup";
|
||||||
import Icons from "../Helpers/Icons";
|
import usersService from "../../../services/UsersService";
|
||||||
|
import Icons from "../../Helpers/Icons";
|
||||||
|
import InputCom from "../../Helpers/Inputs/InputCom";
|
||||||
|
import LoadingSpinner from "../../Spinners/LoadingSpinner";
|
||||||
|
|
||||||
const validationSchema = Yup.object().shape({
|
const validationSchema = Yup.object().shape({
|
||||||
name: Yup.string()
|
|
||||||
.min(3, "3 chars min.")
|
|
||||||
.max(50, "50 chars max.")
|
|
||||||
.required("required"),
|
|
||||||
cardNum: Yup.string()
|
cardNum: Yup.string()
|
||||||
.min(3, "3 chars min.")
|
.min(6, "not a card number")
|
||||||
.max(25, "25 chars max.")
|
.max(19, "16 chars max.") //16 chars + 3 spaces
|
||||||
|
.test("luhn-validation", "Invalid Card Number", (value) => {
|
||||||
|
const sanitizedNumber = value?.replace(/\D/g, "");
|
||||||
|
const digits = Array?.from(sanitizedNumber, Number);
|
||||||
|
|
||||||
|
for (let i = digits.length - 2; i >= 0; i -= 2) {
|
||||||
|
digits[i] *= 2;
|
||||||
|
if (digits[i] > 9) {
|
||||||
|
digits[i] -= 9;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const sum = digits.reduce((acc, digit) => acc + digit, 0);
|
||||||
|
|
||||||
|
return sum % 10 === 0;
|
||||||
|
})
|
||||||
.required("required"),
|
.required("required"),
|
||||||
code: Yup.string()
|
code: Yup.string()
|
||||||
.min(3, "3 chars min.")
|
.min(3, "3 chars min.")
|
||||||
.max(25, "25 chars max.")
|
.max(25, "25 chars max.")
|
||||||
.required("required"),
|
.required("required"),
|
||||||
state: Yup.string()
|
state: Yup.string()
|
||||||
.min(3, "3 chars min.")
|
.min(2, "2 chars min.")
|
||||||
.max(25, "25 chars max.")
|
.max(25, "25 chars max.")
|
||||||
.required("required"),
|
.required("required"),
|
||||||
address: Yup.string()
|
address: Yup.string()
|
||||||
@@ -45,7 +54,6 @@ const validationSchema = Yup.object().shape({
|
|||||||
});
|
});
|
||||||
|
|
||||||
const initialValues = {
|
const initialValues = {
|
||||||
name: "",
|
|
||||||
cardNum: "",
|
cardNum: "",
|
||||||
code: "",
|
code: "",
|
||||||
state: "",
|
state: "",
|
||||||
@@ -56,24 +64,54 @@ const initialValues = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
function AddFundDollars(props) {
|
function AddFundDollars(props) {
|
||||||
const navigate = useNavigate();
|
|
||||||
const apiCall = new usersService();
|
const apiCall = new usersService();
|
||||||
let countryWallet = props.walletItem.country;
|
let countryWallet = props.walletItem.country;
|
||||||
const [tab, setTab] = useState("previous");
|
const [tab, setTab] = useState("previous");
|
||||||
const [loader, setLoader] = useState(false);
|
|
||||||
const { userDetails } = useSelector((state) => state?.userDetails);
|
const { userDetails } = useSelector((state) => state?.userDetails);
|
||||||
const { firstname, lastname } = userDetails;
|
|
||||||
const [prevCardDetails, setPrevCardDetails] = useState({});
|
const [prevCardDetails, setPrevCardDetails] = useState({});
|
||||||
const [payListCards, setPayListCards] = useState({ loading: true, data: [] });
|
const [payListCards, setPayListCards] = useState({ loading: true, data: [] });
|
||||||
|
const [cardIcons, setCardIcons] = useState("atm-card");
|
||||||
|
const [prevCardError, setPrevCardError] = useState("");
|
||||||
|
|
||||||
|
const { firstname, lastname } = userDetails;
|
||||||
|
|
||||||
|
// Handling Card Icons
|
||||||
|
const handleCards = (event) => {
|
||||||
|
const { name, value } = event.target;
|
||||||
|
|
||||||
|
if (name == "cardNum") {
|
||||||
|
// Check if the first character is 4 or 5 and set the card icon accordingly
|
||||||
|
const cardIcon =
|
||||||
|
value.length > 0
|
||||||
|
? value[0] === "4"
|
||||||
|
? "visa-card"
|
||||||
|
: value[0] === "5"
|
||||||
|
? "master-card"
|
||||||
|
: "atm-card"
|
||||||
|
: "atm-card";
|
||||||
|
setCardIcons(cardIcon);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// Handling card change
|
||||||
const handleInputChange = (event) => {
|
const handleInputChange = (event) => {
|
||||||
const { name, value } = event.target;
|
const { name, value } = event.target;
|
||||||
|
|
||||||
setPrevCardDetails((prevState) => ({
|
setPrevCardDetails((prevState) => ({
|
||||||
...prevState,
|
...prevState,
|
||||||
[name]: value,
|
[name]: value,
|
||||||
}));
|
}));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Handling card number grouping
|
||||||
|
const handleCardNumberChange = (value) => {
|
||||||
|
return value
|
||||||
|
?.replace(/\s/g, "") // Remove existing spaces
|
||||||
|
.match(/.{1,4}/g) // Group every four characters
|
||||||
|
?.join(" ");
|
||||||
|
};
|
||||||
|
|
||||||
|
// card slicer
|
||||||
const indexOfFirstItem = 0;
|
const indexOfFirstItem = 0;
|
||||||
const indexOfLastItem =
|
const indexOfLastItem =
|
||||||
indexOfFirstItem + Number(process.env.REACT_APP_ITEM_PER_PAGE);
|
indexOfFirstItem + Number(process.env.REACT_APP_ITEM_PER_PAGE);
|
||||||
@@ -82,66 +120,72 @@ function AddFundDollars(props) {
|
|||||||
indexOfLastItem
|
indexOfLastItem
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Submission for both prev and new cards
|
||||||
const handleSubmit = async (values, helpers) => {
|
const handleSubmit = async (values, helpers) => {
|
||||||
props.setInputError("");
|
props.setInputError("");
|
||||||
|
|
||||||
if (!props.input || props.input === "0") {
|
if (!props.input || props.input === "0") {
|
||||||
props.setInputError("Please Enter Amount");
|
props.setInputError("Please Enter Amount");
|
||||||
|
setTimeout(() => props.setInputError(""), 5000);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isNaN(props.input)) {
|
if (isNaN(props.input)) {
|
||||||
props.setInputError("Amount must be a Number");
|
props.setInputError("Amount must be a Number");
|
||||||
|
setTimeout(() => props.setInputError(""), 5000);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tab === "previous") {
|
if (tab === "previous") {
|
||||||
if (!prevCardDetails) {
|
// To check if card is empty
|
||||||
|
if (Object.keys(prevCardDetails).length === 0) {
|
||||||
|
setPrevCardError("No card selected!");
|
||||||
|
setTimeout(() => setPrevCardError(""), 5000);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
setLoader(true);
|
|
||||||
let stateData = {
|
|
||||||
amount: Number(props.input) * 100,
|
|
||||||
currency: props.walletItem?.code,
|
|
||||||
};
|
|
||||||
|
|
||||||
try {
|
|
||||||
const res = await apiCall.getStartCredit(stateData);
|
|
||||||
if (res.data.internal_return < 0) {
|
|
||||||
setLoader(false);
|
|
||||||
props.setInputError("An Error Occurred");
|
|
||||||
setTimeout(() => props.setInputError(""), 5000);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const _response = res.data;
|
|
||||||
stateData.amount = Number(props.input);
|
|
||||||
stateData.card = prevCardDetails["payment-card"];
|
|
||||||
stateData.cardType = "prev";
|
|
||||||
stateData = { ...stateData, ..._response };
|
|
||||||
|
|
||||||
setTimeout(() => {
|
|
||||||
setLoader(false);
|
|
||||||
props.setConfirmCredit({
|
|
||||||
show: true,
|
|
||||||
data: stateData,
|
|
||||||
});
|
|
||||||
}, 1500);
|
|
||||||
} catch (error) {
|
|
||||||
console.log(error);
|
|
||||||
}
|
|
||||||
|
|
||||||
return setTimeout(() => {
|
|
||||||
props.setConfirmCredit({ show: true, data: stateData });
|
|
||||||
setLoader(false);
|
|
||||||
}, 1500);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tab === "new") {
|
props.setConfirmCredit((prev) => ({
|
||||||
const stateData = {
|
...prev,
|
||||||
amount: Number(props.input),
|
show: { awaitConfirm: { loader: true } },
|
||||||
currency: props.currency,
|
}));
|
||||||
...values,
|
|
||||||
};
|
let stateData = {
|
||||||
|
amount: Number(props.input) * 100,
|
||||||
|
currency: props.walletItem?.code,
|
||||||
|
};
|
||||||
|
|
||||||
|
try {
|
||||||
|
const res = await apiCall.getStartCredit(stateData);
|
||||||
|
if (res.data.internal_return < 0) {
|
||||||
|
props.setInputError("An Error Occurred");
|
||||||
|
throw new Error("An Error Occurred");
|
||||||
|
}
|
||||||
|
|
||||||
|
const _response = res.data;
|
||||||
|
stateData.amount = Number(props.input);
|
||||||
|
stateData.card =
|
||||||
|
tab === "previous" ? prevCardDetails["payment-card"] : { ...values };
|
||||||
|
stateData.cardType = tab === "previous" ? "prev" : "new";
|
||||||
|
stateData = { ...stateData, ..._response };
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
props.setConfirmCredit({
|
||||||
|
show: {
|
||||||
|
awaitConfirm: { loader: false, state: true },
|
||||||
|
acceptConfirm: { loader: false, state: false },
|
||||||
|
},
|
||||||
|
data: stateData,
|
||||||
|
});
|
||||||
|
}, 1500);
|
||||||
|
} catch (error) {
|
||||||
|
props.setInputError(error.message);
|
||||||
|
setTimeout(() => props.setInputError(""), 5000);
|
||||||
|
props.setConfirmCredit((prev) => ({
|
||||||
|
...prev,
|
||||||
|
show: { awaitConfirm: { loader: false } },
|
||||||
|
}));
|
||||||
|
console.log(error);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -208,8 +252,8 @@ function AddFundDollars(props) {
|
|||||||
{/* END OF switch button */}
|
{/* END OF switch button */}
|
||||||
|
|
||||||
{/* previous tab */}
|
{/* previous tab */}
|
||||||
{tab === "previous" ? (
|
{tab === "previous" && (
|
||||||
<div className="p-4 previous-details w-full min-h-[16rem] flex flex-col justify-between items-center">
|
<div className="p-4 previous-details w-full min-h-[16rem] flex flex-col">
|
||||||
{payListCards.loading ? (
|
{payListCards.loading ? (
|
||||||
<LoadingSpinner size="10" color="sky-blue" />
|
<LoadingSpinner size="10" color="sky-blue" />
|
||||||
) : payListCards?.data?.length ? (
|
) : payListCards?.data?.length ? (
|
||||||
@@ -254,8 +298,13 @@ function AddFundDollars(props) {
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
<p className="text-base italic text-red-500 h-5">
|
||||||
|
{prevCardError && prevCardError}
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
) : (
|
)}
|
||||||
|
|
||||||
|
{tab === "new" && (
|
||||||
<div className="new-details w-full max-h-[23rem]">
|
<div className="new-details w-full max-h-[23rem]">
|
||||||
<div className="w-full flex flex-col justify-between">
|
<div className="w-full flex flex-col justify-between">
|
||||||
<Formik
|
<Formik
|
||||||
@@ -284,17 +333,21 @@ function AddFundDollars(props) {
|
|||||||
<InputCom
|
<InputCom
|
||||||
fieldClass="px-6"
|
fieldClass="px-6"
|
||||||
spanTag="*"
|
spanTag="*"
|
||||||
iconName="master-card visa-card atm-card"
|
iconName={cardIcons}
|
||||||
label="Card Number"
|
label="Card Number"
|
||||||
type="text"
|
type="text"
|
||||||
name="cardNum"
|
name="cardNum"
|
||||||
|
onInput={handleCards}
|
||||||
placeholder="Enter Card Number"
|
placeholder="Enter Card Number"
|
||||||
value={props.values.cardNum}
|
value={handleCardNumberChange(
|
||||||
|
props.values.cardNum
|
||||||
|
)}
|
||||||
inputHandler={props.handleChange}
|
inputHandler={props.handleChange}
|
||||||
blurHandler={props.handleBlur}
|
blurHandler={props.handleBlur}
|
||||||
error={props.errors.cardNum}
|
error={props.errors.cardNum}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Expire Year, Year */}
|
{/* Expire Year, Year */}
|
||||||
<div className="sm:grid gap-5 grid-cols-2 flex-[0.4]">
|
<div className="sm:grid gap-5 grid-cols-2 flex-[0.4]">
|
||||||
<div className="field w-full mb-6 xl:mb-0 col-span-1">
|
<div className="field w-full mb-6 xl:mb-0 col-span-1">
|
||||||
@@ -335,7 +388,11 @@ function AddFundDollars(props) {
|
|||||||
expireMonth.map((item, index) => (
|
expireMonth.map((item, index) => (
|
||||||
<option
|
<option
|
||||||
key={index}
|
key={index}
|
||||||
value={item.value}
|
value={
|
||||||
|
Number(item.value) < 10
|
||||||
|
? "0" + item.value
|
||||||
|
: item.value
|
||||||
|
}
|
||||||
>
|
>
|
||||||
{item.name}
|
{item.name}
|
||||||
</option>
|
</option>
|
||||||
@@ -344,6 +401,7 @@ function AddFundDollars(props) {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="field w-full mb-6 xl:mb-0 col-span-1">
|
<div className="field w-full mb-6 xl:mb-0 col-span-1">
|
||||||
<div className="select-option">
|
<div className="select-option">
|
||||||
<div
|
<div
|
||||||
@@ -391,18 +449,19 @@ function AddFundDollars(props) {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{/* Address and CVV */}
|
||||||
<div className="flex items-center flex-1 gap-3 my-2">
|
<div className="flex items-center flex-1 gap-3 my-2">
|
||||||
{/* Address and CVV */}
|
|
||||||
<div className="field w-full col-span-1 flex-[0.4]">
|
<div className="field w-full col-span-1 flex-[0.4]">
|
||||||
<InputCom
|
<InputCom
|
||||||
fieldClass="px-6"
|
fieldClass="px-6"
|
||||||
spanTag="*"
|
spanTag="*"
|
||||||
iconName="atm-card"
|
iconName={cardIcons}
|
||||||
label="CVV"
|
label="CVV"
|
||||||
type="text"
|
type="text"
|
||||||
name="cvv"
|
name="cvv"
|
||||||
placeholder="CVV"
|
placeholder="CVV"
|
||||||
value={props.values.cvv}
|
maxLength={3}
|
||||||
|
value={props.values.cvv.replace(/./g, "*")}
|
||||||
inputHandler={props.handleChange}
|
inputHandler={props.handleChange}
|
||||||
blurHandler={props.handleBlur}
|
blurHandler={props.handleBlur}
|
||||||
error={props.errors.cvv}
|
error={props.errors.cvv}
|
||||||
@@ -431,10 +490,11 @@ function AddFundDollars(props) {
|
|||||||
fieldClass="px-6"
|
fieldClass="px-6"
|
||||||
spanTag="*"
|
spanTag="*"
|
||||||
label="Postal Code"
|
label="Postal Code"
|
||||||
type="text"
|
type="number"
|
||||||
name="code"
|
name="code"
|
||||||
placeholder="Postal Code"
|
placeholder="Postal Code"
|
||||||
value={props.values.code}
|
value={props.values.code}
|
||||||
|
maxLength={6}
|
||||||
inputHandler={props.handleChange}
|
inputHandler={props.handleChange}
|
||||||
blurHandler={props.handleBlur}
|
blurHandler={props.handleBlur}
|
||||||
error={props.errors.code}
|
error={props.errors.code}
|
||||||
@@ -448,7 +508,7 @@ function AddFundDollars(props) {
|
|||||||
type="text"
|
type="text"
|
||||||
name="state"
|
name="state"
|
||||||
placeholder="State"
|
placeholder="State"
|
||||||
value={props.values.state}
|
value={props.values.state.toUpperCase()}
|
||||||
inputHandler={props.handleChange}
|
inputHandler={props.handleChange}
|
||||||
blurHandler={props.handleBlur}
|
blurHandler={props.handleBlur}
|
||||||
error={props.errors.state}
|
error={props.errors.state}
|
||||||
@@ -468,9 +528,9 @@ function AddFundDollars(props) {
|
|||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
type="submit"
|
type="submit"
|
||||||
className="px-4 py-1 h-11 max-w-[100px] w-full flex justify-center items-center btn-gradient text-base rounded-full text-white"
|
className="px-4 py-1 h-11 max-w-[115px] w-full flex justify-center items-center btn-gradient text-base rounded-full text-white"
|
||||||
>
|
>
|
||||||
{loader ? (
|
{props.confirmCredit?.show?.awaitConfirm?.loader ? (
|
||||||
<LoadingSpinner size="6" color="sky-blue" />
|
<LoadingSpinner size="6" color="sky-blue" />
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
@@ -488,6 +548,7 @@ function AddFundDollars(props) {
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{tab == "previous" && (
|
{tab == "previous" && (
|
||||||
<div className="md:py-8 px-[38px] add-fund-btn flex justify-end items-center gap-4 py-4">
|
<div className="md:py-8 px-[38px] add-fund-btn flex justify-end items-center gap-4 py-4">
|
||||||
<button
|
<button
|
||||||
@@ -498,10 +559,11 @@ function AddFundDollars(props) {
|
|||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
onClick={handleSubmit}
|
onClick={handleSubmit}
|
||||||
|
name="previous"
|
||||||
type="button"
|
type="button"
|
||||||
className="px-4 py-1 h-11 max-w-[100px] w-full flex justify-center items-center btn-gradient text-base rounded-full text-white"
|
className="px-4 py-1 h-11 max-w-[115px] w-full flex justify-center items-center btn-gradient text-base rounded-full text-white"
|
||||||
>
|
>
|
||||||
{loader ? (
|
{props.confirmCredit?.show?.awaitConfirm?.loader ? (
|
||||||
<LoadingSpinner size="6" color="sky-blue" />
|
<LoadingSpinner size="6" color="sky-blue" />
|
||||||
) : (
|
) : (
|
||||||
<span className="text-white">Continue</span>
|
<span className="text-white">Continue</span>
|
||||||
+35
-14
@@ -1,9 +1,9 @@
|
|||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
import usersService from "../../services/UsersService";
|
import usersService from "../../../services/UsersService";
|
||||||
import Icons from "../Helpers/Icons";
|
import Icons from "../../Helpers/Icons";
|
||||||
import InputCom from "../Helpers/Inputs/InputCom";
|
import InputCom from "../../Helpers/Inputs/InputCom";
|
||||||
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
import LoadingSpinner from "../../Spinners/LoadingSpinner";
|
||||||
import AddFundDollars from "./AddFundDollars";
|
import AddFundDollars from "./AddFundDollars";
|
||||||
|
|
||||||
function AddFundPop({
|
function AddFundPop({
|
||||||
@@ -11,6 +11,7 @@ function AddFundPop({
|
|||||||
input,
|
input,
|
||||||
setInput,
|
setInput,
|
||||||
onClose,
|
onClose,
|
||||||
|
confirmCredit,
|
||||||
setConfirmCredit,
|
setConfirmCredit,
|
||||||
walletItem,
|
walletItem,
|
||||||
}) {
|
}) {
|
||||||
@@ -20,7 +21,7 @@ function AddFundPop({
|
|||||||
const { payment, currency } = _payment;
|
const { payment, currency } = _payment;
|
||||||
|
|
||||||
const [inputError, setInputError] = useState("");
|
const [inputError, setInputError] = useState("");
|
||||||
const [loader, setLoader] = useState(false);
|
let __awaitComponent = confirmCredit.show.awaitConfirm;
|
||||||
|
|
||||||
const handleChange = ({ target: { name, value } }) => {
|
const handleChange = ({ target: { name, value } }) => {
|
||||||
setInput(value);
|
setInput(value);
|
||||||
@@ -28,17 +29,26 @@ function AddFundPop({
|
|||||||
|
|
||||||
const handleSubmit = async () => {
|
const handleSubmit = async () => {
|
||||||
setInputError("");
|
setInputError("");
|
||||||
setLoader(true);
|
setConfirmCredit((prev) => ({
|
||||||
|
...prev,
|
||||||
|
show: { awaitConfirm: { loader: true } },
|
||||||
|
}));
|
||||||
|
|
||||||
if (!input || input === "0") {
|
if (!input || input === "0") {
|
||||||
setLoader(false);
|
setConfirmCredit((prev) => ({
|
||||||
|
...prev,
|
||||||
|
show: { awaitConfirm: { loader: false } },
|
||||||
|
}));
|
||||||
setInputError("Please Enter Amount");
|
setInputError("Please Enter Amount");
|
||||||
setTimeout(() => setInputError(""), 5000);
|
setTimeout(() => setInputError(""), 5000);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isNaN(input)) {
|
if (isNaN(input)) {
|
||||||
setLoader(false);
|
setConfirmCredit((prev) => ({
|
||||||
|
...prev,
|
||||||
|
show: { awaitConfirm: { loader: false } },
|
||||||
|
}));
|
||||||
setInputError("Amount must be a Number");
|
setInputError("Amount must be a Number");
|
||||||
setTimeout(() => setInputError(""), 5000);
|
setTimeout(() => setInputError(""), 5000);
|
||||||
return;
|
return;
|
||||||
@@ -52,7 +62,10 @@ function AddFundPop({
|
|||||||
try {
|
try {
|
||||||
const res = await apiCall.getStartCredit(stateData);
|
const res = await apiCall.getStartCredit(stateData);
|
||||||
if (res.data.internal_return < 0) {
|
if (res.data.internal_return < 0) {
|
||||||
setLoader(false);
|
setConfirmCredit((prev) => ({
|
||||||
|
...prev,
|
||||||
|
show: { awaitConfirm: { loader: false } },
|
||||||
|
}));
|
||||||
setInputError("An Error Occurred");
|
setInputError("An Error Occurred");
|
||||||
setTimeout(() => setInputError(""), 5000);
|
setTimeout(() => setInputError(""), 5000);
|
||||||
return;
|
return;
|
||||||
@@ -64,13 +77,20 @@ function AddFundPop({
|
|||||||
stateData = { ...stateData, ..._response };
|
stateData = { ...stateData, ..._response };
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
setLoader(false);
|
setConfirmCredit((prev) => ({
|
||||||
setConfirmCredit({
|
...prev,
|
||||||
show: true,
|
show: {
|
||||||
|
awaitConfirm: { loader: false, state: true },
|
||||||
|
acceptConfirm: { loader: false, state: false },
|
||||||
|
},
|
||||||
data: stateData,
|
data: stateData,
|
||||||
});
|
}));
|
||||||
}, 1500);
|
}, 1500);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
setConfirmCredit((prev) => ({
|
||||||
|
...prev,
|
||||||
|
show: { awaitConfirm: { loader: false } },
|
||||||
|
}));
|
||||||
console.log(error);
|
console.log(error);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -108,6 +128,7 @@ function AddFundPop({
|
|||||||
setInput={setInput}
|
setInput={setInput}
|
||||||
currency={currency}
|
currency={currency}
|
||||||
onClose={onClose}
|
onClose={onClose}
|
||||||
|
confirmCredit={confirmCredit}
|
||||||
setConfirmCredit={setConfirmCredit}
|
setConfirmCredit={setConfirmCredit}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@@ -128,7 +149,7 @@ function AddFundPop({
|
|||||||
type="button"
|
type="button"
|
||||||
className="px-4 py-1 h-11 flex justify-center space-x-1 items-center btn-gradient text-base rounded-full text-white max-w-[100px] w-full"
|
className="px-4 py-1 h-11 flex justify-center space-x-1 items-center btn-gradient text-base rounded-full text-white max-w-[100px] w-full"
|
||||||
>
|
>
|
||||||
{loader ? (
|
{__awaitComponent.loader ? (
|
||||||
<LoadingSpinner size="6" color="sky-blue" />
|
<LoadingSpinner size="6" color="sky-blue" />
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
@@ -0,0 +1,114 @@
|
|||||||
|
import React from "react";
|
||||||
|
|
||||||
|
function CompleteConfirmCredit({ onClose, confirmCredit }) {
|
||||||
|
const { data } = confirmCredit;
|
||||||
|
return (
|
||||||
|
<div className="logout-modal-body w-full flex flex-col items-center">
|
||||||
|
<div className="content-wrapper w-full h-[32rem]">
|
||||||
|
<div className="w-full mb-10">
|
||||||
|
<div className="add-fund w-full bg-white dark:bg-dark-white rounded-2xl">
|
||||||
|
<div className="px-4 md:p-8 py-4 add-fund-info">
|
||||||
|
<div className="field w-full mb-3 min-h-[45px]">
|
||||||
|
<div
|
||||||
|
className={`flex flex-col gap-4 ${
|
||||||
|
data?.result !== "Charge success" &&
|
||||||
|
"h-[328px] items-center justify-center"
|
||||||
|
}`}
|
||||||
|
>
|
||||||
|
{/* Success Icon for now */}
|
||||||
|
<div className="flex items-center w-full justify-center">
|
||||||
|
{data?.result == "Charge success" ? (
|
||||||
|
<svg
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
width="100"
|
||||||
|
height="100"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
fill="none"
|
||||||
|
stroke="green"
|
||||||
|
stroke-width="2"
|
||||||
|
stroke-linecap="round"
|
||||||
|
stroke-linejoin="round"
|
||||||
|
className="feather feather-check-circle"
|
||||||
|
>
|
||||||
|
<path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"></path>
|
||||||
|
<polyline points="22 4 12 14.01 9 11.01"></polyline>
|
||||||
|
</svg>
|
||||||
|
) : (
|
||||||
|
<svg
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
fill="none"
|
||||||
|
width="100"
|
||||||
|
height="100"
|
||||||
|
stroke="red"
|
||||||
|
stroke-width="2"
|
||||||
|
stroke-linecap="round"
|
||||||
|
stroke-linejoin="round"
|
||||||
|
className="feather feather-x-circle"
|
||||||
|
>
|
||||||
|
<circle cx="12" cy="12" r="10"></circle>
|
||||||
|
<line x1="15" y1="9" x2="9" y2="15"></line>
|
||||||
|
<line x1="9" y1="9" x2="15" y2="15"></line>
|
||||||
|
</svg>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className={`flex items-center`}>
|
||||||
|
<h1 className="text-xl font-semibold text-dark-gray dark:text-white tracking-tighter my-1">
|
||||||
|
{data?.result == "Charge success"
|
||||||
|
? "Credit was Successful!"
|
||||||
|
: "Credit was Unsuccessful"}
|
||||||
|
</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{data?.internal_return >= 0 ? (
|
||||||
|
<>
|
||||||
|
<div className="flex items-center gap-8">
|
||||||
|
<h1 className="text-xl font-bold text-dark-gray dark:text-white tracking-tighter my-1">
|
||||||
|
Amount({data?.currency || ""})
|
||||||
|
</h1>
|
||||||
|
<span className="text-xl font-bold text-dark-gray dark:text-white tracking-tighter my-1">
|
||||||
|
{`${data?.symbol || ""} ${
|
||||||
|
Number(data?.amount * 0.01).toLocaleString() || ""
|
||||||
|
}`}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="flex items-center gap-8">
|
||||||
|
<h1 className="text-xl font-bold text-dark-gray dark:text-white tracking-tighter my-1">
|
||||||
|
Wallet Balance
|
||||||
|
</h1>
|
||||||
|
<span className="text-xl font-bold text-dark-gray dark:text-white tracking-tighter my-1">
|
||||||
|
{data?.curr_balance}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="flex items-center gap-8">
|
||||||
|
<h1 className="text-xl font-bold text-dark-gray dark:text-white tracking-tighter my-1">
|
||||||
|
Confirmation Number
|
||||||
|
</h1>
|
||||||
|
<span className="text-xl font-bold text-dark-gray dark:text-white tracking-tighter my-1">
|
||||||
|
{data?.confirmation}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
) : null}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="md:p-8 p-4 add-fund-btn flex justify-end items-center py-4 gap-4">
|
||||||
|
<button
|
||||||
|
className="px-4 h-11 flex justify-center items-center btn-gradient text-white text-base rounded-full w-[100px]"
|
||||||
|
onClick={onClose}
|
||||||
|
>
|
||||||
|
Ok
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default CompleteConfirmCredit;
|
||||||
@@ -0,0 +1,380 @@
|
|||||||
|
import { FlutterWaveButton, closePaymentModal } from "flutterwave-react-v3";
|
||||||
|
import React, { useState } from "react";
|
||||||
|
import { useNavigate } from "react-router-dom";
|
||||||
|
import { toast } from "react-toastify";
|
||||||
|
import usersService from "../../../services/UsersService";
|
||||||
|
import LoadingSpinner from "../../Spinners/LoadingSpinner";
|
||||||
|
|
||||||
|
function ThePaymentText({ value, type }) {
|
||||||
|
const cardDetails = value;
|
||||||
|
value.description =
|
||||||
|
type === "new"
|
||||||
|
? cardDetails.cardNum[0] === "4"
|
||||||
|
? "Visa"
|
||||||
|
: cardDetails.cardNum[0] == "5"
|
||||||
|
? "Master"
|
||||||
|
: "ATM"
|
||||||
|
: value.description;
|
||||||
|
value.digits = type === "new" ? cardDetails.cardNum.slice(-4) : value.digits;
|
||||||
|
return (
|
||||||
|
<div className="my-2 flex items-center gap-5">
|
||||||
|
<div className="card-details flex items-center gap-3">
|
||||||
|
<h1 className="text-xl font-bold text-dark-gray dark:text-white tracking-tighter my-1 space-x-1">
|
||||||
|
{value.description} Card
|
||||||
|
</h1>
|
||||||
|
<p className="text-base font-bold text-dark-gray dark:text-white tracking-wide">
|
||||||
|
Bank **************{value.digits}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function AmountSection({ currency, amount, country }) {
|
||||||
|
const formattedAmount = Number(amount).toFixed(2);
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
className={`flex items-center ${country == "US" ? "gap-14" : "gap-4"}`}
|
||||||
|
>
|
||||||
|
<h1 className="text-xl font-bold text-dark-gray dark:text-white tracking-tighter my-1">
|
||||||
|
Amount({currency})
|
||||||
|
</h1>
|
||||||
|
<span className="text-xl font-bold text-dark-gray dark:text-white tracking-tighter my-1">
|
||||||
|
{formattedAmount}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function TransactionFeeSection({ currency, fee, country }) {
|
||||||
|
const formattedFee = Number(fee).toFixed(2);
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
className={`flex items-center border-b border-gray-600 ${
|
||||||
|
country == "US" ? "gap-[2.7rem]" : "gap-4"
|
||||||
|
}`}
|
||||||
|
>
|
||||||
|
<h1 className="text-xl font-bold text-dark-gray dark:text-white tracking-tighter my-1">
|
||||||
|
Transaction Fee
|
||||||
|
</h1>
|
||||||
|
<span className="text-xl font-bold text-dark-gray dark:text-white tracking-tighter my-1">
|
||||||
|
{formattedFee}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function TotalSection({ currency, amount, fee, country }) {
|
||||||
|
const total = Number(amount) + Number(fee);
|
||||||
|
const formattedTotal = total.toFixed(2);
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
className={`flex items-center ${
|
||||||
|
country == "US" ? "gap-[8rem]" : "gap-[6.3rem]"
|
||||||
|
}`}
|
||||||
|
>
|
||||||
|
<h1 className="text-xl font-bold text-dark-gray dark:text-white tracking-tighter my-1">
|
||||||
|
Total
|
||||||
|
</h1>
|
||||||
|
<span className="text-xl font-bold text-dark-gray dark:text-white tracking-tighter my-1">
|
||||||
|
{formattedTotal}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function ConfirmAddFund({
|
||||||
|
confirmCredit,
|
||||||
|
onClose,
|
||||||
|
walletItem,
|
||||||
|
setConfirmCredit,
|
||||||
|
}) {
|
||||||
|
const __confirmData = confirmCredit?.data;
|
||||||
|
const __confirmCountry = walletItem?.country;
|
||||||
|
const __confirmCardDetails =
|
||||||
|
__confirmData.cardType === "prev"
|
||||||
|
? JSON.parse(__confirmData.card)
|
||||||
|
: __confirmData.card;
|
||||||
|
|
||||||
|
const apiURL = new usersService();
|
||||||
|
const navigate = useNavigate();
|
||||||
|
|
||||||
|
const [requestStatus, setRequestStatus] = useState({
|
||||||
|
message: "",
|
||||||
|
loading: false,
|
||||||
|
status: false,
|
||||||
|
});
|
||||||
|
|
||||||
|
const config = {
|
||||||
|
public_key: process.env.REACT_APP_FLUTTERWAVE_APIKEY,
|
||||||
|
tx_ref: Date.now(),
|
||||||
|
currency: "NGN",
|
||||||
|
payment_options: "card,mobilemoney,ussd",
|
||||||
|
customizations: {
|
||||||
|
title: "WrenchBoard",
|
||||||
|
description: "Topup Payment",
|
||||||
|
logo: "https://st2.depositphotos.com/4403291/7418/v/450/depositphotos_74189661-stock-illustration-online-shop-log.jpg",
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
const fwConfig = {
|
||||||
|
...config,
|
||||||
|
text: "Proceed",
|
||||||
|
callback: (response) => {
|
||||||
|
onSuccessPayment();
|
||||||
|
closePaymentModal();
|
||||||
|
},
|
||||||
|
onClose: () => {},
|
||||||
|
};
|
||||||
|
|
||||||
|
const onSuccessPayment = () => {
|
||||||
|
setRequestStatus({ message: "", loading: true, status: false });
|
||||||
|
const reqData = { amount: __confirmData?.account, currency: "NGN" };
|
||||||
|
|
||||||
|
apiURL
|
||||||
|
.startTopUp(reqData)
|
||||||
|
.then((res) => {
|
||||||
|
if (res.data.internal_return < 0) {
|
||||||
|
setRequestStatus({
|
||||||
|
message: "Could not finish transaction",
|
||||||
|
loading: false,
|
||||||
|
status: false,
|
||||||
|
});
|
||||||
|
toast.success("Opps! something went wrong");
|
||||||
|
} else {
|
||||||
|
setRequestStatus({
|
||||||
|
message: "Topup successful",
|
||||||
|
loading: false,
|
||||||
|
status: true,
|
||||||
|
});
|
||||||
|
toast.success("Account Topup was successful");
|
||||||
|
setTimeout(() => {
|
||||||
|
navigate("/my-wallet", { replace: true });
|
||||||
|
}, 1000);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
setRequestStatus({
|
||||||
|
message: "Opps! An Error Occured",
|
||||||
|
loading: false,
|
||||||
|
status: false,
|
||||||
|
});
|
||||||
|
toast.success("Opps! something went wrong");
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const handlePrevCard = async () => {
|
||||||
|
const { amount, credit_reference, currency } = __confirmData;
|
||||||
|
const { card_uid } = __confirmCardDetails;
|
||||||
|
|
||||||
|
const reqData = {
|
||||||
|
amount: amount * 100,
|
||||||
|
card_uid,
|
||||||
|
credit_reference,
|
||||||
|
currency,
|
||||||
|
};
|
||||||
|
|
||||||
|
try {
|
||||||
|
setConfirmCredit((prev) => ({
|
||||||
|
...prev,
|
||||||
|
show: {
|
||||||
|
acceptConfirm: { loader: true },
|
||||||
|
},
|
||||||
|
}));
|
||||||
|
const res = await apiURL.getPaidPrevCard(reqData);
|
||||||
|
const _response = res.data;
|
||||||
|
if (res.data.internal_return < 0) {
|
||||||
|
setConfirmCredit((prev) => ({
|
||||||
|
...prev,
|
||||||
|
show: {
|
||||||
|
acceptConfirm: { loader: false },
|
||||||
|
},
|
||||||
|
}));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
setConfirmCredit((prev) => ({
|
||||||
|
...prev,
|
||||||
|
show: {
|
||||||
|
awaitConfirm: { loader: false, state: false },
|
||||||
|
acceptConfirm: { loader: false, state: true },
|
||||||
|
},
|
||||||
|
data: _response,
|
||||||
|
}));
|
||||||
|
}, 1500);
|
||||||
|
} catch (error) {
|
||||||
|
setConfirmCredit((prev) => ({
|
||||||
|
...prev,
|
||||||
|
show: {
|
||||||
|
acceptConfirm: { loader: false },
|
||||||
|
},
|
||||||
|
}));
|
||||||
|
console.log(error);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleNewCard = async () => {
|
||||||
|
const { amount, credit_reference, uid } = __confirmData;
|
||||||
|
const { address, cardNum, cvv, expirationMonth, expirationYear } =
|
||||||
|
__confirmCardDetails;
|
||||||
|
|
||||||
|
const reqData = {
|
||||||
|
amount: amount * 100,
|
||||||
|
cardnumber: cardNum.replace(/\s/g, ""),
|
||||||
|
credit_reference,
|
||||||
|
cvc: cvv,
|
||||||
|
description: address,
|
||||||
|
exp_month: expirationMonth,
|
||||||
|
exp_year: expirationYear,
|
||||||
|
paymenttype: 100,
|
||||||
|
uid,
|
||||||
|
};
|
||||||
|
|
||||||
|
try {
|
||||||
|
setConfirmCredit((prev) => ({
|
||||||
|
...prev,
|
||||||
|
show: {
|
||||||
|
acceptConfirm: { loader: true },
|
||||||
|
},
|
||||||
|
}));
|
||||||
|
const res = await apiURL.getPaidNewCard(reqData);
|
||||||
|
const _response = res.data;
|
||||||
|
if (res.data.internal_return < 0) {
|
||||||
|
setConfirmCredit((prev) => ({
|
||||||
|
...prev,
|
||||||
|
show: {
|
||||||
|
awaitConfirm: { loader: false, state: false },
|
||||||
|
acceptConfirm: { loader: false, state: true },
|
||||||
|
},
|
||||||
|
data: _response,
|
||||||
|
}));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
setConfirmCredit((prev) => ({
|
||||||
|
...prev,
|
||||||
|
show: {
|
||||||
|
awaitConfirm: { loader: false, state: false },
|
||||||
|
acceptConfirm: { loader: false, state: true },
|
||||||
|
},
|
||||||
|
data: _response,
|
||||||
|
}));
|
||||||
|
}, 1500);
|
||||||
|
} catch (error) {
|
||||||
|
setConfirmCredit((prev) => ({
|
||||||
|
...prev,
|
||||||
|
show: {
|
||||||
|
acceptConfirm: { loader: false },
|
||||||
|
},
|
||||||
|
}));
|
||||||
|
setTimeout(() => onClose, 10000);
|
||||||
|
console.log(error);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
console.log(confirmCredit?.data);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="content-wrapper w-full h-[32rem]">
|
||||||
|
<div className="w-full mb-10">
|
||||||
|
<div className="add-fund w-full bg-white dark:bg-dark-white rounded-2xl">
|
||||||
|
<div className="px-4 md:p-8 py-4 add-fund-info">
|
||||||
|
<div className="field w-full mb-3 min-h-[45px]">
|
||||||
|
{confirmCredit?.show?.awaitConfirm?.state && (
|
||||||
|
<div className="flex flex-col gap-2">
|
||||||
|
<AmountSection
|
||||||
|
currency={__confirmData?.currency}
|
||||||
|
amount={__confirmData?.amount}
|
||||||
|
country={__confirmCountry}
|
||||||
|
/>
|
||||||
|
<TransactionFeeSection
|
||||||
|
currency={__confirmData?.currency}
|
||||||
|
fee={__confirmData?.fee}
|
||||||
|
country={__confirmCountry}
|
||||||
|
/>
|
||||||
|
<TotalSection
|
||||||
|
currency={__confirmData?.currency}
|
||||||
|
amount={__confirmData?.amount}
|
||||||
|
fee={__confirmData?.fee}
|
||||||
|
country={__confirmCountry}
|
||||||
|
/>
|
||||||
|
{__confirmCountry === "US" && (
|
||||||
|
<div className="flex items-center gap-8">
|
||||||
|
<label
|
||||||
|
htmlFor="payment"
|
||||||
|
className="text-xl font-bold text-dark-gray dark:text-white tracking-tighter my-1"
|
||||||
|
>
|
||||||
|
Payment Method
|
||||||
|
</label>
|
||||||
|
<span className="text-[#181c32] dark:text-white">
|
||||||
|
<ThePaymentText
|
||||||
|
value={__confirmCardDetails}
|
||||||
|
type={__confirmData?.cardType}
|
||||||
|
/>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
<div
|
||||||
|
className={`${
|
||||||
|
__confirmCountry === "US"
|
||||||
|
? "gap-[3.7rem]"
|
||||||
|
: "gap-[1.81rem]"
|
||||||
|
} flex items-center`}
|
||||||
|
>
|
||||||
|
<h1 className="text-xl font-bold text-dark-gray dark:text-white tracking-tighter my-1">
|
||||||
|
Reference No
|
||||||
|
</h1>
|
||||||
|
<span className="text-xl font-bold text-dark-gray dark:text-white tracking-tighter my-1">
|
||||||
|
{__confirmData?.credit_reference}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div
|
||||||
|
className={
|
||||||
|
__confirmCountry === "US" ? "min-h-[96px]" : "min-h-[157px]"
|
||||||
|
}
|
||||||
|
></div>
|
||||||
|
<hr />
|
||||||
|
<div className="md:p-8 p-4 add-fund-btn flex justify-end items-center py-4 gap-4">
|
||||||
|
<button
|
||||||
|
className="px-4 h-11 flex justify-center items-center border-gradient text-base rounded-full"
|
||||||
|
onClick={onClose}
|
||||||
|
>
|
||||||
|
Cancel
|
||||||
|
</button>
|
||||||
|
{__confirmCountry === "US" && (
|
||||||
|
<button
|
||||||
|
className="px-4 h-11 flex justify-center items-center btn-gradient text-white text-base rounded-full"
|
||||||
|
onClick={
|
||||||
|
__confirmData?.cardType === "prev"
|
||||||
|
? handlePrevCard
|
||||||
|
: handleNewCard
|
||||||
|
}
|
||||||
|
>
|
||||||
|
{confirmCredit?.show?.acceptConfirm?.loader ? (
|
||||||
|
<LoadingSpinner size="6" color="sky-blue" />
|
||||||
|
) : (
|
||||||
|
"Proceed"
|
||||||
|
)}
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
|
{__confirmCountry === "NG" && (
|
||||||
|
<FlutterWaveButton
|
||||||
|
{...fwConfig}
|
||||||
|
className="px-2 py-1 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default ConfirmAddFund;
|
||||||
@@ -0,0 +1,175 @@
|
|||||||
|
import React, { useEffect, useState } from "react";
|
||||||
|
import { useNavigate } from "react-router-dom";
|
||||||
|
import { toast } from "react-toastify";
|
||||||
|
import InputCom from "../../Helpers/Inputs/InputCom";
|
||||||
|
import ModalCom from "../../Helpers/ModalCom";
|
||||||
|
import LoadingSpinner from "../../Spinners/LoadingSpinner";
|
||||||
|
|
||||||
|
import usersService from "../../../services/UsersService";
|
||||||
|
|
||||||
|
function ConfirmNairaWithdraw({ payment, wallet, action, situation, state }) {
|
||||||
|
const apiURL = new usersService();
|
||||||
|
|
||||||
|
const navigate = useNavigate();
|
||||||
|
|
||||||
|
let [requestStatus, setRequestStatus] = useState({
|
||||||
|
message: "",
|
||||||
|
loading: false,
|
||||||
|
status: false,
|
||||||
|
});
|
||||||
|
let [pageLoading, setPageLoading] = useState(true);
|
||||||
|
|
||||||
|
//FUNCTION TO HANDLE SUBMIT
|
||||||
|
const handleSubmit = () => {
|
||||||
|
setRequestStatus({ message: "", loading: true, status: false });
|
||||||
|
let reqData = {
|
||||||
|
amount: Number(state.amount * 100),
|
||||||
|
Fee: Number(state.fee),
|
||||||
|
recipientid: Number(state.recipientID),
|
||||||
|
};
|
||||||
|
apiURL
|
||||||
|
.sendMoney(reqData)
|
||||||
|
.then((res) => {
|
||||||
|
if (res.data.internal_return < 0) {
|
||||||
|
setRequestStatus({
|
||||||
|
message: "Could not perform transaction",
|
||||||
|
loading: false,
|
||||||
|
status: false,
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
setRequestStatus({
|
||||||
|
message: "transfer successful",
|
||||||
|
loading: false,
|
||||||
|
status: true,
|
||||||
|
});
|
||||||
|
toast.success("Transfer sucessful");
|
||||||
|
setTimeout(() => {
|
||||||
|
navigate("/my-wallet", { replace: true });
|
||||||
|
window.location.reload(true);
|
||||||
|
}, 1000);
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
setRequestStatus({
|
||||||
|
message: "Opps! something went wrong! Try Again",
|
||||||
|
loading: false,
|
||||||
|
status: false,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<ModalCom action={action} situation={situation}>
|
||||||
|
<div className="content-wrapper w-[90%] md:w-[600px]">
|
||||||
|
<div className="w-full">
|
||||||
|
<div className="add-fund w-full bg-white dark:bg-dark-white rounded-2xl shadow">
|
||||||
|
<div className="px-4 md:px-8 py-4">
|
||||||
|
<h2 className="my-4 py-2 text-slate-900 dark:text-white text-xl lg:text-2xl font-medium">
|
||||||
|
{`Withdraw from ${wallet.description} Wallet : ${
|
||||||
|
wallet.symbol
|
||||||
|
}${(wallet.amount * 0.01).toFixed(2)}`}
|
||||||
|
</h2>
|
||||||
|
</div>
|
||||||
|
<hr />
|
||||||
|
<div className="px-4 md:px-8 py-4 add-fund-info">
|
||||||
|
<h2 className="my-2 text-slate-900 dark:text-white text-sm xl:text-xl font-medium">
|
||||||
|
Confirm Withdraw to Account
|
||||||
|
</h2>
|
||||||
|
{/* AMOUNT */}
|
||||||
|
<div className="field w-full mb-3">
|
||||||
|
<InputCom
|
||||||
|
fieldClass="px-6"
|
||||||
|
label="Amount:"
|
||||||
|
type="text"
|
||||||
|
name="amount"
|
||||||
|
value={state?.amount || ""}
|
||||||
|
disable={true}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* RECIPIENT ACC: */}
|
||||||
|
<div className="field w-full mb-3">
|
||||||
|
<InputCom
|
||||||
|
fieldClass="px-6"
|
||||||
|
label="Recipient Acc:"
|
||||||
|
type="text"
|
||||||
|
name="recipient"
|
||||||
|
value={state?.details.recipient || ""}
|
||||||
|
disable={true}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* PROCESSING FEE: */}
|
||||||
|
<div className="field w-full mb-3">
|
||||||
|
<InputCom
|
||||||
|
fieldClass="px-6"
|
||||||
|
label="Processing Fee:"
|
||||||
|
type="text"
|
||||||
|
name="processingFee"
|
||||||
|
value={(state?.fee * 0.01).toFixed(2) || ""}
|
||||||
|
disable={true}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* TOTAL */}
|
||||||
|
<div className="field w-full mb-3">
|
||||||
|
<InputCom
|
||||||
|
fieldClass="px-6"
|
||||||
|
label="Total"
|
||||||
|
type="text"
|
||||||
|
name="total"
|
||||||
|
value={(state?.total * 0.01).toFixed(2) || ""}
|
||||||
|
disable={true}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* COMMENT/NOTE */}
|
||||||
|
<div className="field w-full mb-3">
|
||||||
|
<InputCom
|
||||||
|
fieldClass="px-6"
|
||||||
|
label="Comment/Note:"
|
||||||
|
type="text"
|
||||||
|
name="comment"
|
||||||
|
value={state?.comment || ""}
|
||||||
|
disable={true}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<hr />
|
||||||
|
{requestStatus.message && (
|
||||||
|
<p
|
||||||
|
className={`text-base ${
|
||||||
|
requestStatus.status ? "text-green-500" : "text-red-500"
|
||||||
|
} px-4 md:px-8 py-4`}
|
||||||
|
>
|
||||||
|
{requestStatus.message}
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
|
<div className="px-4 md:px-8 py-4 add-fund-btn flex justify-end items-center gap-2">
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
onClick={action}
|
||||||
|
className="border-gradient text-base tracking-wide px-4 py-2 rounded-full"
|
||||||
|
>
|
||||||
|
<span className="text-gradient">Cancel</span>
|
||||||
|
</button>
|
||||||
|
{requestStatus.loading ? (
|
||||||
|
<LoadingSpinner size="8" color="sky-blue" />
|
||||||
|
) : (
|
||||||
|
<button
|
||||||
|
onClick={handleSubmit}
|
||||||
|
className="btn-gradient text-base tracking-wide px-4 py-2 rounded-full text-white cursor-pointer"
|
||||||
|
>
|
||||||
|
Transfer
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</ModalCom>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default ConfirmNairaWithdraw;
|
||||||
+2
-2
@@ -1,8 +1,8 @@
|
|||||||
import React, { useEffect, useState } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
import { useLocation, useNavigate } from "react-router-dom";
|
import { useLocation, useNavigate } from "react-router-dom";
|
||||||
import { toast } from "react-toastify";
|
import { toast } from "react-toastify";
|
||||||
import InputCom from "../Helpers/Inputs/InputCom";
|
import InputCom from "../../Helpers/Inputs/InputCom";
|
||||||
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
import LoadingSpinner from "../../Spinners/LoadingSpinner";
|
||||||
import RecentActivityTable from "./WalletComponent/RecentActivityTable";
|
import RecentActivityTable from "./WalletComponent/RecentActivityTable";
|
||||||
|
|
||||||
import usersService from "../../services/UsersService";
|
import usersService from "../../services/UsersService";
|
||||||
@@ -1,39 +1,20 @@
|
|||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { useLocation } from "react-router-dom";
|
|
||||||
import usersService from "../../../services/UsersService";
|
|
||||||
import ModalCom from "../../Helpers/ModalCom";
|
import ModalCom from "../../Helpers/ModalCom";
|
||||||
import AddFundPop from "../AddFundPop";
|
import LoadingSpinner from "../../Spinners/LoadingSpinner";
|
||||||
import ConfirmAddFund from "../ConfirmAddFund";
|
import AddFundPop from "./AddFundPop";
|
||||||
|
import CompleteConfirmCredit from "./CompleteConfirmCredit";
|
||||||
|
import ConfirmAddFund from "./ConfirmAddFund";
|
||||||
|
|
||||||
const CreditPopup = ({ details, onClose, situation, walletItem }) => {
|
const CreditPopup = ({ details, onClose, situation, walletItem }) => {
|
||||||
const { pathname, state } = useLocation();
|
|
||||||
const [submitTask, setSubmitTask] = useState({
|
|
||||||
loading: false,
|
|
||||||
msg: "",
|
|
||||||
state: "",
|
|
||||||
});
|
|
||||||
const [suggestedNextStep, setSuggestedNextStep] = useState("Send Task");
|
|
||||||
let [input, setInput] = useState("");
|
let [input, setInput] = useState("");
|
||||||
const [confirmCredit, setConfirmCredit] = useState({
|
const [confirmCredit, setConfirmCredit] = useState({
|
||||||
show: false,
|
show: {
|
||||||
|
awaitConfirm: { loader: false, state: false },
|
||||||
|
acceptConfirm: { loader: false, state: false },
|
||||||
|
},
|
||||||
data: {},
|
data: {},
|
||||||
});
|
});
|
||||||
|
|
||||||
const switchNextStep = ({ target: value }) => {
|
|
||||||
setSuggestedNextStep(value);
|
|
||||||
};
|
|
||||||
|
|
||||||
const apiCall = new usersService();
|
|
||||||
|
|
||||||
const handleParentSuggestion = (values) => {
|
|
||||||
if (suggestedNextStep == "Send Task") {
|
|
||||||
let firstName = state?.firstname;
|
|
||||||
let family_uid = state?.family_uid;
|
|
||||||
// continuePopupData({ ...details, firstName, family_uid });
|
|
||||||
}
|
|
||||||
onClose();
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ModalCom
|
<ModalCom
|
||||||
action={onClose}
|
action={onClose}
|
||||||
@@ -43,7 +24,20 @@ const CreditPopup = ({ details, onClose, situation, walletItem }) => {
|
|||||||
<div className="logout-modal-wrapper lw-[90%] md:w-[768px] h-full lg:h-auto bg-white dark:bg-dark-white lg:rounded-2xl overflow-y-auto">
|
<div className="logout-modal-wrapper lw-[90%] md:w-[768px] h-full lg:h-auto bg-white dark:bg-dark-white lg:rounded-2xl overflow-y-auto">
|
||||||
<div className="logout-modal-header w-full flex items-center justify-between lg:p-6 px-[30px] py-[23px] border-b dark:border-[#5356fb29] border-light-purple">
|
<div className="logout-modal-header w-full flex items-center justify-between lg:p-6 px-[30px] py-[23px] border-b dark:border-[#5356fb29] border-light-purple">
|
||||||
<h1 className="text-26 font-bold text-dark-gray dark:text-white tracking-wide">
|
<h1 className="text-26 font-bold text-dark-gray dark:text-white tracking-wide">
|
||||||
{!confirmCredit.show ? "Add Credit" : "Confirm Credit Add"}
|
{confirmCredit?.show?.acceptConfirm?.state &&
|
||||||
|
confirmCredit?.data?.internal_return < 0 ? (
|
||||||
|
"Credit Unsuccessful"
|
||||||
|
) : (
|
||||||
|
<>
|
||||||
|
{confirmCredit?.show?.acceptConfirm?.loader
|
||||||
|
? "Confirming Credit..."
|
||||||
|
: confirmCredit?.show?.awaitConfirm?.state
|
||||||
|
? "Confirm Credit Add"
|
||||||
|
: confirmCredit?.show?.acceptConfirm?.state
|
||||||
|
? "Credit Add Completed"
|
||||||
|
: "Add Credit"}
|
||||||
|
</>
|
||||||
|
)}
|
||||||
</h1>
|
</h1>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
@@ -72,22 +66,37 @@ const CreditPopup = ({ details, onClose, situation, walletItem }) => {
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div className="logout-modal-body w-full flex flex-col items-center">
|
<div className="logout-modal-body w-full flex flex-col items-center">
|
||||||
{confirmCredit.show ? (
|
{confirmCredit?.show?.acceptConfirm?.loader ? (
|
||||||
<ConfirmAddFund
|
<div className="h-[32rem] flex items-center justify-center">
|
||||||
confirmCredit={confirmCredit}
|
<LoadingSpinner size="12" color="sky-blue" />
|
||||||
walletItem={walletItem}
|
</div>
|
||||||
onClose={onClose}
|
|
||||||
/>
|
|
||||||
) : (
|
) : (
|
||||||
<AddFundPop
|
<>
|
||||||
_payment={details}
|
{confirmCredit?.show?.awaitConfirm?.state ? (
|
||||||
walletItem={walletItem}
|
<ConfirmAddFund
|
||||||
input={input}
|
confirmCredit={confirmCredit}
|
||||||
setInput={setInput}
|
setConfirmCredit={setConfirmCredit}
|
||||||
onClose={onClose}
|
walletItem={walletItem}
|
||||||
confirmCredit={confirmCredit}
|
onClose={onClose}
|
||||||
setConfirmCredit={setConfirmCredit}
|
/>
|
||||||
/>
|
) : confirmCredit?.show?.acceptConfirm?.state ? (
|
||||||
|
<CompleteConfirmCredit
|
||||||
|
walletItem={walletItem}
|
||||||
|
confirmCredit={confirmCredit}
|
||||||
|
onClose={onClose}
|
||||||
|
/>
|
||||||
|
) : (
|
||||||
|
<AddFundPop
|
||||||
|
_payment={details}
|
||||||
|
walletItem={walletItem}
|
||||||
|
input={input}
|
||||||
|
setInput={setInput}
|
||||||
|
onClose={onClose}
|
||||||
|
confirmCredit={confirmCredit}
|
||||||
|
setConfirmCredit={setConfirmCredit}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -0,0 +1,321 @@
|
|||||||
|
import React, { useEffect, useState } from "react";
|
||||||
|
import { Link, useNavigate } from "react-router-dom";
|
||||||
|
import InputCom from "../../Helpers/Inputs/InputCom";
|
||||||
|
import LoadingSpinner from "../../Spinners/LoadingSpinner";
|
||||||
|
import ModalCom from "../../Helpers/ModalCom";
|
||||||
|
|
||||||
|
import usersService from "../../../services/UsersService";
|
||||||
|
|
||||||
|
import { Form, Formik } from "formik";
|
||||||
|
import * as Yup from "yup";
|
||||||
|
|
||||||
|
const validationSchema = Yup.object().shape({
|
||||||
|
amount: Yup.number()
|
||||||
|
.typeError("you must specify a number")
|
||||||
|
.min(1, "Amount must be greater than 0")
|
||||||
|
.required("Amount is required"),
|
||||||
|
recipientID: Yup.string()
|
||||||
|
.min(1, "Minimum 1 characters")
|
||||||
|
.max(50, "Maximum 50 characters")
|
||||||
|
.required("Recipient is required"),
|
||||||
|
});
|
||||||
|
|
||||||
|
const initialValues = {
|
||||||
|
amount: "",
|
||||||
|
recipientID: "",
|
||||||
|
comment: "",
|
||||||
|
};
|
||||||
|
|
||||||
|
function NairaWithdraw({ wallet, action, situation, setShowConfirmNairaWithdraw }) {
|
||||||
|
const apiCall = new usersService(); // API CLASS CALL
|
||||||
|
const navigate = useNavigate();
|
||||||
|
|
||||||
|
let [requestStatus, setRequestStatus] = useState(false);
|
||||||
|
|
||||||
|
let [recipients, setRecipients] = useState({
|
||||||
|
// FOR COUPON HISTORY
|
||||||
|
loading: true,
|
||||||
|
data: [],
|
||||||
|
error: false,
|
||||||
|
});
|
||||||
|
|
||||||
|
let [sendMoneyFee, setSendMoneyFee] = useState({
|
||||||
|
loading: false,
|
||||||
|
fee: 0,
|
||||||
|
total: 0,
|
||||||
|
}); // HOLD THE VALUE FOR walletSEND MONEY FEE
|
||||||
|
|
||||||
|
//FUNCTION TO GET RECIPIENT LIST
|
||||||
|
const getRecipients = () => {
|
||||||
|
apiCall
|
||||||
|
.getRecipient()
|
||||||
|
.then((res) => {
|
||||||
|
if (res.data.internal_return < 0) {
|
||||||
|
// success but no data
|
||||||
|
setRecipients((prev) => ({ ...prev, loading: false }));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
setRecipients((prev) => ({
|
||||||
|
...prev,
|
||||||
|
loading: false,
|
||||||
|
data: res.data.result_list,
|
||||||
|
}));
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
setRecipients((prev) => ({ ...prev, loading: false, error: true }));
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
//FUNCTION TO GET SEND MONEY FEE
|
||||||
|
const getSendMoneyFee = ({ target: { value } }) => {
|
||||||
|
setSendMoneyFee({ loading: true, fee: 0, total: 0 });
|
||||||
|
let amount = value;
|
||||||
|
if (Number(amount) <= 0 || amount == "" || isNaN(amount)) {
|
||||||
|
setSendMoneyFee({ loading: false, fee: 0, total: 0 });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
apiCall
|
||||||
|
.getSendMoneyFee(Number(amount * 100))
|
||||||
|
.then((res) => {
|
||||||
|
setSendMoneyFee({
|
||||||
|
loading: false,
|
||||||
|
fee: res.data.processing_fee,
|
||||||
|
total: res.data.total_amount,
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
setSendMoneyFee({ loading: false, fee: 0, total: 0 });
|
||||||
|
});
|
||||||
|
};
|
||||||
|
console.log('TESTING', sendMoneyFee)
|
||||||
|
//FUNCTION TO HANDLE SUBMIT
|
||||||
|
const handleSubmit = (values, helpers) => {
|
||||||
|
if (!values?.amount && !values.recipientID) return;
|
||||||
|
setRequestStatus(true);
|
||||||
|
let recipientDetails = recipients.data?.filter(
|
||||||
|
(item) => item.recipient_id == values.recipientID
|
||||||
|
);
|
||||||
|
let stateData = {
|
||||||
|
...values,
|
||||||
|
...sendMoneyFee,
|
||||||
|
details: { ...recipientDetails[0] },
|
||||||
|
};
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
setRequestStatus(false);
|
||||||
|
// navigate("confirm-withdraw-naira", { state: stateData });
|
||||||
|
action()
|
||||||
|
setShowConfirmNairaWithdraw({show: true, state: stateData})
|
||||||
|
}, 1000);
|
||||||
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
getRecipients();
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<ModalCom action={action} situation={situation}>
|
||||||
|
<div className="content-wrapper w-[90%] md:w-[600px]">
|
||||||
|
<div className="w-full">
|
||||||
|
<div className="add-fund w-full md:p-8 p-4 bg-white dark:bg-dark-white rounded-2xl shadow">
|
||||||
|
<Formik
|
||||||
|
initialValues={initialValues}
|
||||||
|
validationSchema={validationSchema}
|
||||||
|
onSubmit={handleSubmit}
|
||||||
|
>
|
||||||
|
{(props) => {
|
||||||
|
return (
|
||||||
|
<Form className="transfer-fund-info">
|
||||||
|
<h2 className="my-4 py-2 text-slate-900 dark:text-white text-xl lg:text-2xl font-medium">
|
||||||
|
{`Withdraw from ${wallet.description} Wallet : ${wallet.symbol}${(
|
||||||
|
wallet.amount * 0.01
|
||||||
|
).toFixed(2)}`}
|
||||||
|
</h2>
|
||||||
|
<div className=" mb-6 gap-4 flex flex-col">
|
||||||
|
<div className="field w-full">
|
||||||
|
<InputCom
|
||||||
|
fieldClass="px-4"
|
||||||
|
parentClass="flex items-center gap-1 justify-between"
|
||||||
|
labelClass="flex-[0.2] mb-0"
|
||||||
|
inputClass="flex-[0.8] max-w-[12rem]"
|
||||||
|
label="Amount:"
|
||||||
|
type="number"
|
||||||
|
name="amount"
|
||||||
|
placeholder="0"
|
||||||
|
direction="rtl"
|
||||||
|
value={props.values.amount}
|
||||||
|
inputHandler={props.handleChange}
|
||||||
|
blurHandler={(e) => {
|
||||||
|
getSendMoneyFee(e);
|
||||||
|
}}
|
||||||
|
// props.handleBlur
|
||||||
|
// onMouseLeave={(e)=>{getSendMoneyFee(e)}}
|
||||||
|
/>
|
||||||
|
{props.errors.amount && props.touched.amount && (
|
||||||
|
<p className="sm:text-sm text-[12px] text-red-500 sm:text-left text-right sm:translate-y-0 translate-y-1">
|
||||||
|
{props.errors.amount}
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="field w-full">
|
||||||
|
<InputCom
|
||||||
|
fieldClass="px-4 transfer-field"
|
||||||
|
parentClass="flex items-center gap-1 justify-between"
|
||||||
|
labelClass="flex-[0.2] mb-0"
|
||||||
|
inputClass="flex-[0.8] transfer-field max-w-[12rem]"
|
||||||
|
label="Fee:"
|
||||||
|
type="text"
|
||||||
|
name="fee"
|
||||||
|
direction="rtl"
|
||||||
|
value={
|
||||||
|
sendMoneyFee.loading ? "loading" : (sendMoneyFee.fee * 0.01).toFixed(2)
|
||||||
|
}
|
||||||
|
disable={true}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="field w-full mb-6">
|
||||||
|
<InputCom
|
||||||
|
fieldClass="px-4 transfer-field"
|
||||||
|
parentClass="flex items-center gap-1 justify-between"
|
||||||
|
labelClass="flex-[0.2] mb-0"
|
||||||
|
inputClass="flex-[0.8] transfer-field max-w-[12rem]"
|
||||||
|
label="Total:"
|
||||||
|
type="text"
|
||||||
|
name="total"
|
||||||
|
direction="rtl"
|
||||||
|
value={
|
||||||
|
sendMoneyFee.loading ? "loading" : (sendMoneyFee.total * 0.01).toFixed(2)
|
||||||
|
}
|
||||||
|
disable={true}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="w-full">
|
||||||
|
<div className="relative my-3 md:flex items-center">
|
||||||
|
<div className="transfer-input w-full flex items-start gap-1 justify-between">
|
||||||
|
<label className="text-[#181c32] dark:text-white text-base font-semibold block flex-[0.2] mb-0 mt-3">
|
||||||
|
Recipient:
|
||||||
|
</label>
|
||||||
|
<div className="flex flex-col gap-3 flex-[0.8] sm:items-start items-end">
|
||||||
|
<select
|
||||||
|
className="sm:w-full w-48 text-base p-2 text-dark-gray dark:text-white rounded-md border border-slate-300 outline-0 flex-[0.8]"
|
||||||
|
value={props.values.recipientID}
|
||||||
|
name="recipientID"
|
||||||
|
onChange={props.handleChange}
|
||||||
|
onBlur={props.handleBlur}
|
||||||
|
>
|
||||||
|
{recipients.loading ? (
|
||||||
|
<option
|
||||||
|
className="text-slate-500 text-lg"
|
||||||
|
value=""
|
||||||
|
>
|
||||||
|
Loading...
|
||||||
|
</option>
|
||||||
|
) : recipients.data.length ? (
|
||||||
|
<>
|
||||||
|
<option
|
||||||
|
className="text-slate-500 text-lg"
|
||||||
|
value=""
|
||||||
|
>
|
||||||
|
Select...
|
||||||
|
</option>
|
||||||
|
{recipients.data.map((item, index) => (
|
||||||
|
<option
|
||||||
|
key={index}
|
||||||
|
value={item.recipient_id}
|
||||||
|
className="text-slate-500 text-lg"
|
||||||
|
>
|
||||||
|
{item.recipient}
|
||||||
|
</option>
|
||||||
|
))}
|
||||||
|
</>
|
||||||
|
) : recipients.error ? (
|
||||||
|
<option
|
||||||
|
className="text-slate-500 text-lg"
|
||||||
|
value=""
|
||||||
|
>
|
||||||
|
Could'nt load, try again!
|
||||||
|
</option>
|
||||||
|
) : (
|
||||||
|
<option
|
||||||
|
className="text-slate-500 text-lg"
|
||||||
|
value=""
|
||||||
|
>
|
||||||
|
No Recipient Found!
|
||||||
|
</option>
|
||||||
|
)}
|
||||||
|
</select>
|
||||||
|
<div className="flex justify-end relative w-full">
|
||||||
|
{props.errors.recipientID &&
|
||||||
|
props.touched.recipientID && (
|
||||||
|
<p className="sm:text-sm text-[12px] text-red-500 absolute sm:top-1 -top-20 sm:left-0 left-[160px]">
|
||||||
|
{props.errors.recipientID}
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
|
<Link
|
||||||
|
to="add-recipient"
|
||||||
|
className="mx-1 text-base text-white p-2 bg-[orange] rounded-md hover:opacity-80 max-w-[5rem]"
|
||||||
|
>
|
||||||
|
Add New
|
||||||
|
</Link>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="field w-full mb-6 flex gap-1 justify-between">
|
||||||
|
<label className="text-[#181c32] dark:text-white text-base font-semibold flex flex-[0.2] mt-2.5">
|
||||||
|
Comment:
|
||||||
|
</label>
|
||||||
|
<textarea
|
||||||
|
style={{ resize: "none" }}
|
||||||
|
className="text-base px-4 py-2 rounded-md min-h-[100px] sm:max-w-[550px] max-w-[250px] text-dark-gray dark:text-white w-full bg-slate-100 dark:bg-[#11131F] focus:ring-0 focus:outline-none flex-[0.8]"
|
||||||
|
name="comment"
|
||||||
|
value={props.values.comment}
|
||||||
|
onChange={props.handleChange}
|
||||||
|
onBlur={props.handleBlur}
|
||||||
|
cols="30"
|
||||||
|
rows="2"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="transfer-fund-btn flex justify-end items-center gap-2 py-4">
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
onClick={action}
|
||||||
|
className="border-gradient text-base tracking-wide px-4 py-2 rounded-full"
|
||||||
|
>
|
||||||
|
<span className="text-gradient">Cancel</span>
|
||||||
|
</button>
|
||||||
|
{requestStatus ? (
|
||||||
|
<LoadingSpinner size="8" color="sky-blue" />
|
||||||
|
) : (
|
||||||
|
<button
|
||||||
|
type="submit"
|
||||||
|
disabled={
|
||||||
|
props.isSubmitting || sendMoneyFee.loading
|
||||||
|
? true
|
||||||
|
: false
|
||||||
|
}
|
||||||
|
className="btn-gradient text-base tracking-wide px-4 py-2 rounded-full text-white cursor-pointer"
|
||||||
|
>
|
||||||
|
Continue
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</Form>
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
</Formik>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</ModalCom>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default NairaWithdraw;
|
||||||
+6
-5
@@ -1,10 +1,10 @@
|
|||||||
import React, { useEffect, useState } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
import { Link, useNavigate } from "react-router-dom";
|
import { Link, useNavigate } from "react-router-dom";
|
||||||
import InputCom from "../Helpers/Inputs/InputCom";
|
import InputCom from "../../Helpers/Inputs/InputCom";
|
||||||
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
import LoadingSpinner from "../../Spinners/LoadingSpinner";
|
||||||
import RecentActivityTable from "./WalletComponent/RecentActivityTable";
|
// import RecentActivityTable
|
||||||
|
|
||||||
import usersService from "../../services/UsersService";
|
import usersService from "../../../services/UsersService";
|
||||||
|
|
||||||
import { Form, Formik } from "formik";
|
import { Form, Formik } from "formik";
|
||||||
import * as Yup from "yup";
|
import * as Yup from "yup";
|
||||||
@@ -326,7 +326,8 @@ function TransferFund({ payment, wallet }) {
|
|||||||
{payment.loading ? (
|
{payment.loading ? (
|
||||||
<LoadingSpinner size="16" color="sky-blue" />
|
<LoadingSpinner size="16" color="sky-blue" />
|
||||||
) : (
|
) : (
|
||||||
<RecentActivityTable payment={payment} />
|
// <RecentActivityTable payment={payment} />
|
||||||
|
null
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -5,26 +5,29 @@ import React, {
|
|||||||
useEffect,
|
useEffect,
|
||||||
useMemo,
|
useMemo,
|
||||||
useReducer,
|
useReducer,
|
||||||
|
useState,
|
||||||
} from "react";
|
} from "react";
|
||||||
import { Routes, Route, Outlet, Navigate } from "react-router-dom";
|
import { Navigate, Outlet, Route, Routes } from "react-router-dom";
|
||||||
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";
|
||||||
|
|
||||||
const AddFund = lazy(() => import("./AddFund"));
|
// const AddFund = lazy(() => import("./AddFund"));
|
||||||
const ConfirmAddFund = lazy(() => import("./ConfirmAddFund"));
|
// const ConfirmAddFund = lazy(() => import("./ConfirmAddFund"));
|
||||||
const TransferFund = lazy(() => import("./TransferFund"));
|
// const TransferFund = lazy(() => import("./TransferFund"));
|
||||||
const WalletBox = lazy(() => import("./WalletBox"));
|
const WalletBox = lazy(() => import("./WalletBox"));
|
||||||
const AddRecipient = lazy(() => import("./AddRecipient"));
|
// const NairaWithdraw = lazy(() => import("./Popup/NairaWithdraw"));
|
||||||
const ConfirmTransfer = lazy(() => import("./ConfirmTransfer"));
|
// const ConfirmNairaWithdraw = lazy(() => import("./ConfirmNairaWithdraw"));
|
||||||
|
// const AddRecipient = lazy(() => import("./AddRecipient"));
|
||||||
|
// const ConfirmTransfer = lazy(() => import("./ConfirmTransfer"));
|
||||||
|
|
||||||
function Wallet() {
|
// function Wallet() {
|
||||||
return (
|
// return (
|
||||||
<Layout>
|
// <Layout>
|
||||||
<Outlet />
|
// <Outlet />
|
||||||
</Layout>
|
// </Layout>
|
||||||
);
|
// );
|
||||||
}
|
// }
|
||||||
|
|
||||||
const initialState = {
|
const initialState = {
|
||||||
loading: true,
|
loading: true,
|
||||||
@@ -53,124 +56,52 @@ const reducer = (state, action) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const WalletRoutes = () => {
|
const WalletRoutes = () => {
|
||||||
const apiCall = useMemo(() => new usersService(), []);
|
const apiCall = new usersService();
|
||||||
|
|
||||||
const [walletList, dispatchWalletList] = useReducer(reducer, initialState);
|
const [walletList, setWalletList] = useState({loading: true, data: []});
|
||||||
const [paymentHistory, dispatchPaymentHistory] = useReducer(
|
const [paymentHistory, setPaymentHistory] = useState({loading: true, data: []});
|
||||||
reducer,
|
|
||||||
initialState
|
|
||||||
);
|
|
||||||
|
|
||||||
const getWalletList = useCallback(() => {
|
const getWalletList = () => {
|
||||||
apiCall
|
apiCall
|
||||||
.getUserWallets(null)
|
.getUserWallets()
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (res.data.internal_return < 0) {
|
if (res.data.internal_return < 0) {
|
||||||
dispatchWalletList({ type: "FETCH_SUCCESS", payload: [] });
|
setWalletList({loading: false, data: []})
|
||||||
} else {
|
} else {
|
||||||
dispatchWalletList({
|
setWalletList({loading: false, data: res.data?.result_list})
|
||||||
type: "FETCH_SUCCESS",
|
|
||||||
payload: res.data.result_list,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
dispatchWalletList({ type: "FETCH_ERROR" });
|
setWalletList({loading: false, data: []})
|
||||||
});
|
});
|
||||||
}, [apiCall]);
|
}
|
||||||
|
|
||||||
const getPaymentHistory = useCallback(() => {
|
const getPaymentHistory = () => {
|
||||||
apiCall
|
apiCall
|
||||||
.getPaymentHx()
|
.getPaymentHx()
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (res.data.internal_return < 0) {
|
if (res.data.internal_return < 0) {
|
||||||
dispatchPaymentHistory({ type: "FETCH_SUCCESS", payload: [] });
|
setPaymentHistory({loading: false, data: []})
|
||||||
} else {
|
} else {
|
||||||
dispatchPaymentHistory({
|
setPaymentHistory({loading: false, data: res.data?.result_list})
|
||||||
type: "FETCH_SUCCESS",
|
|
||||||
payload: res.data.result_list,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
dispatchPaymentHistory({ type: "FETCH_ERROR" });
|
setPaymentHistory({loading: false, data: []})
|
||||||
});
|
});
|
||||||
}, [apiCall]);
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
let isMounted = true;
|
getWalletList();
|
||||||
|
getPaymentHistory();
|
||||||
if (isMounted) {
|
}, []);
|
||||||
getWalletList();
|
|
||||||
getPaymentHistory();
|
|
||||||
}
|
|
||||||
|
|
||||||
return () => {
|
|
||||||
isMounted = false;
|
|
||||||
};
|
|
||||||
}, [getWalletList, getPaymentHistory]);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Routes>
|
<Layout>
|
||||||
<Route
|
<Suspense fallback={<LoadingSpinner size="16" color="sky-blue" />}>
|
||||||
element={
|
<WalletBox wallet={walletList} payment={paymentHistory} />
|
||||||
<Suspense fallback={<LoadingSpinner size="16" color="sky-blue" />}>
|
</Suspense>
|
||||||
<Wallet />
|
</Layout>
|
||||||
</Suspense>
|
|
||||||
}
|
|
||||||
>
|
|
||||||
{/* <Route
|
|
||||||
path="add-fund"
|
|
||||||
element={
|
|
||||||
<Suspense fallback={<LoadingSpinner size="16" color="sky-blue" />}>
|
|
||||||
<AddFund payment={paymentHistory} />
|
|
||||||
</Suspense>
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
<Route
|
|
||||||
path="add-fund/confirm-add-fund"
|
|
||||||
element={
|
|
||||||
<Suspense fallback={<LoadingSpinner size="16" color="sky-blue" />}>
|
|
||||||
<ConfirmAddFund payment={paymentHistory} />
|
|
||||||
</Suspense>
|
|
||||||
}
|
|
||||||
/> */}
|
|
||||||
<Route
|
|
||||||
path="transfer-fund"
|
|
||||||
element={
|
|
||||||
<Suspense fallback={<LoadingSpinner size="16" color="sky-blue" />}>
|
|
||||||
<TransferFund payment={paymentHistory} wallet={walletList} />
|
|
||||||
</Suspense>
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
{/*<Route index element={<Balance wallet={walletList} />} />*/}
|
|
||||||
<Route
|
|
||||||
index
|
|
||||||
element={
|
|
||||||
<Suspense fallback={<LoadingSpinner size="16" color="sky-blue" />}>
|
|
||||||
<WalletBox wallet={walletList} payment={paymentHistory} />
|
|
||||||
</Suspense>
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
<Route
|
|
||||||
path="transfer-fund/add-recipient"
|
|
||||||
element={
|
|
||||||
<Suspense fallback={<LoadingSpinner size="16" color="sky-blue" />}>
|
|
||||||
<AddRecipient />
|
|
||||||
</Suspense>
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
<Route
|
|
||||||
path="transfer-fund/confirm-transfer"
|
|
||||||
element={
|
|
||||||
<Suspense fallback={<LoadingSpinner size="16" color="sky-blue" />}>
|
|
||||||
<ConfirmTransfer payment={paymentHistory} wallet={walletList} />
|
|
||||||
</Suspense>
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
<Route path="*" element={<Navigate to="/" />} />
|
|
||||||
</Route>
|
|
||||||
</Routes>
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,30 +1,40 @@
|
|||||||
import React from 'react'
|
import React, { useState } from "react";
|
||||||
import { Link } from 'react-router-dom';
|
import ConfirmNairaWithdraw from "./Popup/ConfirmNairaWithdraw";
|
||||||
|
import NairaWithdraw from "./Popup/NairaWithdraw";
|
||||||
|
|
||||||
|
function WalletAction({ walletItem, payment, openPopUp }) {
|
||||||
|
const [showNairaWithdraw, setShowNairaWithdraw] = useState(false); // DETERMINES WHEN NAIRA WITHDRAWAL POPS UP
|
||||||
|
|
||||||
|
const [showConfirmNairaWithdraw, setShowConfirmNairaWithdraw] = useState({
|
||||||
|
show: false,
|
||||||
|
state: {},
|
||||||
|
}); // DETERMINES WHEN CONFIRM NAIRA WITHDRAWAL POPS UP
|
||||||
|
|
||||||
function WalletAction({walletItem, payment, openPopUp}) {
|
|
||||||
return (
|
return (
|
||||||
<div className="counters w-full flex justify-between gap-2">
|
<div className="counters w-full flex justify-between gap-2">
|
||||||
<div className='w-1/2 flex justify-center items-center'>
|
<div className="w-1/2 flex justify-center items-center">
|
||||||
<Link
|
|
||||||
to="transfer-fund"
|
|
||||||
className={`${
|
|
||||||
walletItem.code != "NAIRA" && "invisible"
|
|
||||||
} px-4 h-10 flex justify-center items-center btn-gradient text-base rounded-full text-white`}
|
|
||||||
>
|
|
||||||
Spend
|
|
||||||
</Link>
|
|
||||||
</div>
|
|
||||||
<div className='w-1/2 flex justify-center items-center'>
|
|
||||||
<button
|
<button
|
||||||
className='px-4 h-10 flex justify-center items-center btn-gradient text-base rounded-full text-white'
|
onClick={() => {
|
||||||
onClick={() => {
|
setShowNairaWithdraw(true);
|
||||||
openPopUp({
|
}}
|
||||||
payment: payment,
|
className={`${
|
||||||
currency: walletItem?.description,
|
walletItem.code != "NAIRA" && "invisible"
|
||||||
});
|
} px-4 h-10 flex justify-center items-center btn-gradient text-base rounded-full text-white`}
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
{/* <span className="">
|
Spend
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div className="w-1/2 flex justify-center items-center">
|
||||||
|
<button
|
||||||
|
className="px-4 h-10 flex justify-center items-center btn-gradient text-base rounded-full text-white"
|
||||||
|
onClick={() => {
|
||||||
|
openPopUp({
|
||||||
|
payment: payment,
|
||||||
|
currency: walletItem?.description,
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{/* <span className="">
|
||||||
<svg
|
<svg
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
width="38"
|
width="38"
|
||||||
@@ -39,11 +49,36 @@ function WalletAction({walletItem, payment, openPopUp}) {
|
|||||||
></path>
|
></path>
|
||||||
</svg>
|
</svg>
|
||||||
</span> */}
|
</span> */}
|
||||||
<span className="">Add Credit</span>
|
<span className="">Add Credit</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{showNairaWithdraw && (
|
||||||
|
<NairaWithdraw
|
||||||
|
wallet={walletItem}
|
||||||
|
action={() => {
|
||||||
|
setShowNairaWithdraw((prev) => !prev);
|
||||||
|
}}
|
||||||
|
situation={showNairaWithdraw}
|
||||||
|
setShowConfirmNairaWithdraw={setShowConfirmNairaWithdraw}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{showConfirmNairaWithdraw.show && (
|
||||||
|
<ConfirmNairaWithdraw
|
||||||
|
wallet={walletItem}
|
||||||
|
state={showConfirmNairaWithdraw.state}
|
||||||
|
action={() => {
|
||||||
|
setShowConfirmNairaWithdraw((prev) => ({
|
||||||
|
...prev,
|
||||||
|
show: !prev.show,
|
||||||
|
}));
|
||||||
|
}}
|
||||||
|
situation={showConfirmNairaWithdraw.show}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default WalletAction
|
export default WalletAction;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
||||||
import WalletItemCard from "./WalletItemCard";
|
import WalletItemCard from "./WalletItemCard";
|
||||||
|
|
||||||
export default function WalletBox({ wallet, coupon, payment }) {
|
export default function WalletBox({ wallet, payment }) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="my-wallet-wrapper w-full mb-10">
|
<div className="my-wallet-wrapper w-full mb-10">
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ function RecentActivityTable({ payment }) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex flex-col justify-between overflow-y-auto">
|
<div className="flex flex-col justify-between min-h-[500px]">
|
||||||
<table className="wallet-activity w-full table-auto border-collapse text-left">
|
<table className="wallet-activity w-full table-auto border-collapse text-left">
|
||||||
<thead className="border-b-2">
|
<thead className="border-b-2">
|
||||||
<tr className="text-slate-600">
|
<tr className="text-slate-600">
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ export default function WalletItemCard({ walletItem, payment }) {
|
|||||||
|
|
||||||
// Credit popup
|
// Credit popup
|
||||||
const [creditPopup, setCreditPopup] = useState({ show: false, data: {} });
|
const [creditPopup, setCreditPopup] = useState({ show: false, data: {} });
|
||||||
|
|
||||||
const openPopUp = (value) => {
|
const openPopUp = (value) => {
|
||||||
setCreditPopup({
|
setCreditPopup({
|
||||||
show: true,
|
show: true,
|
||||||
@@ -41,47 +40,52 @@ export default function WalletItemCard({ walletItem, payment }) {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{/* <div className="w-[350px]"> */}
|
{/* <div className="w-[350px]"> */}
|
||||||
<div className="wallet w-full flex justify-between items-start gap-3">
|
<div className="wallet w-full flex justify-between items-start gap-3">
|
||||||
<div className="min-w-[100px] min-h-[100px] max-w-[100px] max-h-[100px] rounded-full bg-[#e3e3e3] flex justify-center items-center">
|
<div className="min-w-[100px] min-h-[100px] max-w-[100px] max-h-[100px] rounded-full bg-[#e3e3e3] flex justify-center items-center">
|
||||||
<img src={localImgLoad(`images/currency/${image}`)} className="w-full h-full" alt="curreny-icon" />
|
<img
|
||||||
</div>
|
src={localImgLoad(`images/currency/${image}`)}
|
||||||
<div className="balance w-full mt-2 flex justify-center">
|
className="w-full h-full"
|
||||||
<div className="">
|
alt="curreny-icon"
|
||||||
<p className="text-lg text-white opacity-[70%] tracking-wide mb-6">
|
/>
|
||||||
Current Balance
|
</div>
|
||||||
</p>
|
<div className="balance w-full mt-2 flex justify-center">
|
||||||
<p className="text-[44px] font-bold text-white tracking-wide leading-10 mb-2">
|
<div className="">
|
||||||
{PriceFormatter(
|
<p className="text-lg text-white opacity-[70%] tracking-wide mb-6">
|
||||||
walletItem.amount * 0.01,
|
Current Balance
|
||||||
walletItem.code,
|
</p>
|
||||||
undefined,
|
<p className="text-[44px] font-bold text-white tracking-wide leading-10 mb-2">
|
||||||
"text-[2rem]"
|
{PriceFormatter(
|
||||||
)}
|
walletItem.amount * 0.01,
|
||||||
</p>
|
walletItem.code,
|
||||||
</div>
|
undefined,
|
||||||
|
"text-[2rem]"
|
||||||
|
)}
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<p className="my-5 text-lg text-white tracking-wide flex justify-center items-center gap-2">
|
<p className="my-5 text-lg text-white tracking-wide flex justify-center items-center gap-2">
|
||||||
HOLDINGS :{" "}
|
HOLDINGS :{" "}
|
||||||
<span className="mt-1">
|
<span className="mt-1">
|
||||||
{PriceFormatter(
|
{PriceFormatter(
|
||||||
walletItem.escrow * 0.01,
|
walletItem.escrow * 0.01,
|
||||||
walletItem.code,
|
walletItem.code,
|
||||||
undefined,
|
undefined,
|
||||||
"text-[2rem]"
|
"text-[2rem]"
|
||||||
)}
|
)}
|
||||||
</span>
|
</span>
|
||||||
</p>
|
</p>
|
||||||
{/* for white underline */}
|
{/* for white underline */}
|
||||||
<div className="my-2 w-full h-[1px] bg-white"></div>
|
<div className="my-2 w-full h-[1px] bg-white"></div>
|
||||||
|
|
||||||
{!accountType ? (
|
{!accountType ? (
|
||||||
<WalletAction walletItem={walletItem} payment={payment} openPopUp={openPopUp} />
|
<WalletAction
|
||||||
)
|
walletItem={walletItem}
|
||||||
:
|
payment={payment}
|
||||||
null
|
openPopUp={openPopUp}
|
||||||
}
|
/>
|
||||||
|
) : null}
|
||||||
{/* </div> */}
|
{/* </div> */}
|
||||||
</div>
|
</div>
|
||||||
{creditPopup.show && (
|
{creditPopup.show && (
|
||||||
|
|||||||
@@ -166,22 +166,22 @@ export default function ManageInterestOffer(props) {
|
|||||||
|
|
||||||
<div className="w-full">
|
<div className="w-full">
|
||||||
{/* switch button */}
|
{/* switch button */}
|
||||||
<div className="my-1 flex items-center border-b border-slate-300">
|
<div className="pl-7 my-2 flex items-center border-b border-slate-300 gap-3">
|
||||||
<button
|
<button
|
||||||
name="info"
|
name="info"
|
||||||
onClick={(e) => setTab(e.target.name)}
|
onClick={(e) => setTab(e.target.name)}
|
||||||
className={`p-2 text-lg font-bold text-slate-600 dark:text-white border ${
|
className={`px-4 py-1 rounded-t-2xl ${
|
||||||
tab == "info" ? "border-sky-blue" : "border-slate-300"
|
tab == "info" ? "bg-[#4687ba] border-[2px] border-[#4687ba] text-white" : "bg-white text-[#000] border-t-[2px]"
|
||||||
} tracking-wide transition duration-200`}
|
}`}
|
||||||
>
|
>
|
||||||
Info
|
Info
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
name="message"
|
name="message"
|
||||||
onClick={(e) => setTab(e.target.name)}
|
onClick={(e) => setTab(e.target.name)}
|
||||||
className={`p-2 text-lg font-bold text-slate-600 dark:text-white border ${
|
className={`px-4 py-1 rounded-t-2xl ${
|
||||||
tab == "message" ? "border-sky-blue" : "border-slate-300"
|
tab == "message" ? "bg-[#4687ba] border-[2px] border-[#4687ba] text-white" : "bg-white text-[#000] border-t-[2px]"
|
||||||
} tracking-wide transition duration-200`}
|
}`}
|
||||||
>
|
>
|
||||||
Messages ({messageList.data.length})
|
Messages ({messageList.data.length})
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -472,10 +472,10 @@ export default function Header({ logoutModalHandler, sidebarHandler }) {
|
|||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
{/* profile */}
|
{/* profile */}
|
||||||
<div className="user-profile relative lg:block hidden">
|
<div className="user-profile relative">
|
||||||
<div
|
<div
|
||||||
onClick={() => handlerProfile()}
|
onClick={() => handlerProfile()}
|
||||||
className="flex items-center space-x-3.5"
|
className="hidden lg:flex items-center space-x-3.5"
|
||||||
>
|
>
|
||||||
{/* profile-image */}
|
{/* profile-image */}
|
||||||
<div className="lg:w-[62px] lg:h-[62px] w-[50px] h-[50px] rounded-full overflow-hidden">
|
<div className="lg:w-[62px] lg:h-[62px] w-[50px] h-[50px] rounded-full overflow-hidden">
|
||||||
@@ -492,6 +492,17 @@ export default function Header({ logoutModalHandler, sidebarHandler }) {
|
|||||||
{userDetails && userDetails?.account_type !== "FAMILY" && <p className="text-sm text-thin-light-gray">@{userEmail}</p>}
|
{userDetails && userDetails?.account_type !== "FAMILY" && <p className="text-sm text-thin-light-gray">@{userEmail}</p>}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div className="for-mobile-profile lg:hidden block">
|
||||||
|
<div
|
||||||
|
// to="/profile"
|
||||||
|
onClick={() => handlerProfile()}
|
||||||
|
className="lg:w-[62px] lg:h-[62px] w-[50px] h-[50px] rounded-full overflow-hidden block"
|
||||||
|
>
|
||||||
|
<img src={profileImg} alt="profile" className="w-full h-full" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
className={`profile-dropdown w-[293px] z-30 bg-white dark:bg-dark-white absolute lg:right-16 -right-[16px] rounded-lg ${
|
className={`profile-dropdown w-[293px] z-30 bg-white dark:bg-dark-white absolute lg:right-16 -right-[16px] rounded-lg ${
|
||||||
userProfileDropdown ? "active" : ""
|
userProfileDropdown ? "active" : ""
|
||||||
@@ -675,7 +686,7 @@ export default function Header({ logoutModalHandler, sidebarHandler }) {
|
|||||||
<li className="content-item my-2 hover:bg-slate-100 transition duration-500 rounded-lg cursor-pointer">
|
<li className="content-item my-2 hover:bg-slate-100 transition duration-500 rounded-lg cursor-pointer">
|
||||||
<div className="name" onClick={logoutModalHandler}>
|
<div className="name" onClick={logoutModalHandler}>
|
||||||
<p className="text-sm py-2 px-4 text-dark-gray dark:text-white hover:text-sky-blue transition font-medium">
|
<p className="text-sm py-2 px-4 text-dark-gray dark:text-white hover:text-sky-blue transition font-medium">
|
||||||
Sign Out
|
{process.env.REACT_APP_LOGOUT_TEXT}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
@@ -684,14 +695,15 @@ export default function Header({ logoutModalHandler, sidebarHandler }) {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="for-mobile-profile lg:hidden block">
|
{/* <div className="for-mobile-profile lg:hidden block">
|
||||||
<Link
|
<div
|
||||||
to="/profile"
|
// to="/profile"
|
||||||
|
onClick={() => handlerProfile()}
|
||||||
className="lg:w-[62px] lg:h-[62px] w-[50px] h-[50px] rounded-full overflow-hidden block"
|
className="lg:w-[62px] lg:h-[62px] w-[50px] h-[50px] rounded-full overflow-hidden block"
|
||||||
>
|
>
|
||||||
<img src={profileImg} alt="profile" className="w-full h-full" />
|
<img src={profileImg} alt="profile" className="w-full h-full" />
|
||||||
</Link>
|
</div>
|
||||||
</div>
|
</div> */}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import Header from "./Header";
|
|||||||
import MobileSidebar from "./MobileSideBar";
|
import MobileSidebar from "./MobileSideBar";
|
||||||
import RightSideBar from "./RightSideBar";
|
import RightSideBar from "./RightSideBar";
|
||||||
import Sidebar from "./Sidebar";
|
import Sidebar from "./Sidebar";
|
||||||
import usersService from "../../services/UsersService";
|
|
||||||
|
|
||||||
export default function Layout({ children }) {
|
export default function Layout({ children }) {
|
||||||
const { drawer } = useSelector((state) => state.drawer);
|
const { drawer } = useSelector((state) => state.drawer);
|
||||||
@@ -179,7 +178,7 @@ export default function Layout({ children }) {
|
|||||||
type="button"
|
type="button"
|
||||||
className="text-white primary-gradient text-18 tracking-wide px-4 py-3 rounded-full"
|
className="text-white primary-gradient text-18 tracking-wide px-4 py-3 rounded-full"
|
||||||
>
|
>
|
||||||
Yes Logout
|
{`Yes ${process.env.REACT_APP_LOGOUT_TEXT}`}
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
onClick={logoutModalHandler}
|
onClick={logoutModalHandler}
|
||||||
|
|||||||
@@ -8,7 +8,12 @@ import {
|
|||||||
import DarkModeContext from "../Contexts/DarkModeContext";
|
import DarkModeContext from "../Contexts/DarkModeContext";
|
||||||
import Icons from "../Helpers/Icons";
|
import Icons from "../Helpers/Icons";
|
||||||
|
|
||||||
export default function MobileSidebar({ sidebar, action, logoutModalHandler, myJobList }) {
|
export default function MobileSidebar({
|
||||||
|
sidebar,
|
||||||
|
action,
|
||||||
|
logoutModalHandler,
|
||||||
|
myJobList,
|
||||||
|
}) {
|
||||||
let { userDetails } = useSelector((state) => state.userDetails);
|
let { userDetails } = useSelector((state) => state.userDetails);
|
||||||
const darkMode = useContext(DarkModeContext);
|
const darkMode = useContext(DarkModeContext);
|
||||||
|
|
||||||
@@ -110,74 +115,72 @@ export default function MobileSidebar({ sidebar, action, logoutModalHandler, myJ
|
|||||||
|
|
||||||
{/* menu and settings item */}
|
{/* menu and settings item */}
|
||||||
{userDetails?.account_type !== "FAMILY" && (
|
{userDetails?.account_type !== "FAMILY" && (
|
||||||
<div
|
<div
|
||||||
className={`menu-item transition-all duration-300 ease-in-out ${
|
className={`menu-item transition-all duration-300 ease-in-out ${
|
||||||
sidebar ? "mb-5" : "mb-2"
|
sidebar ? "mb-5" : "mb-2"
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
<div className="heading mb-5">
|
<div className="heading mb-5">
|
||||||
<h1 className="title text-xl font-bold text-sky-blue">
|
<h1 className="title text-xl font-bold text-sky-blue">Family</h1>
|
||||||
Family
|
</div>
|
||||||
</h1>
|
<div className="items">
|
||||||
</div>
|
<ul className="flex flex-col space-y-6">
|
||||||
<div className="items">
|
<ListItem
|
||||||
<ul className="flex flex-col space-y-6">
|
title="Family Corner"
|
||||||
<ListItem
|
route="/acc-family"
|
||||||
title="Family Corner"
|
iconName="new-family"
|
||||||
route="/acc-family"
|
sidebar={sidebar}
|
||||||
iconName="new-family"
|
/>
|
||||||
sidebar={sidebar}
|
</ul>
|
||||||
/>
|
</div>
|
||||||
</ul>
|
</div>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{userDetails?.account_type !== "FAMILY" && (
|
{userDetails?.account_type !== "FAMILY" && (
|
||||||
<>
|
<>
|
||||||
{!userDetails?.post_jobs ? (
|
{!userDetails?.post_jobs ? (
|
||||||
<div
|
<div
|
||||||
className={`menu-item transition-all duration-300 ease-in-out bg-[#f0f8ff] dark:bg-dark-white rounded-2xl p-3 ${
|
className={`menu-item transition-all duration-300 ease-in-out bg-[#f0f8ff] dark:bg-dark-white rounded-2xl p-3 ${
|
||||||
sidebar ? "mb-5" : "mb-2 rounded-none p-0"
|
sidebar ? "mb-5" : "mb-2 rounded-none p-0"
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
<div className="heading mb-5">
|
<div className="heading mb-5">
|
||||||
<h1 className="title text-xl font-bold text-sky-blue">
|
<h1 className="title text-xl font-bold text-sky-blue">
|
||||||
Job Post
|
Job Post
|
||||||
</h1>
|
</h1>
|
||||||
</div>
|
</div>
|
||||||
<div className="items">
|
<div className="items">
|
||||||
<ul className="flex flex-col space-y-6">
|
<ul className="flex flex-col space-y-6">
|
||||||
<li className="item group">
|
<li className="item group">
|
||||||
<NavLink
|
<NavLink
|
||||||
to="/start-job"
|
to="/start-job"
|
||||||
className={`nav-item flex items-center ${
|
className={`nav-item flex items-center ${
|
||||||
((navData) => (navData.isActive ? "active" : ""),
|
((navData) => (navData.isActive ? "active" : ""),
|
||||||
sidebar
|
sidebar
|
||||||
? "justify-start space-x-3.5"
|
? "justify-start space-x-3.5"
|
||||||
: "justify-center")
|
: "justify-center")
|
||||||
|
}`}
|
||||||
|
>
|
||||||
|
<span className="item-icon group-hover:bg-purple group-hover:text-white w-8 h-8 flex justify-center items-center transition-all duration-300 ease-in-out bg-light-purple dark:bg-dark-light-purple rounded-full text-dark-gray dark:text-white dark:text-lighter-gray">
|
||||||
|
<Icons name="people-two" />
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
className={`item-content group-hover:text-sky-blue text-[18px] transition-all duration-300 ease-in-out text-lighter-gray relative font-medium ${
|
||||||
|
sidebar ? "active flex-1" : "w-0"
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
<span className="item-icon group-hover:bg-purple group-hover:text-white w-8 h-8 flex justify-center items-center transition-all duration-300 ease-in-out bg-light-purple dark:bg-dark-light-purple rounded-full text-dark-gray dark:text-white dark:text-lighter-gray">
|
Enable Job Post
|
||||||
<Icons name="people-two" />
|
</span>
|
||||||
</span>
|
</NavLink>
|
||||||
<span
|
</li>
|
||||||
className={`item-content group-hover:text-sky-blue text-[18px] transition-all duration-300 ease-in-out text-lighter-gray relative font-medium ${
|
</ul>
|
||||||
sidebar ? "active flex-1" : "w-0"
|
|
||||||
}`}
|
|
||||||
>
|
|
||||||
Enable Job Post
|
|
||||||
</span>
|
|
||||||
</NavLink>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
) : myJobList?.data?.result_list?.length ? (
|
) : myJobList?.data?.result_list?.length ? (
|
||||||
<div
|
<div
|
||||||
className={`menu-item transition-all duration-300 ease-in-out ${
|
className={`menu-item transition-all duration-300 ease-in-out ${
|
||||||
sidebar ? "mb-5" : "mb-2"
|
sidebar ? "mb-5" : "mb-2"
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
<div className="heading mb-5">
|
<div className="heading mb-5">
|
||||||
<h1 className="title text-xl font-bold text-sky-blue">
|
<h1 className="title text-xl font-bold text-sky-blue">
|
||||||
@@ -212,9 +215,9 @@ export default function MobileSidebar({ sidebar, action, logoutModalHandler, myJ
|
|||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<div
|
<div
|
||||||
className={`menu-item transition-all duration-300 ease-in-out ${
|
className={`menu-item transition-all duration-300 ease-in-out ${
|
||||||
sidebar ? "mb-5" : "mb-2"
|
sidebar ? "mb-5" : "mb-2"
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
<div className="heading mb-5">
|
<div className="heading mb-5">
|
||||||
<h1 className="title text-xl font-bold text-sky-blue">
|
<h1 className="title text-xl font-bold text-sky-blue">
|
||||||
@@ -245,14 +248,14 @@ export default function MobileSidebar({ sidebar, action, logoutModalHandler, myJ
|
|||||||
className="signout-btn flex items-center space-x-1 p-2.5 w-2/3 h-[52px] bg-sky-blue transition duration-300 ease-in-out hover:bg-gray-900 rounded-full"
|
className="signout-btn flex items-center space-x-1 p-2.5 w-2/3 h-[52px] bg-sky-blue transition duration-300 ease-in-out hover:bg-gray-900 rounded-full"
|
||||||
>
|
>
|
||||||
<span className="">
|
<span className="">
|
||||||
<Icons name='new-logout' />
|
<Icons name="new-logout" />
|
||||||
</span>
|
</span>
|
||||||
<span
|
<span
|
||||||
className={`signout-btn-content text-white text-xl font-bold ${
|
className={`signout-btn-content text-white text-xl font-bold ${
|
||||||
sidebar ? "active" : ""
|
sidebar ? "active" : ""
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
Signout
|
{process.env.REACT_APP_LOGOUT_TEXT}
|
||||||
</span>
|
</span>
|
||||||
</button>
|
</button>
|
||||||
) : (
|
) : (
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -9,6 +9,7 @@ import products from "../../data/product_data.json";
|
|||||||
import Layout from "../Partials/Layout";
|
import Layout from "../Partials/Layout";
|
||||||
import {
|
import {
|
||||||
ActivitiesTab, BlogTab,
|
ActivitiesTab, BlogTab,
|
||||||
|
QuestionsTab,
|
||||||
CollectionTab,
|
CollectionTab,
|
||||||
CreatedTab,
|
CreatedTab,
|
||||||
HiddenProductsTab,
|
HiddenProductsTab,
|
||||||
@@ -39,7 +40,7 @@ export default function Resources(props) {
|
|||||||
// Category Components
|
// Category Components
|
||||||
const tabComponents = {
|
const tabComponents = {
|
||||||
blog: <BlogTab blogdata={blogItems} />,
|
blog: <BlogTab blogdata={blogItems} />,
|
||||||
onsale: <OnSaleTab products={onSaleProducts} />,
|
onsale: <QuestionsTab products={onSaleProducts} />,
|
||||||
owned: <OwnTab products={ownProducts} />,
|
owned: <OwnTab products={ownProducts} />,
|
||||||
created: (
|
created: (
|
||||||
<CreatedTab marketProducts={CreatedSell} mainProducts={CreatedBits} />
|
<CreatedTab marketProducts={CreatedSell} mainProducts={CreatedBits} />
|
||||||
@@ -65,6 +66,7 @@ export default function Resources(props) {
|
|||||||
return blogItems?.blogdata?.length
|
return blogItems?.blogdata?.length
|
||||||
}else if(name == 'onsale'){
|
}else if(name == 'onsale'){
|
||||||
return onSaleProducts?.length
|
return onSaleProducts?.length
|
||||||
|
// return null
|
||||||
}else if(name == 'owned'){
|
}else if(name == 'owned'){
|
||||||
return ownProducts?.length
|
return ownProducts?.length
|
||||||
}else if(name == 'created'){
|
}else if(name == 'created'){
|
||||||
@@ -87,6 +89,7 @@ export default function Resources(props) {
|
|||||||
>
|
>
|
||||||
{tabValue.content}
|
{tabValue.content}
|
||||||
</span>
|
</span>
|
||||||
|
{tabValue.name != 'onsale' &&
|
||||||
<span
|
<span
|
||||||
className={`w-5 h-5 group-hover:bg-pink group-hover:text-white text-[10px] rounded-full absolute -top-2 -right-5 flex justify-center items-center ${
|
className={`w-5 h-5 group-hover:bg-pink group-hover:text-white text-[10px] rounded-full absolute -top-2 -right-5 flex justify-center items-center ${
|
||||||
isActive
|
isActive
|
||||||
@@ -94,9 +97,9 @@ export default function Resources(props) {
|
|||||||
: "text-thin-light-gray bg-[#F2B8FD]"
|
: "text-thin-light-gray bg-[#F2B8FD]"
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
{/* 16 blog, onsale, owned,created */}
|
|
||||||
{countNumber(tabValue.name)}
|
{countNumber(tabValue.name)}
|
||||||
</span>
|
</span>
|
||||||
|
}
|
||||||
</li>
|
</li>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -0,0 +1,46 @@
|
|||||||
|
import ProductCardStyleTwo from "../../Cards/ProductCardStyleTwo";
|
||||||
|
import DataIteration from "../../Helpers/DataIteration";
|
||||||
|
import SearchCom from "../../Helpers/SearchCom";
|
||||||
|
import localImgLoad from "../../../lib/localImgLoad";
|
||||||
|
|
||||||
|
export default function QuestionsTab({ className, products }) {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<div className={`onsale-tab-wrapper w-full ${className || ""}`}>
|
||||||
|
<div className="main-container w-full">
|
||||||
|
<div className="filter-section w-fullmb-6">
|
||||||
|
<h1 className="text-xl lg:text-2xl font-bold text-dark-gray dark:text-white tracking-wide">Ask our A.I</h1>
|
||||||
|
<div className="mt-2 lg:grid grid-cols-2 gap-2 h-full lg:h-[500px]">
|
||||||
|
<div className="h-full mb-5 lg:mb-0">
|
||||||
|
<img className="w-full h-full rounded-2xl" src={localImgLoad(`images/resources-ask.jpg`)} alt='AI' />
|
||||||
|
</div>
|
||||||
|
<div className="p-8 bg-white rounded-2xl h-full">
|
||||||
|
<div className="input-wrapper border border-[#f5f8fa] dark:border-[#5e6278] w-full rounded-full h-[42px] overflow-hidden relative font-medium leading-6 bg-clip-padding text-[#5e6278] dark:text-gray-100 bg-[#f5f8fa] dark:bg-[#5e6278] text-base">
|
||||||
|
<select className="input-field px-2 placeholder:text-base text-dark-gray w-full h-full tracking-wide dark:bg-[#11131F] bg-[#fafafa] focus:ring-0 focus:outline-none">
|
||||||
|
<option className="rounded-full">Find answer on:</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
{/* filter-search */}
|
||||||
|
<div className="w-full my-5 border-2 rounded-full">
|
||||||
|
<SearchCom />
|
||||||
|
</div>
|
||||||
|
<div className="w-full flex justify-end items-center border-b-2 pb-4">
|
||||||
|
<button
|
||||||
|
className="btn-gradient text-base tracking-wide px-4 py-2 rounded-full text-white cursor-pointer"
|
||||||
|
>
|
||||||
|
Search
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
{/* <div className="content-section w-full-width">
|
||||||
|
<div className="grid lg:grid-cols-3 sm:grid-cols-2 grid-cols-1 gap-[30px]">
|
||||||
|
</div>
|
||||||
|
</div> */}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -5,9 +5,11 @@ import HiddenProductsTab from "./HiddenProductsTab";
|
|||||||
import OnSaleTab from "./OnSaleTab";
|
import OnSaleTab from "./OnSaleTab";
|
||||||
import OwnTab from "./OwnTab";
|
import OwnTab from "./OwnTab";
|
||||||
import BlogTab from "./BlogTab";
|
import BlogTab from "./BlogTab";
|
||||||
|
import QuestionsTab from "./QuestionsTab";
|
||||||
|
|
||||||
export {
|
export {
|
||||||
BlogTab,
|
BlogTab,
|
||||||
|
QuestionsTab,
|
||||||
ActivitiesTab,
|
ActivitiesTab,
|
||||||
CollectionTab,
|
CollectionTab,
|
||||||
CreatedTab,
|
CreatedTab,
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import SwitchCom from "../../Helpers/SwitchCom";
|
|||||||
import LoadingSpinner from "../../Spinners/LoadingSpinner";
|
import LoadingSpinner from "../../Spinners/LoadingSpinner";
|
||||||
import usersService from "../../../services/UsersService";
|
import usersService from "../../../services/UsersService";
|
||||||
import localImgLoad from "../../../lib/localImgLoad";
|
import localImgLoad from "../../../lib/localImgLoad";
|
||||||
|
import { toast } from "react-toastify";
|
||||||
|
|
||||||
import defaultImage from '../../../assets/images/banner-job-due.jpg'
|
import defaultImage from '../../../assets/images/banner-job-due.jpg'
|
||||||
|
|
||||||
@@ -13,17 +14,19 @@ export default function NotificationSettingTab() {
|
|||||||
|
|
||||||
const [accSettings, setAccSettings] = useState({loading: true, data: []}) // STATE TO HOLD ACCOUNT SETTINGS
|
const [accSettings, setAccSettings] = useState({loading: true, data: []}) // STATE TO HOLD ACCOUNT SETTINGS
|
||||||
|
|
||||||
|
let [notificationChange, setNotificationChange] = useState({loading: false, uid: ''})
|
||||||
|
|
||||||
// const [updateNotification, setUpdateNotification] = useState(false);
|
// const [updateNotification, setUpdateNotification] = useState(false);
|
||||||
// const [uploadProduct, setUploadProduct] = useState(true);
|
// const [uploadProduct, setUploadProduct] = useState(true);
|
||||||
// const [saleProduct, setSaleProduct] = useState(true);
|
// const [saleProduct, setSaleProduct] = useState(true);
|
||||||
// const [getProduct, setGetProduct] = useState(false);
|
// const [getProduct, setGetProduct] = useState(false);
|
||||||
// const [authLevel, setAuthLevel] = useState(true);
|
// const [authLevel, setAuthLevel] = useState(true);
|
||||||
|
|
||||||
const handleNotificationChange = (item) => {
|
const NotificationInterfaceChange = (item) => {
|
||||||
setAccSettings(prev => {
|
setAccSettings(prev => {
|
||||||
let newAccSettings = prev.data.map(data => {
|
let newAccSettings = prev.data.map(data => {
|
||||||
if(data.uid == item.uid){
|
if(data.uid == item.uid){
|
||||||
let newPrefValue = data.pref_value == null || data.pref_value == false ? true : false
|
let newPrefValue = data.pref_value == null || data.pref_value == '0' ? '100' : '0'
|
||||||
return {...data, pref_value: newPrefValue}
|
return {...data, pref_value: newPrefValue}
|
||||||
}else{
|
}else{
|
||||||
return data
|
return data
|
||||||
@@ -33,6 +36,26 @@ export default function NotificationSettingTab() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let handleNotificationChange = (item) => { // FUNCTION TO SET ACCOUNT SETTING
|
||||||
|
setNotificationChange({loading: true, uid: item.uid})
|
||||||
|
let reqData = { // API PAYLOADS
|
||||||
|
pref_id: item.pref_id,
|
||||||
|
status: item.pref_value == null || item.pref_value == 0 ? 100 : 0
|
||||||
|
}
|
||||||
|
api.setAccSettings(reqData).then(res => {
|
||||||
|
if(res.status != 200 || res.data.internal_return < 0){
|
||||||
|
toast.error("unable to complete");
|
||||||
|
}
|
||||||
|
toast.success("successful");
|
||||||
|
NotificationInterfaceChange(item) // CHANGES NOTIFICATION UI INTERFACE
|
||||||
|
}).catch(errer => {
|
||||||
|
toast.error("unable to complete");
|
||||||
|
}).finally(()=>{
|
||||||
|
setNotificationChange({loading: false, uid: {}})
|
||||||
|
// setTimeout(()=>{setNotificationChange({loading: false, uid: {}})},2000)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
api.getAccSettings().then(res => {
|
api.getAccSettings().then(res => {
|
||||||
setAccSettings({loading: false, data: res.data?.result_list || []})
|
setAccSettings({loading: false, data: res.data?.result_list || []})
|
||||||
@@ -67,12 +90,16 @@ export default function NotificationSettingTab() {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="mt-5 sm:mt-0">
|
<div className="mt-5 sm:mt-0">
|
||||||
|
{notificationChange.loading && notificationChange.uid == item.uid ?
|
||||||
|
<LoadingSpinner size='8' color='sky-blue' />
|
||||||
|
:
|
||||||
<SwitchCom
|
<SwitchCom
|
||||||
value={item.pref_value}
|
value={item.pref_value == null || item.pref_value == '0' ? 0 : 100}
|
||||||
handler={() => handleNotificationChange(item)}
|
handler={ notificationChange.loading ? ()=>{} : () => handleNotificationChange(item)}
|
||||||
// value={updateNotification}
|
// value={updateNotification}
|
||||||
// handler={() => setUpdateNotification(!updateNotification)}
|
// handler={() => setUpdateNotification(!updateNotification)}
|
||||||
/>
|
/>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -0,0 +1,261 @@
|
|||||||
|
import React, { useState } from "react";
|
||||||
|
import Detail from "./popoutcomponent/Detail";
|
||||||
|
import ModalCom from "../Helpers/ModalCom";
|
||||||
|
import { useNavigate } from "react-router-dom";
|
||||||
|
|
||||||
|
import usersService from "../../services/UsersService";
|
||||||
|
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
||||||
|
import localImgLoad from "../../lib/localImgLoad";
|
||||||
|
|
||||||
|
import { tableReload } from "../../store/TableReloads";
|
||||||
|
import { useDispatch } from "react-redux";
|
||||||
|
|
||||||
|
function FamilyOfferJobPopout({ details, onClose, situation }) {
|
||||||
|
const apiUrl = new usersService();
|
||||||
|
const navigate = useNavigate();
|
||||||
|
const dispatch = useDispatch();
|
||||||
|
|
||||||
|
const [requestStatus, setRequestStatus] = useState({
|
||||||
|
loading: false,
|
||||||
|
status: false,
|
||||||
|
message: "",
|
||||||
|
trigger: "",
|
||||||
|
});
|
||||||
|
|
||||||
|
//FUNCTION TO HANDLE AN OFFER
|
||||||
|
const handleOffer = ({ target: { name } }) => {
|
||||||
|
const reqData = {
|
||||||
|
// offer_result: 100,
|
||||||
|
offer_code: details.contract,
|
||||||
|
contract: details.contract,
|
||||||
|
};
|
||||||
|
|
||||||
|
//logic to determine the button pressed and set reqDate accordingly
|
||||||
|
if (name == "accept") {
|
||||||
|
setRequestStatus({
|
||||||
|
loading: true,
|
||||||
|
status: false,
|
||||||
|
message: "",
|
||||||
|
trigger: "offer",
|
||||||
|
});
|
||||||
|
reqData.offer_result = 100;
|
||||||
|
}
|
||||||
|
if (name == "reject") {
|
||||||
|
setRequestStatus({
|
||||||
|
loading: true,
|
||||||
|
status: false,
|
||||||
|
message: "",
|
||||||
|
trigger: "reject",
|
||||||
|
});
|
||||||
|
reqData.offer_result = 333;
|
||||||
|
}
|
||||||
|
|
||||||
|
// API CALL
|
||||||
|
apiUrl
|
||||||
|
.offersResponse(reqData)
|
||||||
|
.then((response) => {
|
||||||
|
if (response.status != 200 || response.data.internal_return < 0) {
|
||||||
|
setRequestStatus({
|
||||||
|
loading: false,
|
||||||
|
status: false,
|
||||||
|
message: `Unable to ${name} Offer, try again later`,
|
||||||
|
trigger: "",
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
setRequestStatus({
|
||||||
|
loading: false,
|
||||||
|
status: true,
|
||||||
|
message: `Offer ${name}ed Successfully`,
|
||||||
|
trigger: "",
|
||||||
|
});
|
||||||
|
setTimeout(() => {
|
||||||
|
onClose();
|
||||||
|
dispatch(tableReload({ type: "MYTASKTABLE" }));
|
||||||
|
navigate("/mytask", { replace: true });
|
||||||
|
setRequestStatus({
|
||||||
|
loading: false,
|
||||||
|
status: false,
|
||||||
|
message: "",
|
||||||
|
trigger: "",
|
||||||
|
});
|
||||||
|
}, 2000);
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
setRequestStatus({
|
||||||
|
loading: false,
|
||||||
|
status: false,
|
||||||
|
message: `Opps! An Error Occurred`,
|
||||||
|
trigger: "",
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
setTimeout(() => {
|
||||||
|
setRequestStatus({
|
||||||
|
loading: false,
|
||||||
|
status: false,
|
||||||
|
message: "",
|
||||||
|
trigger: "",
|
||||||
|
});
|
||||||
|
}, 5000);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<ModalCom action={onClose} situation={situation}>
|
||||||
|
<div className="logout-modal-wrapper lw-[90%] md:w-[768px] h-full lg:h-auto bg-white dark:bg-dark-white lg:rounded-2xl overflow-y-auto">
|
||||||
|
<div className="logout-modal-header w-full flex items-center justify-between lg:p-6 px-[30px] py-[23px] border-b dark:border-[#5356fb29] border-light-purple">
|
||||||
|
<h1 className="text-26 font-bold text-dark-gray dark:text-white tracking-wide">
|
||||||
|
Start Task
|
||||||
|
</h1>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className="text-[#374557] dark:text-red-500"
|
||||||
|
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="md:flex bg-white rounded-lg shadow-lg">
|
||||||
|
<div className="p-4 w-full md:w-3/4 md:border-r-2">
|
||||||
|
<div className="flex gap-2">
|
||||||
|
<div className="image-wrapper w-32">
|
||||||
|
<img className="w-full h-auto" src={localImgLoad(`images/taskbanners/${details.banner}`)} alt='Banner-Image' />
|
||||||
|
</div>
|
||||||
|
<div className="details-wrapper">
|
||||||
|
<p className="text-lg my-5 font-semibold text-slate-900 tracking-wide">
|
||||||
|
{details.title}
|
||||||
|
</p>
|
||||||
|
|
||||||
|
{/* INPUT SECTION */}
|
||||||
|
<div className="my-2 md:flex">
|
||||||
|
<Detail
|
||||||
|
label="Date"
|
||||||
|
value={
|
||||||
|
(details.offer_added && details.offer_added?.split(" ")[0]) ||
|
||||||
|
"default"
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="my-2 md:flex">
|
||||||
|
<Detail label="Description" value={details.description} />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="my-2 md:flex">
|
||||||
|
<Detail
|
||||||
|
label="Offer Expire"
|
||||||
|
value={details.expire && details.expire.split(" ")[0]}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="my-2 md:flex">
|
||||||
|
<Detail label="Price" value={details.thePrice} />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="my-2 md:flex">
|
||||||
|
<Detail
|
||||||
|
label="Duration"
|
||||||
|
value={`${details.timeline_days} day(s)`}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="my-2 md:flex">
|
||||||
|
<Detail
|
||||||
|
label="Detail"
|
||||||
|
value={details.job_description || details.description}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* ACTION SECTION */}
|
||||||
|
<div className="p-4 w-full md:w-1/4 h-full">
|
||||||
|
<div className="my-3 md:flex md:justify-center">
|
||||||
|
{requestStatus.loading && requestStatus.trigger == "offer" ? (
|
||||||
|
<LoadingSpinner size={8} color="sky-blue" />
|
||||||
|
) : (
|
||||||
|
<button
|
||||||
|
name="accept"
|
||||||
|
onClick={handleOffer}
|
||||||
|
disabled={requestStatus.loading}
|
||||||
|
className="px-2 py-2 w-20 flex justify-center items-center border-2 border-green-900 bg-green-500 text-base rounded-2xl text-white"
|
||||||
|
>
|
||||||
|
I am ready to start
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* <div className="mt-10 md:mt-20 md:flex md:justify-center">
|
||||||
|
{requestStatus.loading && requestStatus.trigger == "reject" ? (
|
||||||
|
<LoadingSpinner size={8} color="sky-blue" />
|
||||||
|
) : (
|
||||||
|
<button
|
||||||
|
name="reject"
|
||||||
|
onClick={handleOffer}
|
||||||
|
disabled={requestStatus.loading}
|
||||||
|
className="px-2 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
|
||||||
|
>
|
||||||
|
Reject Offer
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
|
</div> */}
|
||||||
|
|
||||||
|
{/* ERROR DISPLAY AND SUBMIT BUTTON */}
|
||||||
|
{requestStatus.message != "" &&
|
||||||
|
(!requestStatus.status ? (
|
||||||
|
<div
|
||||||
|
className={`relative p-4 my-4 text-[#912741] bg-[#fcd9e2] border-[#fbc6d3] mb-4 rounded-[0.475rem] text-md font-light leading-[19.5px] text-[13px]`}
|
||||||
|
>
|
||||||
|
{requestStatus.message}
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
requestStatus.status && (
|
||||||
|
<div
|
||||||
|
className={`relative p-4 my-4 text-green-700 bg-slate-200 border-slate-800 mb-4 rounded-[0.475rem] text-md font-light leading-[19.5px] text-[13px]`}
|
||||||
|
>
|
||||||
|
{requestStatus.message}
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
))}
|
||||||
|
{/* End of error or success display */}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* close button */}
|
||||||
|
<div className="p-6 flex justify-end">
|
||||||
|
<button
|
||||||
|
onClick={onClose}
|
||||||
|
disabled={requestStatus.loading}
|
||||||
|
type="button"
|
||||||
|
className="border-gradient text-18 tracking-wide px-2 py-2 rounded-full"
|
||||||
|
>
|
||||||
|
<span className="text-gradient">Cancel</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
{/* end of close button */}
|
||||||
|
</div>
|
||||||
|
</ModalCom>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default FamilyOfferJobPopout;
|
||||||
@@ -253,7 +253,7 @@ function JobListPopout({ details, onClose, situation }) {
|
|||||||
>
|
>
|
||||||
{(props) => {
|
{(props) => {
|
||||||
return (
|
return (
|
||||||
<Form className="mb-4">
|
<Form className="mb-4 hidden">
|
||||||
{/* Assign to Family */}
|
{/* Assign to Family */}
|
||||||
<JobFieldInput
|
<JobFieldInput
|
||||||
label="Assign to family"
|
label="Assign to family"
|
||||||
|
|||||||
+21
-3
@@ -11,6 +11,14 @@
|
|||||||
font-family: "Product Sans";
|
font-family: "Product Sans";
|
||||||
src: url("./assets/fonts/Product Sans Bold.ttf");
|
src: url("./assets/fonts/Product Sans Bold.ttf");
|
||||||
}
|
}
|
||||||
|
.SENDER{
|
||||||
|
margin-left: 60px !important;
|
||||||
|
background-color: azure;
|
||||||
|
}
|
||||||
|
.RECIPIENT{
|
||||||
|
margin-right: 60px !important;
|
||||||
|
background-color: #add8e6 !important;
|
||||||
|
}
|
||||||
.wallet-box{
|
.wallet-box{
|
||||||
background-color: aliceblue;
|
background-color: aliceblue;
|
||||||
border-radius: 20px;
|
border-radius: 20px;
|
||||||
@@ -24,6 +32,13 @@
|
|||||||
.referral{
|
.referral{
|
||||||
margin-bottom: 20px
|
margin-bottom: 20px
|
||||||
}
|
}
|
||||||
|
.task_action_panel{
|
||||||
|
font-family: sans; color: white;
|
||||||
|
font-weight: bolder;
|
||||||
|
font-size: 14px;
|
||||||
|
font-family: Circular, Helvetica Neue, Helvetica, Roboto, Arial, sans-serif;
|
||||||
|
padding: 0px 10px 5px 10px
|
||||||
|
}
|
||||||
.heroSilderTitle{
|
.heroSilderTitle{
|
||||||
text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;
|
text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;
|
||||||
font-family: sans; color: white;
|
font-family: sans; color: white;
|
||||||
@@ -34,7 +49,7 @@
|
|||||||
min-width: 280px !important;
|
min-width: 280px !important;
|
||||||
}
|
}
|
||||||
.job-action{
|
.job-action{
|
||||||
background-color: aliceblue;
|
background-color: #4687ba;
|
||||||
height: 100px;
|
height: 100px;
|
||||||
border-radius: 15px;
|
border-radius: 15px;
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
@@ -47,9 +62,12 @@
|
|||||||
border-radius: 15px;
|
border-radius: 15px;
|
||||||
}
|
}
|
||||||
.msg_header{
|
.msg_header{
|
||||||
background-color: #1a3544;
|
background-color: white;
|
||||||
color: white;
|
color: black;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
|
border-radius: 9px;
|
||||||
|
font-size: 14px;
|
||||||
|
font-family: Circular, Helvetica Neue, Helvetica, Roboto, Arial, sans-serif;
|
||||||
}
|
}
|
||||||
.siderCardDescription{
|
.siderCardDescription{
|
||||||
background-color: aliceblue;
|
background-color: aliceblue;
|
||||||
|
|||||||
@@ -216,6 +216,7 @@ class usersService {
|
|||||||
return this.postAuxEnd("/sendmoneyfee", postData);
|
return this.postAuxEnd("/sendmoneyfee", postData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Start Credit for Cards
|
||||||
getStartCredit(value) {
|
getStartCredit(value) {
|
||||||
var postData = {
|
var postData = {
|
||||||
uid: localStorage.getItem("uid"),
|
uid: localStorage.getItem("uid"),
|
||||||
@@ -227,6 +228,7 @@ class usersService {
|
|||||||
return this.postAuxEnd("/startcredit", postData);
|
return this.postAuxEnd("/startcredit", postData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Paying using Previous Cards
|
||||||
getPaidPrevCard(value) {
|
getPaidPrevCard(value) {
|
||||||
var postData = {
|
var postData = {
|
||||||
uid: localStorage.getItem("uid"),
|
uid: localStorage.getItem("uid"),
|
||||||
@@ -238,6 +240,18 @@ class usersService {
|
|||||||
return this.postAuxEnd("/payprevcard", postData);
|
return this.postAuxEnd("/payprevcard", postData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Paying using New Card
|
||||||
|
getPaidNewCard(value) {
|
||||||
|
var postData = {
|
||||||
|
uid: localStorage.getItem("uid"),
|
||||||
|
member_id: localStorage.getItem("member_id"),
|
||||||
|
sessionid: localStorage.getItem("session_token"),
|
||||||
|
action: 11054,
|
||||||
|
...value,
|
||||||
|
};
|
||||||
|
return this.postAuxEnd("/paynewcard", postData);
|
||||||
|
}
|
||||||
|
|
||||||
getFamilySampleTasks() {
|
getFamilySampleTasks() {
|
||||||
var postData = {
|
var postData = {
|
||||||
uid: localStorage.getItem("uid"),
|
uid: localStorage.getItem("uid"),
|
||||||
@@ -944,6 +958,18 @@ class usersService {
|
|||||||
return this.postAuxEnd("/getaccsettings", postData);
|
return this.postAuxEnd("/getaccsettings", postData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FUNCTION TO SET ACCOUNT SETTINGS
|
||||||
|
setAccSettings(reqdata) {
|
||||||
|
var postData = {
|
||||||
|
uid: localStorage.getItem("uid"),
|
||||||
|
member_id: localStorage.getItem("member_id"),
|
||||||
|
sessionid: localStorage.getItem("session_token"),
|
||||||
|
action: 11058,
|
||||||
|
...reqdata,
|
||||||
|
};
|
||||||
|
return this.postAuxEnd("/setaccsettings", postData);
|
||||||
|
}
|
||||||
|
|
||||||
// FUNCTION TO DELETE PAY CARD
|
// FUNCTION TO DELETE PAY CARD
|
||||||
payRemCard(reqData) {
|
payRemCard(reqData) {
|
||||||
var postData = {
|
var postData = {
|
||||||
|
|||||||
Reference in New Issue
Block a user