diff --git a/src/components/OffersInterest/OffersInterestTable.jsx b/src/components/OffersInterest/OffersInterestTable.jsx index a5d6b10..176586f 100644 --- a/src/components/OffersInterest/OffersInterestTable.jsx +++ b/src/components/OffersInterest/OffersInterestTable.jsx @@ -7,17 +7,19 @@ import PaginatedList from "../Pagination/PaginatedList"; import familyImage from '../../assets/images/no-family-side.png' -export default function FamilyTable({ className, familyList, loader, popUpHandler }) { +export default function OffersInterestTable({offerInterestList, className}) { + + const navigate = useNavigate(); + let { pathname } = useLocation(); + const filterCategories = ["All Categories", "Explore", "Featured"]; const [selectedCategory, setCategory] = useState(filterCategories[0]); - const navigate = useNavigate(); - // let location = useLocation(); const [currentPage, setCurrentPage] = useState(0); const indexOfFirstItem = Number(currentPage); const indexOfLastItem = Number(indexOfFirstItem) + Number(process.env.REACT_APP_ITEM_PER_PAGE); - const currentFamilyList = familyList?.slice(indexOfFirstItem, indexOfLastItem); + const currentOfferInterestList = offerInterestList?.data?.slice(indexOfFirstItem, indexOfLastItem); const handlePagination = (e) => { handlePagingFunc(e, setCurrentPage); @@ -25,133 +27,186 @@ export default function FamilyTable({ className, familyList, loader, popUpHandle return (
-
- {loader ? ( -
- -
+ + {offerInterestList?.loading ? ( +
+ +
+ ) + : + offerInterestList?.data?.length > 0 ? + ( + + + {/* + + + + + */} + + + {currentOfferInterestList?.map((item, idx) => { + return ( + + + + + + + + ); + }) + } + +
NameLast LoginNo of Tasks
+
+
+ data +
+
+

+ {item?.title} +

+ {item?.expire} +
+
+
+
+ {/* + + + + + + + + + + + + 7473 ETH + */} +

{item?.client_name}

+
+
+
+ + + + + + + + + {/* + 6392.99$ + */} + {item?.price} + {item?.currency} +
+
+ +
) : - familyList?.length > 0 ? - ( - - - - - - - - - - - {currentFamilyList?.map((props, idx) => { - let { - firstname, - lastname, - age, - added, - last_login, - task_count, - family_uid, - } = props; - let addedDate = added?.split(" ")[0]; - let LoginDate = last_login?.split(" ")[0]; - return ( - - - - - - - ); - }) - } - -
NameLast LoginNo of Tasks
-
-
- data -
-
-

- {`${firstname} ${lastname} (${age})`} -

- - Added:{" "} - - {addedDate} - - -
-
-
-
- - {LoginDate} - -
-
-
- - {task_count} - -
-
- -
- ) - : - ( -
-
-

Add your family, assign tasks, and get the whole team engaged.

- -
-
- Add Family -
+ ( +
+
+

No Offer list avaliable.

+
- ) - } -
+
+ Add Family +
+
+ ) + } + {/* PAGINATION BUTTON */} = - familyList?.length + offerInterestList?.data?.length ? true : false } - data={familyList} + data={offerInterestList?.data} start={indexOfFirstItem} stop={indexOfLastItem} /> diff --git a/src/components/OffersInterest/index.jsx b/src/components/OffersInterest/index.jsx index 1444c37..673c698 100644 --- a/src/components/OffersInterest/index.jsx +++ b/src/components/OffersInterest/index.jsx @@ -2,6 +2,7 @@ import React, { useState } from "react"; import { Link } from "react-router-dom"; import Layout from "../Partials/Layout"; import CommonHead from "../UserHeader/CommonHead"; +import OffersInterestTable from './OffersInterestTable' export default function OffersInterest(props) { const [selectTab, setValue] = useState("today"); @@ -19,22 +20,13 @@ export default function OffersInterest(props) {

- - Offer Interest - + Offer Interest

-
- -
-
-
- Blog Items Details
+ ); } diff --git a/src/services/UsersService.js b/src/services/UsersService.js index a29a277..a342095 100644 --- a/src/services/UsersService.js +++ b/src/services/UsersService.js @@ -653,6 +653,19 @@ class usersService { return this.postAuxEnd("/offersresponse", postData); } + // END POINT FOR OFFERS INTEREST LIST + offersInterestList() { + var postData = { + uid: localStorage.getItem("uid"), + member_id: localStorage.getItem("member_id"), + sessionid: localStorage.getItem("session_token"), + action: 13024, + limit: 30, + offset: 0 + }; + return this.postAuxEnd("/offersinterestlist", postData); + } + // END POINT FOR WORKER TO MARK TASK AS COMPLETED workerJobAction(reqData) { var postData = { diff --git a/src/views/OffersInterestPage.jsx b/src/views/OffersInterestPage.jsx index 9d87cfe..d8b50ae 100644 --- a/src/views/OffersInterestPage.jsx +++ b/src/views/OffersInterestPage.jsx @@ -3,12 +3,27 @@ import React, { useContext, useState, useEffect } from "react"; import { useSelector } from "react-redux"; import OffersInterest from "../components/OffersInterest"; +import usersService from "../services/UsersService"; + export default function OffersInterestPage() { + const apiCall = new usersService() + let {commonHeadBanner} = useSelector(state => state.commonHeadBanner) + let [offerInterestList, setOfferInterestList] = useState({loading: true, data: []}) + + useEffect(()=>{ + apiCall.offersInterestList().then(res => { + setOfferInterestList({loading: false, data: res.data.result_list}) + }).catch(err => { + setOfferInterestList({loading: false, data: []}) + console.log('Error: ', err) + }) + },[]) + return ( <> - + ); } \ No newline at end of file