diff --git a/src/components/JobGroups/GroupMemberTable.jsx b/src/components/JobGroups/GroupMemberTable.jsx index 012e740..bf04139 100644 --- a/src/components/JobGroups/GroupMemberTable.jsx +++ b/src/components/JobGroups/GroupMemberTable.jsx @@ -34,7 +34,7 @@ export default function GroupMemberTable({ selectedList }) { return (
@@ -79,8 +79,8 @@ export default function GroupMemberTable({ selectedList }) { )) ) : ( - - + + )} diff --git a/src/components/JobGroups/MemberList.jsx b/src/components/JobGroups/MemberList.jsx index 3293b69..095378c 100644 --- a/src/components/JobGroups/MemberList.jsx +++ b/src/components/JobGroups/MemberList.jsx @@ -277,7 +277,7 @@ export default function MemberList({ )} -
+
{selectedGroup?.data?.length < 1 ? (

No Member Found, Please Add diff --git a/src/components/MyJobs/MyJobTable.jsx b/src/components/MyJobs/MyJobTable.jsx index 6f46aac..4b4ffde 100644 --- a/src/components/MyJobs/MyJobTable.jsx +++ b/src/components/MyJobs/MyJobTable.jsx @@ -1,19 +1,17 @@ import { useCallback, useEffect, useMemo, useState } from "react"; -import dataImage2 from "../../assets/images/data-table-user-2.png"; -import SelectBox from "../Helpers/SelectBox"; -import DeleteJobPopout from "../jobPopout/DeleteJobPopout"; -import JobListPopout from "../jobPopout/JobListPopout"; -import LoadingSpinner from "../Spinners/LoadingSpinner"; import { useSelector } from "react-redux"; import usersService from "../../services/UsersService"; +import { PriceFormatter } from "../Helpers/PriceFormatter"; +import SelectBox from "../Helpers/SelectBox"; import { handlePagingFunc } from "../Pagination/HandlePagination"; import PaginatedList from "../Pagination/PaginatedList"; +import LoadingSpinner from "../Spinners/LoadingSpinner"; +import DeleteJobPopout from "../jobPopout/DeleteJobPopout"; import EditJobPopOut from "../jobPopout/EditJobPopout"; -import { PriceFormatter } from "../Helpers/PriceFormatter"; -import EditIcon from "../../assets/images/icon-edit.svg"; import DeleteIcon from "../../assets/images/icon-delete.svg"; -import localImgLoad from "../../lib/localImgLoad"; +import EditIcon from "../../assets/images/icon-edit.svg"; +import JobListPopout from "../jobPopout/JobListPopout"; export default function MyJobTable({ MyJobList, reloadJobList, className }) { // Getting the categories @@ -42,7 +40,6 @@ export default function MyJobTable({ MyJobList, reloadJobList, className }) { // Get Country Api const getCountryList = useCallback(async () => { - try { const res = await userApi.getSignupCountryData(); if (res.status === 200 && res.data.internal_return >= 0) { @@ -59,7 +56,7 @@ export default function MyJobTable({ MyJobList, reloadJobList, className }) { throw new Error(error); } }, [userApi, country]); - console.log('MY COUNTRY', myCountry) + useEffect(() => { getCountryList(); }, [getCountryList]); @@ -201,6 +198,55 @@ export default function MyJobTable({ MyJobList, reloadJobList, className }) { ); }; + const MyJobListTable = () => ( +
+

No Members Found
No Members Found. Please add
+ + <> + {MyJobList && + MyJobList?.data?.result_list && + MyJobList.data?.result_list.length > 0 ? ( + filteredCurrentJobList?.length ? ( + filteredCurrentJobList.map((value, index) => ( + + )) + ) : ( + + + + ) + ) : ( + + + + )} + + +
No Jobs Available In This Category!
No Jobs Available!
+ + {/* PAGINATION BUTTON */} + = + currentJobList?.length + ? true + : false + } + data={currentJobList} + start={indexOfFirstItem} + stop={indexOfLastItem} + /> + {/* END OF PAGINATION BUTTON */} +
+ ); + return (
) : ( -
- - - <> - {MyJobList && - MyJobList?.data?.result_list && - MyJobList.data?.result_list.length > 0 ? ( - filteredCurrentJobList?.length ? ( - filteredCurrentJobList.map((value, index) => ( - - )) - ) : ( - - - - ) - ) : ( - - - - )} - - -
- No Jobs Available In This Category! -
No Jobs Avaliable!
- - {/* PAGINATION BUTTON */} - = - currentJobList?.length - ? true - : false - } - data={currentJobList} - start={indexOfFirstItem} - stop={indexOfLastItem} - /> - {/* END OF PAGINATION BUTTON */} -
+ )} {/* Job List Popout */} diff --git a/src/components/jobPopout/JobListPopout.jsx b/src/components/jobPopout/JobListPopout.jsx index 3e991a9..301b725 100644 --- a/src/components/jobPopout/JobListPopout.jsx +++ b/src/components/jobPopout/JobListPopout.jsx @@ -1,11 +1,12 @@ import { Field, Form, Formik } from "formik"; import React, { useCallback, useEffect, useMemo, useState } from "react"; -import { useDispatch } from "react-redux"; +import { useDispatch, useSelector } from "react-redux"; import * as Yup from "yup"; import usersService from "../../services/UsersService"; import { tableReload } from "../../store/TableReloads"; import InputCom from "../Helpers/Inputs/InputCom/index"; import ModalCom from "../Helpers/ModalCom"; +import { PriceFormatter } from "../Helpers/PriceFormatter"; import LoadingSpinner from "../Spinners/LoadingSpinner"; import Detail from "./popoutcomponent/Detail"; @@ -45,6 +46,24 @@ function JobListPopout({ details, onClose, situation }) { }); const apiCall = useMemo(() => new usersService(), []); + const { walletDetails } = useSelector((state) => state.walletDetails); + + const getWalletDetail = (currency) => { + // A FUNCTION TO GET USER BALANCE BASED ON TASK CURRENCY + const walletChecker = walletDetails?.data.find( + (item) => item.description === currency + ); + return walletChecker + ? { + description: walletChecker.description, + country: walletChecker.country, + code: walletChecker.code, + amount: walletChecker.amount, + } + : 0; + }; + + const taskWalletSelector = getWalletDetail(details?.currency); // member listing const memberList = useCallback(async () => { @@ -219,7 +238,7 @@ function JobListPopout({ details, onClose, situation }) { }); }, []); - // console.log("Job List P >> ", details) + console.log("wallet >> ", walletDetails, details, taskWalletSelector); return (
@@ -295,188 +314,193 @@ function JobListPopout({ details, onClose, situation }) {
- {/* ACTION SECTION */} -
-

- Send this Task to: -

-
-
- {tabs.map((item) => ( - + ))} +
+
+ {selectedTab == "family" && ( + + {(props) => { + return ( +
+ {/* Assign to Family */} + +

+ {" "} + {props?.values?.family === "" && ( + {errMsg?.jobFields?.family} + )} +

{" "} + + ); + }} +
+ )} + + {selectedTab == "public" && ( + + {(props) => { + return ( +
+ {/* Offer this job to public input */} + +

+ {" "} + {props?.values.public === "" && ( + {errMsg?.jobFields?.public} + )} +

{" "} + + ); + }} +
+ )} + + {selectedTab == "individual" && ( + + {(props) => { + return ( +
+ {/* Offer this job to individual input */} + +

+ {" "} + {props?.values.individual === "" && ( + {errMsg?.jobFields?.individual} + )} +

{" "} + + ); + }} +
+ )} + + {/* { process.env.REACT_APP_SHOW_OFFER_GROUP_JOB != 0 && } */} + {selectedTab == "group" && ( + + {(props) => { + return ( +
+ {/* Offer this job to your group input */} + +

+ {" "} + {props?.values.group === "" && ( + {errMsg?.jobFields?.group} + )} +

+ + ); + }} +
+ )} +

- {item[0].toUpperCase() + item.slice(1)} - - ))} + > + {requestStatus.message && requestStatus.message} +

