From 7c2f90b1b8811c7509cd4b4836fd04d775d2486b Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Sun, 14 May 2023 13:33:08 -0400 Subject: [PATCH] active pending jobs --- src/Routers.jsx | 2 + .../MyPendingJobs/MyPendingJobTable.jsx | 112 ++++++++++++++++++ src/components/MyPendingJobs/index.jsx | 41 +++++++ src/components/Partials/Sidebar.jsx | 2 +- src/views/MyPendingJobsPage.jsx | 30 +++++ 5 files changed, 186 insertions(+), 1 deletion(-) create mode 100644 src/components/MyPendingJobs/MyPendingJobTable.jsx create mode 100644 src/components/MyPendingJobs/index.jsx create mode 100644 src/views/MyPendingJobsPage.jsx diff --git a/src/Routers.jsx b/src/Routers.jsx index 4354c41..9670cec 100644 --- a/src/Routers.jsx +++ b/src/Routers.jsx @@ -35,6 +35,7 @@ import MyActiveJobsPage from "./views/MyActiveJobsPage"; import FamilyAccPage from "./views/FamilyAccPage"; import StartJob from "./components/MyJobs/StartJob"; import AddJobPage from "./views/AddJobPage"; +import MyPendingJobsPage from "./views/MyPendingJobsPage"; export default function Routers() { return ( @@ -79,6 +80,7 @@ export default function Routers() { } /> } /> } /> + } /> } /> } /> { + handlePagingFunc(e,setCurrentPage) + } + + return ( +
+ {MyJobList && MyJobList?.result_list && +
+ + + {/**/} + {/* */} + {/* */} + {/**/} + + { + <> + {MyJobList && MyJobList?.result_list && + MyJobList.result_list.length > 0 && + currentActiveJobList.map((value, index) => ( + + + + + + + ))} + + + + } + +
All Product.
+
+
+ data +
+
+

+ {value.title} +

+
+ {value.description} +
+ + Price: {value.price*0.01} + + + Duration: {value.timeline_days} day(s) + + + Expire: {value.expire} + + + Send to: {value.job_to} + + +
+
+
+ +
+ {/* PAGINATION BUTTON */} + = MyJobList?.result_list.length ? true : false} data={MyJobList?.result_list} start={indexOfFirstItem} stop={indexOfLastItem} /> + {/* END OF PAGINATION BUTTON */} +
+ } + + {/* Active Job Popout */} + {jobPopout.show && + {setJobPopout({show:false, data:{}})}} situation={jobPopout.show} /> + } + {/* End of Active Job Popout */} +
+ ); +} diff --git a/src/components/MyPendingJobs/index.jsx b/src/components/MyPendingJobs/index.jsx new file mode 100644 index 0000000..b8470ea --- /dev/null +++ b/src/components/MyPendingJobs/index.jsx @@ -0,0 +1,41 @@ +import React, { useState } from "react"; +import { Link } from "react-router-dom"; +import Layout from "../Partials/Layout"; +import CommonHead from "../UserHeader/CommonHead"; +import MyPendingJobTable from "./MyPendingJobTable"; + +export default function MyPendingJobs(props) { + const [selectTab, setValue] = useState("today"); + const filterHandler = (value) => { + setValue(value); + }; + console.log("AMEYE LOC1", props.MyJobList); + return ( + + +
+
+ {/* heading */} +
+
+

+ + Pending Job(s) + + +

+
+
+
filterHandler("today")} className="relative"> + +
+
+
+ +
+
+
+ ); +} diff --git a/src/components/Partials/Sidebar.jsx b/src/components/Partials/Sidebar.jsx index 0d396b7..40c746b 100644 --- a/src/components/Partials/Sidebar.jsx +++ b/src/components/Partials/Sidebar.jsx @@ -279,7 +279,7 @@ export default function Sidebar({ sidebar, action, logoutModalHandler }) {
  • (navData.isActive ? "active" : ""), sidebar ? "justify-start space-x-3.5" : "justify-center") diff --git a/src/views/MyPendingJobsPage.jsx b/src/views/MyPendingJobsPage.jsx new file mode 100644 index 0000000..c3a1fb4 --- /dev/null +++ b/src/views/MyPendingJobsPage.jsx @@ -0,0 +1,30 @@ +import React, { useContext,useState, useEffect } from "react"; +import usersService from "../services/UsersService"; +//import MyJobs from "../components/MyJobs"; +import MyActiveJobs from "../components/MyActiveJobs"; +import MyPendingJobs from "../components/MyPendingJobs"; + +export default function MyPendingJobsPage() { + + const [MyJobList, setMyJobList] = useState([]); + const api = new usersService(); + + const getMyJobList = async () => { + try { + const res = await api.getMyActiveJobList(); + setMyJobList(res.data); + } catch (error) { + console.log("Error getting mode"); + } + }; + useEffect(() => { + getMyJobList(); + }, []); + + // debugger; + return ( + <> + + + ); +}