Compare commits
26 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c106e66f44 | |||
| 222c739663 | |||
| 96972dbe2f | |||
| 7146048aee | |||
| 39f1f5bc73 | |||
| 752fc6a4a8 | |||
| 608d5b92f1 | |||
| 45563cc59b | |||
| b027e20c20 | |||
| bbe0777496 | |||
| 27efbe362b | |||
| 878539a56a | |||
| 6ae408029d | |||
| 8016d1bd12 | |||
| 0e9fef218f | |||
| 8116665045 | |||
| e4addc47d9 | |||
| 1682f11efd | |||
| 80b2abf9e3 | |||
| 5edecb6464 | |||
| 3a479b3573 | |||
| 4034909836 | |||
| 8fc61a6289 | |||
| 940a12a2e9 | |||
| a9f671eeaa | |||
| 481924fa02 |
Binary file not shown.
|
After Width: | Height: | Size: 94 KiB |
@@ -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,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -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>
|
||||||
@@ -457,7 +459,7 @@ 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}
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
+28
-15
@@ -1,13 +1,13 @@
|
|||||||
import React, { useEffect, useState } from "react";
|
import React, { useEffect, 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 InputCom from "../Helpers/Inputs/InputCom";
|
import InputCom from "../../Helpers/Inputs/InputCom";
|
||||||
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
import LoadingSpinner from "../../Spinners/LoadingSpinner";
|
||||||
|
|
||||||
import { Form, Formik } from "formik";
|
import { Form, Formik } from "formik";
|
||||||
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 Icons from "../../Helpers/Icons";
|
||||||
|
|
||||||
const validationSchema = Yup.object().shape({
|
const validationSchema = Yup.object().shape({
|
||||||
name: Yup.string()
|
name: Yup.string()
|
||||||
@@ -65,7 +65,8 @@ function AddFundDollars(props) {
|
|||||||
const { firstname, lastname } = 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: [] });
|
||||||
|
let __awaitComponent = props.confirmCredit.show.awaitConfirm;
|
||||||
|
let __acceptComponent = props.confirmCredit.show.awaitConfirm;
|
||||||
const handleInputChange = (event) => {
|
const handleInputChange = (event) => {
|
||||||
const { name, value } = event.target;
|
const { name, value } = event.target;
|
||||||
setPrevCardDetails((prevState) => ({
|
setPrevCardDetails((prevState) => ({
|
||||||
@@ -84,6 +85,7 @@ function AddFundDollars(props) {
|
|||||||
|
|
||||||
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");
|
||||||
return;
|
return;
|
||||||
@@ -98,7 +100,12 @@ function AddFundDollars(props) {
|
|||||||
if (!prevCardDetails) {
|
if (!prevCardDetails) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
setLoader(true);
|
|
||||||
|
props.setConfirmCredit((prev) => ({
|
||||||
|
...prev,
|
||||||
|
show: { awaitConfirm: { loader: true } },
|
||||||
|
}));
|
||||||
|
|
||||||
let stateData = {
|
let stateData = {
|
||||||
amount: Number(props.input) * 100,
|
amount: Number(props.input) * 100,
|
||||||
currency: props.walletItem?.code,
|
currency: props.walletItem?.code,
|
||||||
@@ -107,7 +114,10 @@ function AddFundDollars(props) {
|
|||||||
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);
|
props.setConfirmCredit((prev) => ({
|
||||||
|
...prev,
|
||||||
|
show: { awaitConfirm: { loader: false } },
|
||||||
|
}));
|
||||||
props.setInputError("An Error Occurred");
|
props.setInputError("An Error Occurred");
|
||||||
setTimeout(() => props.setInputError(""), 5000);
|
setTimeout(() => props.setInputError(""), 5000);
|
||||||
return;
|
return;
|
||||||
@@ -120,20 +130,21 @@ function AddFundDollars(props) {
|
|||||||
stateData = { ...stateData, ..._response };
|
stateData = { ...stateData, ..._response };
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
setLoader(false);
|
|
||||||
props.setConfirmCredit({
|
props.setConfirmCredit({
|
||||||
show: true,
|
show: {
|
||||||
|
awaitConfirm: { loader: false, state: true },
|
||||||
|
acceptConfirm: { loader: false, state: false },
|
||||||
|
},
|
||||||
data: stateData,
|
data: stateData,
|
||||||
});
|
});
|
||||||
}, 1500);
|
}, 1500);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
props.setConfirmCredit((prev) => ({
|
||||||
|
...prev,
|
||||||
|
show: { awaitConfirm: { loader: false } },
|
||||||
|
}));
|
||||||
console.log(error);
|
console.log(error);
|
||||||
}
|
}
|
||||||
|
|
||||||
return setTimeout(() => {
|
|
||||||
props.setConfirmCredit({ show: true, data: stateData });
|
|
||||||
setLoader(false);
|
|
||||||
}, 1500);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tab === "new") {
|
if (tab === "new") {
|
||||||
@@ -142,6 +153,8 @@ function AddFundDollars(props) {
|
|||||||
currency: props.currency,
|
currency: props.currency,
|
||||||
...values,
|
...values,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Rest of the code for tab "new"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -501,7 +514,7 @@ function AddFundDollars(props) {
|
|||||||
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-[100px] 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,106 @@
|
|||||||
|
import React from "react";
|
||||||
|
|
||||||
|
function CompleteConfirmCredit({ onClose, confirmCredit }) {
|
||||||
|
console.log(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">
|
||||||
|
{/* 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>
|
||||||
|
|
||||||
|
<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>
|
||||||
|
</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;
|
||||||
+100
-40
@@ -1,13 +1,17 @@
|
|||||||
|
import { FlutterWaveButton, closePaymentModal } from "flutterwave-react-v3";
|
||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
import { useSelector } from "react-redux";
|
import { useSelector } from "react-redux";
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
import { toast } from "react-toastify";
|
import { toast } from "react-toastify";
|
||||||
|
import usersService from "../../../services/UsersService";
|
||||||
|
import LoadingSpinner from "../../Spinners/LoadingSpinner";
|
||||||
|
|
||||||
import usersService from "../../services/UsersService";
|
function ConfirmAddFund({
|
||||||
|
confirmCredit,
|
||||||
import { FlutterWaveButton, closePaymentModal } from "flutterwave-react-v3";
|
onClose,
|
||||||
|
walletItem,
|
||||||
function ConfirmAddFund({ confirmCredit, onClose, walletItem }) {
|
setConfirmCredit,
|
||||||
|
}) {
|
||||||
const __confirmData = confirmCredit?.data;
|
const __confirmData = confirmCredit?.data;
|
||||||
const __confirmCountry = walletItem?.country;
|
const __confirmCountry = walletItem?.country;
|
||||||
const __confirmCardDetails = __confirmData.card
|
const __confirmCardDetails = __confirmData.card
|
||||||
@@ -15,8 +19,6 @@ function ConfirmAddFund({ confirmCredit, onClose, walletItem }) {
|
|||||||
: "";
|
: "";
|
||||||
let { userDetails } = useSelector((state) => state.userDetails); // TO GET LOGGEDIN USER DETAILS
|
let { userDetails } = useSelector((state) => state.userDetails); // TO GET LOGGEDIN USER DETAILS
|
||||||
|
|
||||||
let [confirmLoading, setConfirmLoading] = useState(false);
|
|
||||||
|
|
||||||
let [requestStatus, setRequestStatus] = useState({
|
let [requestStatus, setRequestStatus] = useState({
|
||||||
message: "",
|
message: "",
|
||||||
loading: false,
|
loading: false,
|
||||||
@@ -29,7 +31,7 @@ function ConfirmAddFund({ confirmCredit, onClose, walletItem }) {
|
|||||||
//FUNCTION TO HANDLE SUBMIT
|
//FUNCTION TO HANDLE SUBMIT
|
||||||
const onSuccessPayment = () => {
|
const onSuccessPayment = () => {
|
||||||
setRequestStatus({ message: "", loading: true, status: false });
|
setRequestStatus({ message: "", loading: true, status: false });
|
||||||
let reqData = { amount: confirmCredit?.data?.account, currency: "NGN" };
|
let reqData = { amount: __confirmData?.account, currency: "NGN" };
|
||||||
apiURL
|
apiURL
|
||||||
.startTopUp(reqData)
|
.startTopUp(reqData)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
@@ -66,7 +68,7 @@ function ConfirmAddFund({ confirmCredit, onClose, walletItem }) {
|
|||||||
const config = {
|
const config = {
|
||||||
public_key: process.env.REACT_APP_FLUTTERWAVE_APIKEY,
|
public_key: process.env.REACT_APP_FLUTTERWAVE_APIKEY,
|
||||||
tx_ref: Date.now(),
|
tx_ref: Date.now(),
|
||||||
amount: confirmCredit?.data?.amount,
|
amount: __confirmData?.amount,
|
||||||
currency: "NGN",
|
currency: "NGN",
|
||||||
payment_options: "card,mobilemoney,ussd",
|
payment_options: "card,mobilemoney,ussd",
|
||||||
customer: {
|
customer: {
|
||||||
@@ -91,24 +93,58 @@ function ConfirmAddFund({ confirmCredit, onClose, walletItem }) {
|
|||||||
onClose: () => {},
|
onClose: () => {},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Handling Previous Card
|
||||||
const handlePrevCard = async () => {
|
const handlePrevCard = async () => {
|
||||||
setConfirmLoading(true);
|
const { amount, credit_reference, currency } = __confirmData;
|
||||||
let reqData = {
|
const { card_uid } = __confirmCardDetails;
|
||||||
amount: __confirmData.amount * 100,
|
|
||||||
card_uid: __confirmCardDetails.card_uid,
|
const reqData = {
|
||||||
credit_reference: __confirmData.credit_reference,
|
amount: amount * 100,
|
||||||
currency: __confirmData.currency,
|
card_uid,
|
||||||
|
credit_reference,
|
||||||
|
currency,
|
||||||
};
|
};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
setConfirmCredit((prev) => ({
|
||||||
|
...prev,
|
||||||
|
show: {
|
||||||
|
acceptConfirm: { loader: true },
|
||||||
|
},
|
||||||
|
}));
|
||||||
const res = await apiURL.getPaidPrevCard(reqData);
|
const res = await apiURL.getPaidPrevCard(reqData);
|
||||||
setConfirmLoading(false);
|
const _response = res.data;
|
||||||
console.log(res.data);
|
if (res.data.internal_return < 0) {
|
||||||
|
setConfirmCredit((prev) => ({
|
||||||
|
...prev,
|
||||||
|
show: {
|
||||||
|
acceptConfirm: { loader: false },
|
||||||
|
},
|
||||||
|
}));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
return setTimeout(
|
||||||
|
() =>
|
||||||
|
setConfirmCredit((prev) => ({
|
||||||
|
...prev,
|
||||||
|
show: {
|
||||||
|
awaitConfirm: { loader: false, state: false },
|
||||||
|
acceptConfirm: { loader: false, state: true },
|
||||||
|
},
|
||||||
|
data: _response,
|
||||||
|
})),
|
||||||
|
1500
|
||||||
|
);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
setConfirmLoading(false);
|
setConfirmCredit((prev) => ({
|
||||||
|
...prev,
|
||||||
|
show: {
|
||||||
|
acceptConfirm: { loader: false },
|
||||||
|
},
|
||||||
|
}));
|
||||||
console.log(error);
|
console.log(error);
|
||||||
}
|
}
|
||||||
console.log("Test me");
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const ThePaymentText = ({ value }) => (
|
const ThePaymentText = ({ value }) => (
|
||||||
@@ -124,16 +160,15 @@ function ConfirmAddFund({ confirmCredit, onClose, walletItem }) {
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
||||||
console.log(confirmCredit);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="content-wrapper w-full h-[32rem]">
|
<div className="content-wrapper w-full h-[32rem]">
|
||||||
<div className="w-full mb-10">
|
<div className="w-full mb-10">
|
||||||
<div className="add-fund w-full bg-white dark:bg-dark-white rounded-2xl">
|
<div className="add-fund w-full bg-white dark:bg-dark-white rounded-2xl">
|
||||||
<div className="px-4 md:p-8 py-4 add-fund-info">
|
<div className="px-4 md:p-8 py-4 add-fund-info">
|
||||||
<div className="field w-full mb-3 min-h-[45px]">
|
<div className="field w-full mb-3 min-h-[45px]">
|
||||||
{confirmCredit?.show ? (
|
{confirmCredit?.show?.awaitConfirm?.state ? (
|
||||||
<div className="flex flex-col gap-4">
|
<div className="flex flex-col gap-2">
|
||||||
|
{/* Amount */}
|
||||||
<div
|
<div
|
||||||
className={`flex items-center ${
|
className={`flex items-center ${
|
||||||
__confirmCountry == "US" ? "gap-14" : "gap-4"
|
__confirmCountry == "US" ? "gap-14" : "gap-4"
|
||||||
@@ -148,6 +183,40 @@ function ConfirmAddFund({ confirmCredit, onClose, walletItem }) {
|
|||||||
}`}
|
}`}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
{/* Transaction Fee */}
|
||||||
|
<div
|
||||||
|
className={`flex items-center border-b border-gray-600 ${
|
||||||
|
__confirmCountry == "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">
|
||||||
|
{`${walletItem?.symbol} ${
|
||||||
|
Number(__confirmData?.fee).toLocaleString() || ""
|
||||||
|
}`}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
{/* Total */}
|
||||||
|
<div
|
||||||
|
className={`flex items-center ${
|
||||||
|
__confirmCountry == "US" ? "gap-[8rem]" : "gap-4"
|
||||||
|
}`}
|
||||||
|
>
|
||||||
|
<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">
|
||||||
|
{`${walletItem?.symbol} ${
|
||||||
|
(
|
||||||
|
Number(__confirmData?.amount) +
|
||||||
|
Number(__confirmData?.fee)
|
||||||
|
).toLocaleString() || ""
|
||||||
|
}`}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
{__confirmCountry == "US" && (
|
{__confirmCountry == "US" && (
|
||||||
<div className="flex items-center gap-8">
|
<div className="flex items-center gap-8">
|
||||||
<label
|
<label
|
||||||
@@ -180,12 +249,13 @@ function ConfirmAddFund({ confirmCredit, onClose, walletItem }) {
|
|||||||
) : null}
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{/* <hr /> */}
|
|
||||||
<div
|
<div
|
||||||
className={
|
className={
|
||||||
__confirmCountry == "US" ? "min-h-[163px]" : "min-h-[200px]"
|
__confirmCountry == "US" ? "min-h-[96px]" : "min-h-[200px]"
|
||||||
}
|
}
|
||||||
></div>
|
></div>
|
||||||
|
<hr />
|
||||||
<div className="md:p-8 p-4 add-fund-btn flex justify-end items-center py-4 gap-4">
|
<div className="md:p-8 p-4 add-fund-btn flex justify-end items-center py-4 gap-4">
|
||||||
<button
|
<button
|
||||||
className="px-4 h-11 flex justify-center items-center border-gradient text-base rounded-full"
|
className="px-4 h-11 flex justify-center items-center border-gradient text-base rounded-full"
|
||||||
@@ -202,7 +272,11 @@ function ConfirmAddFund({ confirmCredit, onClose, walletItem }) {
|
|||||||
: () => console.log("Test me")
|
: () => console.log("Test me")
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
Proceed
|
{confirmCredit?.show?.acceptConfirm?.loader ? (
|
||||||
|
<LoadingSpinner size="6" color="sky-blue" />
|
||||||
|
) : (
|
||||||
|
"Proceed"
|
||||||
|
)}
|
||||||
</button>
|
</button>
|
||||||
)}
|
)}
|
||||||
{__confirmCountry == "NG" && (
|
{__confirmCountry == "NG" && (
|
||||||
@@ -214,20 +288,6 @@ function ConfirmAddFund({ confirmCredit, onClose, walletItem }) {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</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>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
+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,13 @@ 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?.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 +59,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>
|
||||||
|
|||||||
+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>
|
||||||
@@ -11,12 +11,12 @@ 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 AddRecipient = lazy(() => import("./AddRecipient"));
|
||||||
const ConfirmTransfer = lazy(() => import("./ConfirmTransfer"));
|
// const ConfirmTransfer = lazy(() => import("./ConfirmTransfer"));
|
||||||
|
|
||||||
function Wallet() {
|
function Wallet() {
|
||||||
return (
|
return (
|
||||||
@@ -119,31 +119,6 @@ const WalletRoutes = () => {
|
|||||||
</Suspense>
|
</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
|
<Route
|
||||||
index
|
index
|
||||||
element={
|
element={
|
||||||
@@ -152,22 +127,6 @@ const WalletRoutes = () => {
|
|||||||
</Suspense>
|
</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 path="*" element={<Navigate to="/" />} />
|
||||||
</Route>
|
</Route>
|
||||||
</Routes>
|
</Routes>
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -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} />
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
import ProductCardStyleTwo from "../../Cards/ProductCardStyleTwo";
|
||||||
|
import DataIteration from "../../Helpers/DataIteration";
|
||||||
|
import SearchCom from "../../Helpers/SearchCom";
|
||||||
|
|
||||||
|
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-full items-center sm:flex justify-between mb-6">
|
||||||
|
{/* filter-search */}
|
||||||
|
<div className="sm:w-1/2 w-full sm:pr-20 pr-0 mb-5 sm:mb-0">
|
||||||
|
<SearchCom />
|
||||||
|
</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>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -944,6 +944,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