Compare commits

...

27 Commits

Author SHA1 Message Date
victorAnumudu 06549bf9bb Displays countdown if task is yet to pass due, else displays due time 2023-06-06 20:52:15 +01:00
ameye 2cd7ce9392 Merge branch 'active-task-header-upgrade' of WrenchBoard/Users-Wrench into master 2023-06-06 18:14:47 +00:00
CHIEFSOFT\ameye 835b583056 past due pages 2023-06-06 13:33:43 -04:00
CHIEFSOFT\ameye b72d9ccc35 past due jobs 2023-06-06 12:34:18 -04:00
CHIEFSOFT\ameye 225166a8be Home banners background 2023-06-06 12:05:45 -04:00
CHIEFSOFT\ameye b54a6fbee2 past due jobs 2023-06-06 11:19:11 -04:00
victorAnumudu db03242886 active task header count down added 2023-06-06 15:51:36 +01:00
ameye 07c20fd927 Merge branch 'market-item-view-popup' of WrenchBoard/Users-Wrench into master 2023-06-06 10:39:39 +00:00
Ebube c706b5c143 Merge branch 'master' of https://gitlab.chiefsoft.net/WrenchBoard/Users-Wrench into market-item-view-popup 2023-06-06 11:07:31 +01:00
Ebube 294f6af6e4 Complete 2023-06-06 11:07:08 +01:00
ameye 76603294a3 Merge branch 'market-item-view-popup' of WrenchBoard/Users-Wrench into master 2023-06-06 01:37:41 +00:00
Ebube 5ff9876681 Merge branch 'master' of https://gitlab.chiefsoft.net/WrenchBoard/Users-Wrench into market-item-view-popup 2023-06-06 01:35:15 +01:00
Ebube aba23e82a1 . 2023-06-06 01:34:48 +01:00
ameye 7175c217b2 Merge branch 'home_current_task' of WrenchBoard/Users-Wrench into master 2023-06-05 20:58:26 +00:00
victorAnumudu 8a81e6da54 user currect task due time implementation 2023-06-05 19:24:54 +01:00
ameye 36ee1e8987 Merge branch 'market-item-view-popup' of WrenchBoard/Users-Wrench into master 2023-06-05 10:55:18 +00:00
Ebube b73a6afeac Merge branch 'master' of https://gitlab.chiefsoft.net/WrenchBoard/Users-Wrench into market-item-view-popup 2023-06-05 11:45:08 +01:00
Ebube 721c5a588f . 2023-06-05 11:44:40 +01:00
ameye a2431ff825 Merge branch 'no-family-display' of WrenchBoard/Users-Wrench into master 2023-06-05 08:36:45 +00:00
victorAnumudu 692fe461c3 No family display design added 2023-06-05 03:12:46 +01:00
ameye 3f84eef132 Merge branch 'multi-upload' of WrenchBoard/Users-Wrench into master 2023-06-05 01:50:31 +00:00
victorAnumudu 119f48642d implemented multi file upload 2023-06-05 02:48:22 +01:00
ameye 1a0f97030f Merge branch 'market-item-view-popup' of WrenchBoard/Users-Wrench into master 2023-06-05 01:08:38 +00:00
CHIEFSOFT\ameye 71d1b61bbd Single file send 2023-06-04 17:43:38 -04:00
Ebube 17ffe957e8 Merge branch 'master' of https://gitlab.chiefsoft.net/WrenchBoard/Users-Wrench into market-item-view-popup 2023-06-04 20:40:18 +01:00
Ebube e23aa95685 . 2023-06-04 20:32:29 +01:00
ameye 1c1293989b Merge branch 'width-adjustment' of WrenchBoard/Users-Wrench into master 2023-06-04 18:27:25 +00:00
23 changed files with 887 additions and 420 deletions
+2
View File
@@ -40,6 +40,7 @@ import ManageActiveJobs from "./views/ManageActiveJobs";
import FamilyManagePage from "./views/FamilyManagePage";
import MyCouponPage from "./views/MyCouponPage";
import AuthRedirect from "./views/AuthRedirect";
import MyPastDueJobsPage from "./views/MyPastDueJobsPage";
export default function Routers() {
return (
@@ -86,6 +87,7 @@ export default function Routers() {
<Route exact path="/myjobs" element={<MyJobsPage />} />
<Route exact path="/add-job" element={<AddJobPage />} />
<Route exact path="/my-active-jobs" element={<MyActiveJobsPage />} />
<Route exact path="/my-pastdue-jobs" element={<MyPastDueJobsPage />} />
<Route exact path="/my-pending-jobs" element={<MyPendingJobsPage />} />
<Route exact path="/acc-family" element={<FamilyAccPage />} />
<Route exact path="/manage-family" element={<FamilyManagePage />} />
Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 441 KiB

+130 -86
View File
@@ -1,8 +1,10 @@
import React, { useState } from "react";
import { Link } from "react-router-dom";
import React, { useCallback, useEffect, useMemo, useState } from "react";
import { Link, useNavigate, } from "react-router-dom";
import { toast } from "react-toastify";
import localImgLoad from "../../lib/localImgLoad";
import Icons from "../Helpers/Icons";
import MarketPopUp from "../MarketPlace/PopUp/MarketPopUp";
import usersService from "../../services/UsersService";
export default function AvailableJobsCard({
className,
@@ -11,7 +13,13 @@ export default function AvailableJobsCard({
}) {
//debugger;
const [addFavorite, setValue] = useState(datas.whishlisted);
const [options, setOption] = useState(false);
const [marketPopUp, setMarketPopUp] = useState({ show: false, data: {} });
const [manageInt, setManageInt] = useState(null)
const navigate = useNavigate();
const apiCall = useMemo(() => new usersService(), []);
const favoriteHandler = () => {
if (!addFavorite) {
setValue(true);
@@ -21,98 +29,134 @@ export default function AvailableJobsCard({
toast.warn("Remove to Favorite List");
}
};
const marketInterestData = useCallback(async() => {
let { offer_code } = datas;
let reqData = { offer_code };
try {
const manageInt = await apiCall.MarketInterest(reqData);
const manageIntRes = await manageInt?.data;
setManageInt(manageIntRes)
} catch (error) {
throw new Error(error)
}
}, [])
useEffect(() => {
if (!datas) {
navigate("/market", { replace: true });
}
marketInterestData()
}, [marketInterestData, datas])
return (
<div
className={`card-style-two w-full h-[426px] p-[20px] bg-white dark:bg-dark-white rounded-2xl section-shadow ${
className || ""
}`}
>
<div className="flex flex-col justify-between w-full h-full">
<Link to="/shop-details" className="mb-2.5">
<h1 className="font-bold text-xl tracking-wide line-clamp-1 text-dark-gray dark:text-white capitalize">
{datas.title}
</h1>
</Link>
<>
<div
className={`card-style-two w-full h-[426px] p-[20px] bg-white dark:bg-dark-white rounded-2xl section-shadow ${
className || ""
}`}
>
<div className="flex flex-col justify-between w-full h-full">
<Link to="/shop-details" className="mb-2.5">
<h1 className="font-bold text-xl tracking-wide line-clamp-1 text-dark-gray dark:text-white capitalize">
{datas.title}
</h1>
</Link>
<div className="card-two-info flex justify-between items-center">
<div className="owned-by flex space-x-2 items-center">
<div>
<p className="text-thin-light-gray text-sm leading-3">Added</p>
<p className="text-base text-dark-gray dark:text-white">
{datas.offer_added}
</p>
</div>
</div>
<div className="w-[1px] bg-light-purple dark:bg-dark-light-purple h-7"></div>
<div className="created-by flex space-x-2 items-center flex-row-reverse">
<div>
<p className="text-thin-light-gray text-sm leading-3 text-right">
Expires
</p>
<p className="text-base text-dark-gray dark:text-white text-right">
{datas.expire}
</p>
</div>
</div>
</div>
<div className="thumbnail-area w-full">
<div
className="w-full h-[236px] p-6 rounded-xl overflow-hidden"
style={{
background: `url(${localImgLoad(
`images/${datas.thumbnil}`
)}) 0% 0% / cover no-repeat`,
}}
>
<div className="flex justify-center">{datas.description}</div>
</div>
</div>
<div className="details-area">
<div className="product-two-options flex justify-between mb-5 relative">
{/* <div className="status">*/}
{/* {datas.isActive && (*/}
{/* <span className="text-xs px-3 py-1.5 tracking-wide rounded-full bg-gold text-white">*/}
{/* Active*/}
{/*</span>*/}
{/* )}*/}
{/* </div>*/}
{/*<div className=" review flex space-x-2">*/}
{/* <button*/}
{/* onClick={favoriteHandler}*/}
{/* type="button"*/}
{/* className={`w-7 h-7 bg-white rounded-full flex justify-center items-center ${*/}
{/* addFavorite ? "text-red-500" : "text-thin-light-gray"*/}
{/* }`}*/}
{/* >*/}
{/* <Icons name="star" />*/}
{/* </button>*/}
{/*</div>*/}
</div>
<div className="flex justify-between">
<div className="flex items-center space-x-2">
<div className="card-two-info flex justify-between items-center">
<div className="owned-by flex space-x-2 items-center">
<div>
<p className="font-bold text-xl tracking-wide line-clamp-1 text-dark-gray dark:text-white">
{datas.price * 0.01}
{datas.currency} | {datas.timeline_days} day(s)
</p>
<p className="text-sm text-lighter-gray">
( {datas.offer_code})
<p className="text-thin-light-gray text-sm leading-3">Added</p>
<p className="text-base text-dark-gray dark:text-white">
{datas.offer_added}
</p>
</div>
</div>
<div>
<button
type="button"
className="px-4 py-2.5 text-white text-sm bg-pink rounded-full tracking-wide"
>
View
</button>
<div className="w-[1px] bg-light-purple dark:bg-dark-light-purple h-7"></div>
<div className="created-by flex space-x-2 items-center flex-row-reverse">
<div>
<p className="text-thin-light-gray text-sm leading-3 text-right">
Expires
</p>
<p className="text-base text-dark-gray dark:text-white text-right">
{datas.expire}
</p>
</div>
</div>
</div>
<div className="thumbnail-area w-full">
<div
className="w-full h-[236px] p-6 rounded-xl overflow-hidden"
style={{
background: `url(${localImgLoad(
`images/${datas.thumbnil}`
)}) 0% 0% / cover no-repeat`,
}}
>
<div className="flex justify-center">{datas.description}</div>
</div>
</div>
<div className="details-area">
<div className="product-two-options flex justify-between mb-5 relative">
{/* <div className="status">*/}
{/* {datas.isActive && (*/}
{/* <span className="text-xs px-3 py-1.5 tracking-wide rounded-full bg-gold text-white">*/}
{/* Active*/}
{/*</span>*/}
{/* )}*/}
{/* </div>*/}
{/*<div className=" review flex space-x-2">*/}
{/* <button*/}
{/* onClick={favoriteHandler}*/}
{/* type="button"*/}
{/* className={`w-7 h-7 bg-white rounded-full flex justify-center items-center ${*/}
{/* addFavorite ? "text-red-500" : "text-thin-light-gray"*/}
{/* }`}*/}
{/* >*/}
{/* <Icons name="star" />*/}
{/* </button>*/}
{/*</div>*/}
</div>
<div className="flex justify-between">
<div className="flex items-center space-x-2">
<div>
<p className="font-bold text-xl tracking-wide line-clamp-1 text-dark-gray dark:text-white">
{datas.price * 0.01}
{datas.currency} | {datas.timeline_days} day(s)
</p>
<p className="text-sm text-lighter-gray">
( {datas.offer_code})
</p>
</div>
</div>
<div>
<button
type="button"
className="px-4 py-2.5 text-white text-sm bg-pink rounded-full tracking-wide"
onClick={() => {
setMarketPopUp({show: true, data: datas})
}}
>
View
</button>
</div>
</div>
</div>
</div>
</div>
</div>
{marketPopUp.show && (
<MarketPopUp
details={datas}
onClose={() => {
setMarketPopUp({ show: false, data: {} });
}}
situation={marketPopUp.show}
marketInt={manageInt}
/>
)}
</>
);
}
@@ -32,7 +32,7 @@ export default function HomeBannerOffersCard(props) {
{props.itemData.description}
</div>
<div className="siderCardButton">
[BUTTON HERE]
[ {props.itemData.button_text} ]
</div>
</div>
+39 -24
View File
@@ -1,44 +1,59 @@
import React, { useState } from "react";
import React, { useState, useEffect } from "react";
import Layout from "../Partials/Layout";
import FamilyManageTabs from "./Tabs/FamilyManageTabs";
import { useLocation } from "react-router-dom";
import { useLocation, useNavigate } from "react-router-dom";
import LoadingSpinner from "../Spinners/LoadingSpinner";
export default function FamilyManage() {
const [selectTab, setValue] = useState("today");
let [pageLoading, setPageLoading] = useState(true);
let location = useLocation();
let accountDetails = location?.state
let navigate = useNavigate();
let accountDetails = location?.state;
// tab handler
const filterHandler = (value) => {
setValue(value);
};
useEffect(() => {
if (!accountDetails) {
navigate("/acc-family", { replace: true });
} else {
setPageLoading(false);
}
}, []);
return (
<Layout>
{/*<CommonHead />*/}
<div className="notification-page w-full mb-10">
<div className="notification-wrapper w-full">
{/* heading */}
<div className="sm:flex justify-between items-center mb-6">
<div className="mb-5 sm:mb-0">
<h1 className="text-26 font-bold inline-flex gap-3 text-dark-gray dark:text-white items-center">
<span
className={`${selectTab === "today" ? "block" : "hidden"}`}
>
Manage Family
</span>
</h1>
</div>
<div className="slider-btns flex space-x-4">
<div
onClick={() => filterHandler("today")}
className="relative"
></div>
{pageLoading ? (
<LoadingSpinner size={8} color="sky-blue" />
) : (
<div className="notification-page w-full mb-10">
<div className="notification-wrapper w-full">
{/* heading */}
<div className="sm:flex justify-between items-center mb-6">
<div className="mb-5 sm:mb-0">
<h1 className="text-26 font-bold inline-flex gap-3 text-dark-gray dark:text-white items-center">
<span
className={`${selectTab === "today" ? "block" : "hidden"}`}
>
Manage Family
</span>
</h1>
</div>
<div className="slider-btns flex space-x-4">
<div
onClick={() => filterHandler("today")}
className="relative"
></div>
</div>
</div>
<FamilyManageTabs accountDetails={accountDetails} />
</div>
<FamilyManageTabs accountDetails={accountDetails} />
</div>
</div>
)}
</Layout>
);
}
}
+31 -18
View File
@@ -5,7 +5,9 @@ import { useNavigate, useLocation, Link } from "react-router-dom";
import { handlePagingFunc } from "../Pagination/HandlePagination";
import PaginatedList from "../Pagination/PaginatedList";
export default function FamilyTable({ className, familyList, loader }) {
import familyImage from '../../assets/images/no-family-side.png'
export default function FamilyTable({ className, familyList, loader, popUpHandler }) {
const filterCategories = ["All Categories", "Explore", "Featured"];
const [selectedCategory, setCategory] = useState(filterCategories[0]);
const navigate = useNavigate();
@@ -32,9 +34,11 @@ export default function FamilyTable({ className, familyList, loader }) {
<div className="h-full min-h-[500px] w-full overflow-hidden flex justify-center items-center">
<LoadingSpinner size="16" color="sky-blue" />
</div>
) : (
<table className="w-full text-sm text-left text-gray-500 dark:text-gray-400 relative">
<>
)
:
familyList?.length > 0 ?
(
<table className="w-full text-sm text-left text-gray-500 dark:text-gray-400 relative">
<thead className="sticky top-0">
<tr className="text-base text-thin-light-gray whitespace-nowrap border-b dark:border-[#5356fb29] default-border-bottom ">
<th className="py-4">Name</th>
@@ -44,9 +48,7 @@ export default function FamilyTable({ className, familyList, loader }) {
</tr>
</thead>
<tbody className="h-full">
<>
{familyList?.length > 0 ? (
currentFamilyList?.map((props, idx) => {
{currentFamilyList?.map((props, idx) => {
let {
firstname,
lastname,
@@ -115,18 +117,29 @@ export default function FamilyTable({ className, familyList, loader }) {
</tr>
);
})
) : (
<tr className="font-bold text-xl text-dark-gray dark:text-white whitespace-nowrap">
<td className="p-2" colSpan="4">
No Family Accounts Found!
</td>
</tr>
)}
</>
}
</tbody>
</>
</table>
)}
</table>
)
:
(
<div className="font-bold text-center text-xl md:text-2xl lg:text-4xl text-dark-gray md:flex items-center justify-between">
<div className="p-2 w-full md:w-1/2">
<p className="mb-4 p-3 md:p-16">Add your family, assign tasks, and get the whole team engaged.</p>
<button
onClick={popUpHandler}
type="button"
className="text-white btn-gradient text-lg tracking-wide px-5 py-2 rounded-full"
>
Add Family
</button>
</div>
<div className="p-2 w-full md:w-1/2">
<img className='w-full' src={familyImage} alt="A Family" />
</div>
</div>
)
}
</div>
{/* PAGINATION BUTTON */}
<PaginatedList
@@ -79,9 +79,11 @@ export default function FamilyManageTabs({
let { family_uid } = accountDetails;
let reqData = { family_uid };
// the family response
const familyRes = await apiCall.ManageFamily(reqData);
const familyData = familyRes.data;
// the tasks response
const tasksRes = await apiCall.ManageTasks(reqData);
const tasksData = tasksRes.data;
@@ -200,7 +202,6 @@ function ProfileInfo({
browseProfileImg,
accountDetails,
}) {
let { firstname, lastname, age } = accountDetails;
return (
<div className="flex flex-col items-center gap-6">
<div className="flex justify-center">
@@ -241,13 +242,13 @@ function ProfileInfo({
</div>
<div className="flex flex-col justify-center gap-3 items-center">
<h1 className="font-bold text-xl tracking-wide line-clamp-1 text-dark-gray dark:text-white capitalize">
{firstname}
{accountDetails?.firstname}
</h1>
<h1 className="font-bold text-xl tracking-wide line-clamp-1 text-dark-gray dark:text-white capitalize">
{lastname}
{accountDetails?.lastname}
</h1>
<h1 className="font-bold text-xl tracking-wide line-clamp-1 text-dark-gray dark:text-white capitalize">
{age}
{accountDetails?.age}
</h1>
</div>
</div>
+68 -63
View File
@@ -1,14 +1,18 @@
import React, { useState } from "react";
import dataImage2 from "../../../assets/images/data-table-user-2.png";
import { useNavigate, useLocation } from "react-router-dom";
import { handlePagingFunc } from "../../Pagination/HandlePagination";
import PaginatedList from "../../Pagination/PaginatedList";
import LoadingSpinner from "../../Spinners/LoadingSpinner";
import Icons from "../../Helpers/Icons";
export default function FamilyTasks({ familyData, className, loader }) {
const filterCategories = ["All Categories", "Explore", "Featured"];
const [selectedCategory, setCategory] = useState(filterCategories[0]);
let navigate = useNavigate();
let { pathname } = useLocation();
let data = ["1", "2", "3", "4", "5", "6"]; // to be replaced later by result from API CALL
const [currentPage, setCurrentPage] = useState(0);
@@ -20,6 +24,7 @@ export default function FamilyTasks({ familyData, className, loader }) {
indexOfLastItem
);
const handlePagination = (e) => {
handlePagingFunc(e, setCurrentPage);
};
@@ -46,69 +51,69 @@ export default function FamilyTasks({ familyData, className, loader }) {
{familyData &&
familyData?.result_list &&
familyData.result_list.length > 0 &&
currentTask.map((value, index) => (
<tr
key={index}
className="bg-white dark:bg-dark-white border-b dark:border-[#5356fb29] hover:bg-gray-50"
>
<td className=" py-4">
<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] max-w-[60px] min-w-[60px]">
<img
src={dataImage2}
alt="data"
className="w-full h-full"
/>
currentTask.map((value, index) => {
// find due date
const dueDate = value?.delivery_date.split(" ")[0]
return (
<tr
key={index}
className="bg-white dark:bg-dark-white border-b dark:border-[#5356fb29] hover:bg-gray-50"
>
<td className=" py-4">
<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] max-w-[60px] min-w-[60px]">
<img
src={dataImage2}
alt="data"
className="w-full h-full"
/>
</div>
<div className="flex flex-col flex-[0.9]">
<h1 className="font-bold text-xl text-dark-gray dark:text-white">
{value.title}
</h1>
<div className="flex gap-4 items-center">
<span className="text-sm text-thin-light-gray">
Price:{" "}
<span className="text-purple">
{value.price * 0.01}
</span>
</span>
<span className="text-sm text-thin-light-gray">
Duration:{" "}
<span className="text-purple">
{" "}
{value.timeline_days} day(s)
</span>
</span>
<span className="text-sm text-thin-light-gray">
Due Date:{" "}
<span className="text-purple">
{" "}
{dueDate}
</span>
</span>
</div>
</div>
</div>
<div className="flex flex-col flex-[0.9]">
<h1 className="font-bold text-xl text-dark-gray dark:text-white">
{value.title}
</h1>
<div>{value.description}</div>
<span className="text-sm text-thin-light-gray">
Price:{" "}
<span className="text-purple">
{value.price * 0.01}
</span>
</span>
<span className="text-sm text-thin-light-gray">
Duration:{" "}
<span className="text-purple">
{" "}
{value.timeline_days} day(s)
</span>
</span>
<span className="text-sm text-thin-light-gray">
Expire:{" "}
<span className="text-purple">
{" "}
{value.expire}
</span>
</span>
<span className="text-sm text-thin-light-gray">
Send to:{" "}
<span className="text-purple">
{" "}
{value.job_to}
</span>
</span>
</div>
</div>
</td>
<td className="text-right py-4 px-2">
<button
type="button"
onClick={() => {
// setJobPopout({ show: true, data: value });
}}
className="w-20 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
>
View
</button>
</td>
</tr>
))}
</td>
<td className="text-right py-4 px-2">
<button
type="button"
onClick={() => {
navigate("/manage-active-job", {
state: { ...value, pathname },
});
}}
className="w-20 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
>
<Icons name="right-arrow" />
</button>
</td>
</tr>
)
})}
</>
}
</tbody>
+1 -1
View File
@@ -158,7 +158,7 @@ export default function FamilyAcc() {
></div>
</div>
</div>
<FamilyTable familyList={familyList} loader={loader} />
<FamilyTable familyList={familyList} loader={loader} popUpHandler={popUpHandler} />
</div>
</div>
{popUp && (
+15
View File
@@ -468,6 +468,21 @@ export default function Icons({ name }) {
>
<rect y="0.823242" width="20" height="2.35294" rx="1.17647" />
</svg>
) : name === "right-arrow" ? (
<svg
width="24"
height="24"
xmlns="http://www.w3.org/2000/svg"
// enableBackground="new 0 0 24 24"
viewBox="0 0 24 24"
className="fill-black dark:fill-white"
id="right-arrow"
>
<path
d="M15.5,11.3L9.9,5.6c-0.4-0.4-1-0.4-1.4,0s-0.4,1,0,1.4l4.9,4.9l-4.9,4.9c-0.2,0.2-0.3,0.4-0.3,0.7c0,0.6,0.4,1,1,1
c0.3,0,0.5-0.1,0.7-0.3l5.7-5.7c0,0,0,0,0,0C15.9,12.3,15.9,11.7,15.5,11.3z"
></path>
</svg>
) : (
""
)}
+2 -2
View File
@@ -15,9 +15,8 @@ export default function FullAccountDash(props) {
const trending = datas.datas;
const jobData = datas.datas; // api calls or cache
//getHomeDate
const userApi = new usersService();
const homeData = userApi.getHomeDate();
const {userDetails} = useSelector((state) => state?.userDetails)
@@ -27,6 +26,7 @@ export default function FullAccountDash(props) {
<Hero className="mb-10"
data={userDetails}
bannerList={props.bannerList}
nextDueTask={props.nextDueTask}
/>
<HomeActivities className="mb-10"/>
{/*<UpdateTable className="mb-10"/>*/}
+26 -21
View File
@@ -11,7 +11,7 @@ import SliderCom from "../Helpers/SliderCom";
import HomeSliders from "./HomeSliders";
import { useSelector } from "react-redux";
export default function Hero({ className,bannerList }) {
export default function Hero({ className, bannerList, nextDueTask }) {
const settings = {
autoplay: true,
dots: true,
@@ -71,27 +71,32 @@ export default function Hero({ className,bannerList }) {
</div>
</div>
{/* countdown */}
<div className="w-full h-32 flex justify-evenly items-center sm:p-6 p-1 rounded-2xl border border-white-opacity">
<div className="flex flex-col justify-between">
<p className="text-base text-white tracking-wide">Current Task</p>
<p className="lg:text-2xl text-lg font-bold tracking-wide text-white">
ABCDEFGH01
</p>
<p className="text-base text-white tracking-wide">773.69 USD</p>
</div>
<div className="w-[1px] h-full bg-white-opacity"></div>
<div className="flex flex-col justify-between">
<p className="text-base text-white tracking-wide">Next due in</p>
<p className="lg:text-2xl text-lg font-bold tracking-wide text-white">
<CountDown lastDate="2023-04-26 4:00:00" />
</p>
<div className="text-base text-white tracking-wide flex gap-[23px]">
<span>Hrs</span>
<span>Min</span>
<span>Sec</span>
{ nextDueTask?.next_due && Object.keys(nextDueTask.next_due)?.length &&
(
<div className="w-full h-32 flex justify-evenly items-center sm:p-6 p-1 rounded-2xl border border-white-opacity">
<div className="flex flex-col justify-between">
<p className="text-base text-white tracking-wide">Current Task</p>
<p className="lg:text-2xl text-lg font-bold tracking-wide text-white">
{nextDueTask.next_due.item_code}
</p>
<p className="text-base text-white tracking-wide">{nextDueTask.next_due.price} Naira</p>
</div>
<div className="w-[1px] h-full bg-white-opacity"></div>
<div className="flex flex-col justify-between">
<p className="text-base text-white tracking-wide">Next due in</p>
<p className="lg:text-2xl text-lg font-bold tracking-wide text-white">
{/* <CountDown lastDate="2023-04-26 4:00:00" /> */}
<CountDown lastDate={nextDueTask.next_due.due_date} />
</p>
<div className="text-base text-white tracking-wide flex gap-[23px]">
<span>Hrs</span>
<span>Min</span>
<span>Sec</span>
</div>
</div>
</div>
</div>
</div>
)
}
{/* action */}
<div className="flex lg:space-x-3 space-x-1 items-center">
<Link
+21 -5
View File
@@ -1,4 +1,4 @@
import React from "react";
import React, { useState, useEffect } from "react";
import datas from "../../data/product_data.json";
import Layout from "../Partials/Layout";
import usersService from "../../services/UsersService";
@@ -11,10 +11,10 @@ export default function Home(props) {
console.log("PROPS IN HOME->",props);
// const trending = datas.datas;
// const jobData = datas.datas; // api calls or cache
let [nextDueTask, setNextDueTask] = useState({})
const userApi = new usersService();
// const homeData = userApi.getHomeDate();
const {userDetails} = useSelector((state) => state?.userDetails)
const commonHeadData =()=>{
@@ -22,6 +22,22 @@ export default function Home(props) {
return 0;
}
// FUNCTION TO GET DASH DATA TO DETERMINE CURRENT TASK DUE TIME
const getHomeDate = () => {
userApi.getHomeDate().then(res => {
if(res.status != 200 || res.internal_return < 0){
return
}
setNextDueTask(res.data)
}).catch(error => {
console.log(error)
})
}
useEffect(()=>{
getHomeDate()
},[])
return (
<Layout>
<div className="home-page-wrapper">
@@ -29,7 +45,7 @@ export default function Home(props) {
<FamilyDash commonHeadData={commonHeadData} />
)}
{userDetails && userDetails?.account_type == "FULL" && (
<FullAccountDash bannerList={props.bannerList} />
<FullAccountDash nextDueTask={nextDueTask} bannerList={props.bannerList} />
)}
</div>
@@ -0,0 +1,206 @@
import React, { useCallback, useMemo, useState } from "react";
import ModalCom from "../../Helpers/ModalCom";
import { toast } from "react-toastify";
import { Form, Formik } from "formik";
import usersService from "../../../services/UsersService";
import LoadingSpinner from "../../Spinners/LoadingSpinner";
const MarketPopUp = ({ details, onClose, situation, marketInt }) => {
const [marketMsg, setMarketMsg] = useState({
loading: false,
data: {},
state: undefined,
});
const [textValue, setTextValue] = useState("");
const handleInputChange = ({ target: { value } }) => {
setTextValue(value);
};
const apiCall = useMemo(() => new usersService(), []);
const marketCalls = useCallback(
async (e) => {
let nameOfCall = e?.target?.name;
let { offer_code } = details;
let reqData = { offer_code };
try {
if (nameOfCall === "market-message") {
// To manage the manage msg data
setMarketMsg({ loading: true });
reqData = { yourmessage: textValue, ...reqData };
const marketMessage = await apiCall.MarketMessage(reqData);
const marketMessageRes = await marketMessage?.data;
if (marketMessageRes?.internal_return < 0) {
setMarketMsg({ loading: false });
toast.warn("Something wrong happened", {
autoClose: 2000,
hideProgressBar: true,
});
onClose();
return;
}
toast.success("Message sent", {
autoClose: 2500,
hideProgressBar: true,
});
// To manage the manage msg data
setMarketMsg({ data: marketMessageRes, state: true });
}
} catch (error) {
throw new Error(error);
} finally {
setTimeout(() => {
onClose();
setTextValue("");
setMarketMsg({ loading: false });
}, 2000);
}
},
[apiCall, details, onClose, setMarketMsg, textValue]
);
// let addedIntDate = marketInt?.added?.split(" ")[0];
let expireIntDate = marketInt?.expire?.split(" ")[0];
return (
// className="job-popup"
<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-end lg:p-6 px-[30px] py-[23px]">
<CloseIcon onClose={onClose} />
</div>
<div className="md:flex bg-white rounded-lg shadow-lg">
<div className="p-4 w-full md:w-3/4 md:border-r-1">
<div className="flex items-center gap-4 md:text-[16px] text-md tracking-wide text-dark-gray dark:text-white">
<p className="font-semibold text-slate-900">
{details.offer_code}
</p>
<p>
<span className="text-slate-900">{`Timeline: ${details.timeline_days} day(s) -- `}</span>
<span className="font-semibold text-slate-900">{`Budget: ${details.price} naira`}</span>
</p>
</div>
{/* INPUT SECTION */}
{[
{ name: "Title", content: details.title },
{ name: "Description", content: details.description },
{
name: "Detail",
content: details.job_description,
danger: true,
},
].map(({ name, content, danger }, idx) => (
<div className="my-3 md:flex" key={idx}>
<label className="w-full md:w-1/4 text-slate-900 tracking-wide font-semibold">
{name}
</label>
{danger ? (
<p
className={`w-full md:w-3/4 text-slate-900 `}
dangerouslySetInnerHTML={{
__html: danger && content?.replace(/"/g, ""),
}}
/>
) : (
<p className={`w-full md:w-3/4 text-slate-900 `}>
{content !== "Detail" ? content : null}
</p>
)}
</div>
))}
<hr />
<div className="my-3 w-full flex flex-col gap-3">
<div className="w-full">
<label className="w-full text-slate-900 tracking-wide">
If you have any questions about this task:
</label>
<textarea
className={`p-1 w-full text-sm text-slate-900 outline-none border border-slate-300 rounded-md`}
rows="5"
style={{ resize: "none" }}
placeholder="Enter message here ..."
value={textValue}
onChange={handleInputChange}
/>
</div>
<button
className="self-end w-[150px] h-[52px] rounded-md text-base bg-yellow-500 text-white"
name="market-message"
onClick={marketCalls}
>
{marketMsg.loading ? (
<LoadingSpinner size={5} color="white" />
) : !marketMsg.state ? (
"Send Message"
) : (
"Message Sent"
)}
</button>
</div>
</div>
<div className="w-full md:w-1/4 h-full">
<div className="w-[90%] mx-auto bg-[#f1f8ff] p-4 rounded-md">
<p className="w-full text-slate-900 tracking-wide my-1">
Interested in the task?
</p>
<div className="w-full flex flex-col justify-center py-4 gap-2">
<hr />
<button className="bg-[#57cd89] text-center text-lg font-semibold text-white py-2 px-4 rounded-md inline-flex flex-col items-center justify-center">
{" "}
<span>Send</span>
<span>Interest</span>
<span>Request</span>
</button>
<p>Error - {marketInt?.status}</p>
<p className="mt-2 flex items-center">
Interest: <b className="ml-1">{marketInt?.public_view}</b>
</p>
<hr />
</div>
<p className="my-10">Expire: {expireIntDate}</p>
</div>
</div>
{/* END OF ACTION SECTION */}
</div>
</div>
</ModalCom>
);
};
export default MarketPopUp;
const CloseIcon = ({ onClose }) => (
<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>
);
+106 -81
View File
@@ -4,14 +4,17 @@ import Layout from "../Partials/Layout";
import { useNavigate } from "react-router-dom";
import ActiveJobMessage from "./ActiveJobMessage";
import LoadingSpinner from "../Spinners/LoadingSpinner";
import CountDown from "../Helpers/CountDown";
import usersService from "../../services/UsersService";
function ActiveJobs(props) {
const ApiCall = new usersService()
let navigate = useNavigate()
let { userDetails } = useSelector((state) => state.userDetails);
let navigate = useNavigate()
let [passDue, setPassDue] = useState(new Date() > new Date(props.details?.delivery_date)) // STATE TO KNOW IF TASK IS PASSED DUE TIME
let [messageToSend, setMessageToSend] = useState('') // State to hold the value of message to be sent
@@ -96,62 +99,82 @@ function ActiveJobs(props) {
// FUNCTION TO SEND FILES
const sendFile = async () => {
setRequestStatus({loading: true, status: false, message: ''})
setRequestStatus({loading: true, status: false, message: ''})
if(!filesToSend.length){ // checks if file to send is empty
setRequestStatus({loading: false, status: false, message: 'No File(s) selected'})
return setTimeout(()=>{
setRequestStatus({loading: false, status: false, message: ''})
}, 5000)
}
// let reqData = new FormData()
if(!filesToSend.length){ // checks if file to send is empty
setRequestStatus({loading: false, status: false, message: 'No File(s) selected'})
return setTimeout(()=>{
setRequestStatus({loading: false, status: false, message: ''})
}, 5000)
}
for(let i=0; i<=filesToSend.length-1; i++){ // Loops through files to send array and trigger upload API call
const fileToBase64 = async () =>{ // Converts file data to base64 string
try {
const base64String = await convertFileToBase64(filesToSend[i]);
return base64String;
} catch (error) {
return false;
}
}
// if(await !fileToBase64()){
// return
// }
let reqData={file_name: filesToSend[i].name, file_size: filesToSend[i].size, file_type: 'image/png', file_data: await fileToBase64(), msg_type: 'FILE', contract:props.details.contract}
// for(let files of filesToSend){
// reqData.append(files.name, files)
// }
// let reqData={file_size: filesToSend[0].size, file_type: 'image/png', file_data: filesToSend[0], msg_type: 'FILE', contract:props.details.contract}
// for(let files of filesToSend){
// reqData[files.name] = files
// }
ApiCall.sendFiles(reqData).then((res)=>{
// if(res.status != 200 || res.data.internal_return < 0){
// setRequestStatus({loading: false, status: false, message: 'Files(s) could not be sent, try again later'})
// return
// }
// setRequestStatus({loading: false, status: true, message: 'File(s) Uploaded Successfully'})
// props.reloadActiveJobList(prev => !prev) // MAKES ACTIVE JOB MESSAGE LIST TO RELOAD
// setFilesToSend([]) // SETS FILES TO SEND TO SEND BACK TO EMPTY ARRAY
}).catch(error => {
// setRequestStatus({loading: false, status: false, message: 'Opps! something went wrong'})
}).finally(()=>{
if(i==filesToSend.length-1){
setRequestStatus({loading: false, status: true, message: 'File(s) Uploaded Successfully'})
setFilesToSend([]) // SETS FILES TO SEND TO SEND BACK TO EMPTY ARRAY
props.reloadActiveJobList(prev => !prev) // MAKES ACTIVE JOB MESSAGE LIST TO RELOAD
setTimeout(()=>{
setRequestStatus({loading: false, status: false, message: ''})
}, 5000)
}
})
}
}
const fileToBase64 = async () =>{
try {
const base64String = await convertFileToBase64(filesToSend[0]);
return base64String;
} catch (error) {
return false;
}
// FUNCTION TO CHECK IF TASK PASS DUE IS REACHED
let isPassedDue = () => {
// console.log('TESTING',new Date() > new Date(props.details?.delivery_date) )
if(new Date() > new Date(props.details?.delivery_date)){
setPassDue(true)
}else{
setPassDue(false)
}
if(await !fileToBase64()){
return
}
let reqData={file_name: filesToSend[0].name, file_size: filesToSend[0].size, file_type: 'image/png', file_data: await fileToBase64(), msg_type: 'FILE', contract:props.details.contract}
console.log(reqData)
ApiCall.sendFiles(reqData).then((res)=>{
if(res.status != 200 || res.data.internal_return < 0){
setRequestStatus({loading: false, status: false, message: 'Files(s) could not be sent, try again later'})
return
}
setRequestStatus({loading: false, status: true, message: 'File(s) Uploaded Successfully'})
props.reloadActiveJobList(prev => !prev) // MAKES ACTIVE JOB MESSAGE LIST TO RELOAD
setFilesToSend([]) // SETS FILES TO SEND TO SEND BACK TO EMPTY ARRAY
}).catch(error => {
setRequestStatus({loading: false, status: false, message: 'Opps! something went wrong'})
}).finally(()=>{
setTimeout(()=>{
setRequestStatus({loading: false, status: false, message: ''})
}, 5000)
})
}
useEffect(()=>{
if(!passDue){
let passDueInterval = setInterval(()=>{
isPassedDue()
},1000)
return ()=>{
clearInterval(passDueInterval)
}
}
},[passDue])
return (
<Layout>
<div className="py-[20px] bg-white px-4 rounded-2xl shadow-md md:flex justify-between items-start space-y-4 md:space-x-4 md:space-y-0">
<div className="py-[20px] bg-white px-4 rounded-2xl shadow-md md:flex justify-between items-start gap-16">
{/* job title */}
<div className="w-full md:w-8/12">
<div className="w-full flex justify-start space-x-3 items-start">
@@ -175,20 +198,14 @@ function ActiveJobs(props) {
</h1>
</div>
<div className="w-full my-4">
<div className="pb-2 w-full flex items-center">
<p className="w-full lg:w-2/3 text-base text-slate-700 dark:text-black">
{props.details?.contract && props.details.contract}
</p>
<p className="w-full lg:w-1/3 text-base text-sky-blue">
<div className="w-full my-2">
<p className="w-full text-base text-right text-sky-blue">
{userDetails.firstname && userDetails.firstname}
</p>
<div className="text-base text-slate-700 dark:text-black tracking-wide">
<p className="font-semibold text-black">Description: </p>
<p className="p-2 border border-sky-blue">{props.details?.description && props.details.description}</p>
</div>
<p className="text-base text-slate-700 dark:text-black">
<span className="font-semibold">Description: </span>
{props.details?.description && props.details.description}
</p>
</div>
</div>
{/* end of job title */}
@@ -196,7 +213,9 @@ function ActiveJobs(props) {
{/* job details */}
<div className="w-full md:w-4/12">
<p className="text-base text-sky-blue">Delivery Detail</p>
<div className="mt-2">
{passDue ?
(
<div className="my-1">
<p className="text-base text-slate-700 dark:text-black">
<span className="font-semibold">Due: </span>
{props.details?.delivery_date &&
@@ -206,9 +225,33 @@ function ActiveJobs(props) {
{props.details?.delivery_date &&
props.details.delivery_date.split(" ")[1]}
</p>
<p className="text-base text-slate-700 dark:text-black">
{props.details?.timeline_days && props.details.timeline_days} day(s)
</p>
</div>
)
:
(
<div className="my-1 flex items-start gap-3">
<p className="font-semibold">Due: </p>
<div className="flex flex-col justify-between">
<p className="text-base text-slate-700 dark:text-black tracking-wide">
<CountDown lastDate={props.details.delivery_date} />
</p>
<div className="text-base text-slate-700 dark:text-black tracking-wide flex gap-[5px]">
<span>Hrs</span>
<span>Min</span>
<span>Sec</span>
</div>
</div>
</div>
)
}
<div className="my-1 text-base text-slate-700 dark:text-black tracking-wide flex items-center gap-3">
<span className="font-semibold text-black">Duration: </span>
<span className="">{props.details?.timeline_days && props.details.timeline_days} day(s)</span>
</div>
<div className="my-1 text-base text-slate-700 dark:text-black tracking-wide flex items-center gap-3">
<span className="font-semibold text-black">No: </span>
<span className="">{props.details?.contract && props.details.contract}</span>
</div>
</div>
{/* end of job details */}
@@ -296,24 +339,6 @@ function ActiveJobs(props) {
{/* Buttons Sections */}
<div className="py-2 sm:flex sm:justify-end sm:items-center">
{/* <div className="w-full mb-3 sm:mb-0 sm:w-2/4">
{tab == 'files' &&
(
<button
onClick={()=>{console.log('working')}}
type="button"
className="btn-gradient text-base tracking-wide px-4 py-2 rounded-md flex justify-center items-center"
>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill='white'>
<path d="M12 2L2 12h3v8h14v-8h3L12 2zm0 16v-6h-2v6H7l5-5 5 5h-3z"/>
</svg>
<span className="text-white">Upload Files</span>
</button>
)
}
</div> */}
<div className="w-full sm:w-2/4 flex justify-between items-center space-x-2">
<button
type="button"
@@ -0,0 +1,43 @@
import React, { useState } from "react";
import { Link } from "react-router-dom";
import Layout from "../Partials/Layout";
import CommonHead from "../UserHeader/CommonHead";
import MyActiveJobTable from "./MyActiveJobTable";
export default function MyPastDueJobs(props) {
const [selectTab, setValue] = useState("today");
const filterHandler = (value) => {
setValue(value);
};
console.log("AMEYE LOC1", props.MyJobList);
return (
<Layout>
<CommonHead
commonHeadData={props.commonHeadData}
/>
<div className="notification-page w-full mb-10">
<div className="notification-wrapper w-full">
{/* heading */}
<div className="sm:flex justify-between items-center mb-6">
<div className="mb-5 sm:mb-0">
<h1 className="text-26 font-bold text-dark-gray dark:text-white">
<span
className={`${selectTab === "today" ? "block" : "hidden"}`}
>
Pass Due Job(s)
</span>
</h1>
</div>
<div className="slider-btns flex space-x-4">
<div
onClick={() => filterHandler("today")}
className="relative"
></div>
</div>
</div>
<MyActiveJobTable MyJobList={props.MyJobList} />
</div>
</div>
</Layout>
);
}
+111 -111
View File
@@ -24,121 +24,121 @@ export default function MyPendingJobTable({ MyJobList, className }) {
};
return (
<div
className={`update-table w-full p-8 bg-white dark:bg-dark-white overflow-hidden rounded-2xl section-shadow ${
className || ""
}`}
>
{MyJobList && MyJobList?.result_list && (
<div className="relative w-full overflow-x-auto sm:rounded-lg flex flex-col justify-between h-full">
<table className="w-full text-sm text-left text-gray-500 dark:text-gray-400">
<tbody>
{/*<tr className="text-base text-thin-light-gray border-b dark:border-[#5356fb29] default-border-b dark:border-[#5356fb29] ottom ">*/}
{/* <td className="py-4">All Product</td>*/}
{/* <td className="py-4 text-right">.</td>*/}
{/*</tr>*/}
<div
className={`update-table w-full p-8 bg-white dark:bg-dark-white overflow-hidden rounded-2xl section-shadow ${
className || ""
}`}
>
{MyJobList && MyJobList?.result_list && (
<div className="relative w-full overflow-x-auto sm:rounded-lg flex flex-col justify-between h-full">
<table className="w-full text-sm text-left text-gray-500 dark:text-gray-400">
<tbody>
{/*<tr className="text-base text-thin-light-gray border-b dark:border-[#5356fb29] default-border-b dark:border-[#5356fb29] ottom ">*/}
{/* <td className="py-4">All Product</td>*/}
{/* <td className="py-4 text-right">.</td>*/}
{/*</tr>*/}
{
<>
{MyJobList &&
MyJobList?.result_list &&
MyJobList.result_list.length > 0 &&
currentActiveJobList.map((value, index) => (
<tr
key={index}
className="bg-white dark:bg-dark-white border-b dark:border-[#5356fb29] hover:bg-gray-50"
>
<td className=" py-4">
<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] max-w-[60px]">
<img
src={dataImage2}
alt="data"
className="w-full h-full"
/>
{
<>
{MyJobList &&
MyJobList?.result_list &&
MyJobList.result_list.length > 0 &&
currentActiveJobList.map((value, index) => (
<tr
key={index}
className="bg-white dark:bg-dark-white border-b dark:border-[#5356fb29] hover:bg-gray-50"
>
<td className=" py-4">
<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] max-w-[60px]">
<img
src={dataImage2}
alt="data"
className="w-full h-full"
/>
</div>
<div className="flex flex-col flex-[0.9]">
<h1 className="font-bold text-xl text-dark-gray dark:text-white">
{value.title}
</h1>
<div>{value.description}</div>
<span className="text-sm text-thin-light-gray">
Price:{" "}
<span className="text-purple">
{value.price * 0.01}
</span>
</span>
<span className="text-sm text-thin-light-gray">
Duration:{" "}
<span className="text-purple">
{" "}
{value.timeline_days} day(s)
</span>
</span>
<span className="text-sm text-thin-light-gray">
Expire:{" "}
<span className="text-purple">
{" "}
{value.expire}
</span>
</span>
<span className="text-sm text-thin-light-gray">
Send to:{" "}
<span className="text-purple">
{" "}
{value.job_to}
</span>
</span>
</div>
</div>
<div className="flex flex-col flex-[0.9]">
<h1 className="font-bold text-xl text-dark-gray dark:text-white">
{value.title}
</h1>
<div>{value.description}</div>
<span className="text-sm text-thin-light-gray">
Price:{" "}
<span className="text-purple">
{value.price * 0.01}
</span>
</span>
<span className="text-sm text-thin-light-gray">
Duration:{" "}
<span className="text-purple">
{" "}
{value.timeline_days} day(s)
</span>
</span>
<span className="text-sm text-thin-light-gray">
Expire:{" "}
<span className="text-purple">
{" "}
{value.expire}
</span>
</span>
<span className="text-sm text-thin-light-gray">
Send to:{" "}
<span className="text-purple">
{" "}
{value.job_to}
</span>
</span>
</div>
</div>
</td>
</td>
<td className="text-right py-4 px-2">
<button
type="button"
onClick={() => {
setJobPopout({ show: true, data: value });
}}
className="w-20 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
>
View
</button>
</td>
</tr>
))}
</>
<td className="text-right py-4 px-2">
<button
type="button"
onClick={() => {
setJobPopout({ show: true, data: value });
}}
className="w-20 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
>
View
</button>
</td>
</tr>
))}
</>
}
</tbody>
</table>
{/* PAGINATION BUTTON */}
<PaginatedList
onClick={handlePagination}
prev={currentPage == 0 ? true : false}
next={
currentPage + Number(process.env.REACT_APP_ITEM_PER_PAGE) >=
MyJobList?.result_list.length
? true
: false
}
</tbody>
</table>
{/* PAGINATION BUTTON */}
<PaginatedList
onClick={handlePagination}
prev={currentPage == 0 ? true : false}
next={
currentPage + Number(process.env.REACT_APP_ITEM_PER_PAGE) >=
MyJobList?.result_list.length
? true
: false
}
data={MyJobList?.result_list}
start={indexOfFirstItem}
stop={indexOfLastItem}
/>
{/* END OF PAGINATION BUTTON */}
</div>
)}
data={MyJobList?.result_list}
start={indexOfFirstItem}
stop={indexOfLastItem}
/>
{/* END OF PAGINATION BUTTON */}
</div>
)}
{/* Active Job Popout */}
{jobPopout.show && (
<PendingJobsPopout
details={jobPopout.data}
onClose={() => {
setJobPopout({ show: false, data: {} });
}}
situation={jobPopout.show}
/>
)}
{/* End of Active Job Popout */}
</div>
{/* Active Job Popout */}
{jobPopout.show && (
<PendingJobsPopout
details={jobPopout.data}
onClose={() => {
setJobPopout({ show: false, data: {} });
}}
situation={jobPopout.show}
/>
)}
{/* End of Active Job Popout */}
</div>
);
}
-1
View File
@@ -26,7 +26,6 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
navigate("/login", { replace: true }); // redirects user to login page after session expires
};
console.log(loadProfileDetails);
const checkInactivity = setInterval(() => {
let { account_type } = loadProfileDetails;
if (account_type === "FAMILY") {
+44 -2
View File
@@ -16,9 +16,10 @@ class usersService {
return this.postAuxEnd("/completesignuplink", reqData);
}
// FUNCTION TO GET USER CURRENT TASK DUE TIME
getHomeDate() {
var postData = {
uuid: localStorage.getItem("uid"),
// uuid: localStorage.getItem("uid"),
uid: localStorage.getItem("uid"),
member_id: localStorage.getItem("member_id"),
sessionid: localStorage.getItem("session_token"),
@@ -218,6 +219,7 @@ class usersService {
uid: localStorage.getItem("uid"),
member_id: localStorage.getItem("member_id"),
sessionid: localStorage.getItem("session_token"),
job_mode: "ACTIVE",
limit: 30,
offset: 0,
action: 13008,
@@ -243,6 +245,7 @@ class usersService {
uuid: localStorage.getItem("uid"),
member_id: localStorage.getItem("member_id"),
sessionid: localStorage.getItem("session_token"),
job_mode: "ACTIVE",
page: 0,
offset: 0,
limit: 100,
@@ -250,6 +253,18 @@ class usersService {
return this.postAuxEnd("/jobmanageractive", postData);
}
getMyPastDueJobList() {
var postData = {
uuid: localStorage.getItem("uid"),
member_id: localStorage.getItem("member_id"),
sessionid: localStorage.getItem("session_token"),
job_mode: "PASTDUE",
page: 0,
offset: 0,
limit: 100,
};
return this.postAuxEnd("/jobmanageractive", postData);
}
getMyPendingJobList() {
var postData = {
uuid: localStorage.getItem("uid"),
@@ -466,6 +481,31 @@ class usersService {
return this.postAuxEnd("/accounttypes", postData);
}
// Manage Interest
MarketInterest(reqData) {
var postData = {
uid: localStorage.getItem("uid"),
member_id: localStorage.getItem("member_id"),
sessionid: localStorage.getItem("session_token"),
msg_type: 'JOB',
action: 13033,
...reqData
};
return this.postAuxEnd("/marketinterest", postData);
}
MarketMessage(reqData) {
var postData = {
uid: localStorage.getItem("uid"),
member_id: localStorage.getItem("member_id"),
sessionid: localStorage.getItem("session_token"),
msg_type: 'JOB',
action: 13036,
...reqData
};
return this.postAuxEnd("/marketmessage", postData);
}
// END POINT TO ACCEPT TERMS AND AGREEMENT
jobManagerAgree() {
var postData = {
@@ -563,7 +603,9 @@ class usersService {
for (let data in postData) {
formData.append(data, postData[data]);
}
return this.postAuxEnd("/uploads", formData);
// return this.postAuxEnd("/uploads", formData);
return this.postAuxEnd("/uploads", postData);
}
// END POINT TO DELETE A JOB
+36
View File
@@ -0,0 +1,36 @@
import React, { useContext,useState, useEffect } from "react";
import usersService from "../services/UsersService";
//import MyJobs from "../components/MyJobs";
//import MyActiveJobs from "../components/MyActiveJobs";
import MyPastDueJobs from "../components/MyActiveJobs/MyPastDueJobs";
export default function MyPastDueJobsPage() {
const commonHeadData =()=>{
console.log("COMMON HEAD DATA ----------------=====---------------------");
return 0;
}
const [MyJobList, setMyJobList] = useState([]);
const api = new usersService();
//TARGET ENDPOINT[POST]http://10.204.5.100:9083/en/wrench/api/v1/jobmanageractive
const getMyJobList = async () => {
try {
const res = await api.getMyPastDueJobList();
setMyJobList(res.data);
} catch (error) {
console.log("Error getting mode");
}
};
useEffect(() => {
getMyJobList();
}, []);
// debugger;
return (
<>
<MyPastDueJobs
MyJobList={MyJobList}
commonHeadData={commonHeadData}
/>
</>
);
}