From b89cf9a6bc2f32df23feb19cfeb046fc779c3936 Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Tue, 13 Jun 2023 21:17:58 -0400 Subject: [PATCH] finterest table --- src/components/FamilyAcc/FamilyTable.jsx | 2 +- .../OffersInterest/OffersInterestTable.jsx | 161 ++++++++++++++++++ 2 files changed, 162 insertions(+), 1 deletion(-) create mode 100644 src/components/OffersInterest/OffersInterestTable.jsx diff --git a/src/components/FamilyAcc/FamilyTable.jsx b/src/components/FamilyAcc/FamilyTable.jsx index 72671e7..81b6d8a 100644 --- a/src/components/FamilyAcc/FamilyTable.jsx +++ b/src/components/FamilyAcc/FamilyTable.jsx @@ -135,7 +135,7 @@ export default function FamilyTable({ className, familyList, loader, popUpHandle
- A Family + Add Family
) diff --git a/src/components/OffersInterest/OffersInterestTable.jsx b/src/components/OffersInterest/OffersInterestTable.jsx new file mode 100644 index 0000000..a5d6b10 --- /dev/null +++ b/src/components/OffersInterest/OffersInterestTable.jsx @@ -0,0 +1,161 @@ +import React, { useState } from "react"; +import dataImage1 from "../../assets/images/data-table-user-1.png"; +import LoadingSpinner from "../Spinners/LoadingSpinner"; +import { useNavigate, useLocation, Link } from "react-router-dom"; +import { handlePagingFunc } from "../Pagination/HandlePagination"; +import PaginatedList from "../Pagination/PaginatedList"; + +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(); + // 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 handlePagination = (e) => { + handlePagingFunc(e, setCurrentPage); + }; + + return ( +
+
+ {loader ? ( +
+ +
+ ) + : + 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 +
+
+ ) + } +
+ {/* PAGINATION BUTTON */} + = + familyList?.length + ? true + : false + } + data={familyList} + start={indexOfFirstItem} + stop={indexOfLastItem} + /> + {/* END OF PAGINATION BUTTON */} +
+ ); +}