+
+
-
- {selectedTab == "family" && ( - - {(props) => { - return ( -
- {/* Assign to Family */} - -

- {" "} - {props?.values?.family === "" && ( - {errMsg?.jobFields?.family} - )} -

{" "} - - ); - }} -
- )} + ) : ( + + )} - {selectedTab == "public" && ( - - {(props) => { - return ( -
- {/* Offer this job to public input */} - -

- {" "} - {props?.values.public === "" && ( - {errMsg?.jobFields?.public} - )} -

{" "} - - ); - }} -
- )} - - {selectedTab == "individual" && ( - - {(props) => { - return ( -
- {/* Offer this job to individual input */} - -

- {" "} - {props?.values.individual === "" && ( - {errMsg?.jobFields?.individual} - )} -

{" "} - - ); - }} -
- )} - - {/* { process.env.REACT_APP_SHOW_OFFER_GROUP_JOB != 0 && } */} - {selectedTab == "group" && ( - - {(props) => { - return ( -
- {/* Offer this job to your group input */} - -

- {" "} - {props?.values.group === "" && ( - {errMsg?.jobFields?.group} - )} -

- - ); - }} -
- )} -

- {requestStatus.message && requestStatus.message} -

-
- - {/* - {requestStatus.message && -

{requestStatus.message}

- } */} - - {/* END OF ACTION SECTION */} + {/* END OF ACTION SECTION */} + @@ -628,3 +652,19 @@ const publicArray = [ { duration: 21, name: "3 weeks" }, { duration: 28, name: "4 weeks" }, ]; + +const ZeroBalanceChecker = ({ amount, code, country }) => { + let thePrice = PriceFormatter(amount * 0.01, code, country); + + return ( +
+

+ Wallet Balance:{` ${code} ${amount}`} +

+

You do not have sufficient balance to assign this task

+ +
+ ); +};