From 123ed2056a4a8aae5c221a889fbd23d0d700a6ca Mon Sep 17 00:00:00 2001 From: Ebube Date: Fri, 16 Jun 2023 14:23:54 +0100 Subject: [PATCH] Family page Tasks --- .../FamilyAcc/Tabs/FamilyManageTabs.jsx | 2 +- src/components/FamilyAcc/Tabs/FamilyTasks.jsx | 66 ++++++++++--------- 2 files changed, 36 insertions(+), 32 deletions(-) diff --git a/src/components/FamilyAcc/Tabs/FamilyManageTabs.jsx b/src/components/FamilyAcc/Tabs/FamilyManageTabs.jsx index c81fcbc..10e5467 100644 --- a/src/components/FamilyAcc/Tabs/FamilyManageTabs.jsx +++ b/src/components/FamilyAcc/Tabs/FamilyManageTabs.jsx @@ -117,7 +117,7 @@ export default function FamilyManageTabs({ return (
diff --git a/src/components/FamilyAcc/Tabs/FamilyTasks.jsx b/src/components/FamilyAcc/Tabs/FamilyTasks.jsx index 2a4e8cd..0649980 100644 --- a/src/components/FamilyAcc/Tabs/FamilyTasks.jsx +++ b/src/components/FamilyAcc/Tabs/FamilyTasks.jsx @@ -5,16 +5,12 @@ import { handlePagingFunc } from "../../Pagination/HandlePagination"; import PaginatedList from "../../Pagination/PaginatedList"; import LoadingSpinner from "../../Spinners/LoadingSpinner"; import Icons from "../../Helpers/Icons"; +import { PriceFormatter } from "../../Helpers/PriceFormatter"; 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); const indexOfFirstItem = Number(currentPage); const indexOfLastItem = @@ -24,10 +20,7 @@ export default function FamilyTasks({ familyData, className, loader }) { indexOfLastItem ); - - const handlePagination = (e) => { - handlePagingFunc(e, setCurrentPage); - }; + const handlePagination = (e) => handlePagingFunc(e, setCurrentPage); return (
0 && currentTask.map((value, index) => { - // find due date - const dueDate = value?.delivery_date.split(" ")[0] + // find due date + const dueDate = value?.delivery_date.split(" ")[0]; + // the price + let thePrice = PriceFormatter( + value?.price * 0.01, + value?.currency_code, + value?.currency + ); return (
- - Price:{" "} - - {value.price * 0.01} + + Price:{" "} + + {thePrice} + - - - Duration:{" "} - - {" "} - {value.timeline_days} day(s) + + Duration:{" "} + + {" "} + {value.timeline_days} day(s) + - - - Due Date:{" "} - - {" "} - {dueDate} + + Due Date:{" "} + + {" "} + {dueDate} + -
- + - ) + ); })} }