View
diff --git a/src/components/Home/FamilyActiveLSlde.jsx b/src/components/Home/FamilyActiveLSlde.jsx
index cb55b29..6d7ff35 100644
--- a/src/components/Home/FamilyActiveLSlde.jsx
+++ b/src/components/Home/FamilyActiveLSlde.jsx
@@ -9,13 +9,14 @@ export default function FamilyActiveLSlde({ className, trending }) {
arrows: false,
slidesToShow: 3,
slidesToScroll: 3,
- infinite: true,
+ infinite: trending?.length > 3,
responsive: [
{
breakpoint: 1025,
settings: {
slidesToShow: 3,
slidesToScroll: 3,
+ infinite: trending?.length > 3,
},
},
{
@@ -23,6 +24,7 @@ export default function FamilyActiveLSlde({ className, trending }) {
settings: {
slidesToShow: 2,
slidesToScroll: 2,
+ infinite: trending?.length > 2,
},
},
{
@@ -30,6 +32,7 @@ export default function FamilyActiveLSlde({ className, trending }) {
settings: {
slidesToShow: 1,
slidesToScroll: 1,
+ infinite: trending?.length > 1,
},
},
],
diff --git a/src/components/Home/FamilyDash.jsx b/src/components/Home/FamilyDash.jsx
index ae85faa..1895363 100644
--- a/src/components/Home/FamilyDash.jsx
+++ b/src/components/Home/FamilyDash.jsx
@@ -6,16 +6,20 @@ import FamilyActiveLSlde from "./FamilyActiveLSlde";
import ParentWaiting from "../MyPendingJobs/ParentWaiting";
import MyOffersFamilyTable from "../MyTasks/MyOffersFamilyTable";
-export default function FamilyDash({familyOffers}) {
+export default function FamilyDash({familyOffers, MyActiveJobList}) {
console.log("PROPS IN FAMILY DASH->", familyOffers);
- const trending = datas.datas;
+ const trending = MyActiveJobList;
return (
{/*
*/}
+
+ {trending && trending.length > 0 &&
+ }
+
{/*
*/}
diff --git a/src/components/Home/index.jsx b/src/components/Home/index.jsx
index 1890b71..42da14f 100644
--- a/src/components/Home/index.jsx
+++ b/src/components/Home/index.jsx
@@ -8,15 +8,26 @@ import FullAccountDash from "./FullAccountDash";
export default function Home(props) {
console.log("PROPS IN HOME->", props);
+ const userApi = new usersService();
+ const { commonHeadBanner } = useSelector((state) => state.commonHeadBanner);
let [nextDueTask, setNextDueTask] = useState({});
const [MyOffersList, setMyOffersList] = useState([]);
- const userApi = new usersService();
-
const { userDetails } = useSelector((state) => state?.userDetails);
- const { commonHeadBanner } = useSelector((state) => state.commonHeadBanner);
+ const [MyActiveJobList, setMyActiveJobList] = useState([]); // STATE TO HOLD ACTIVE/CURRENT TASKS
+
+ const getMyActiveJobList = async () => { // FUNCTION TO POPULATE ACTIVE/CURRENT TASK LIST
+ try {
+ const res = await userApi.getMyActiveTaskList();
+ setMyActiveJobList(res?.data?.result_list);
+ } catch (error) {
+ setMyActiveJobList([]);
+ console.log("Error getting tasks");
+ }
+ };
+
// FUNCTION TO GET DASH DATA TO DETERMINE CURRENT TASK DUE TIME
const getHomeDate = () => {
@@ -50,6 +61,10 @@ export default function Home(props) {
fetchData();
}, []);
+ useEffect(() => {
+ getMyActiveJobList();
+ }, []);
+
return (
@@ -58,6 +73,7 @@ export default function Home(props) {
account={userDetails}
commonHeadData={props.bannerList}
familyOffers={MyOffersList}
+ MyActiveJobList={MyActiveJobList}
/>
) : userDetails && userDetails?.account_type == "FULL" ? (