Parent Waiting View Added & Market Link goes to bad page fixed

This commit is contained in:
2023-07-06 06:33:33 +01:00
parent bbb099d51f
commit 626835e1e0
5 changed files with 220 additions and 172 deletions
@@ -2,11 +2,13 @@ import { useState } from "react";
import { useLocation, useNavigate } from "react-router-dom";
import { handlePagingFunc, PaginatedList } from "../../Pagination";
import LoadingSpinner from "../../Spinners/LoadingSpinner";
import SuggestTask from "../../FamilyPopup/SuggestTask";
const FamilyWaitlist = ({ familyData, className, loader }) => {
const navigate = useNavigate();
const { pathname } = useLocation();
const [popUp, setPopUp] = useState({ show: false, data: {} });
const [currentPage, setCurrentPage] = useState(0);
const itemsPerPage = Number(process.env.REACT_APP_ITEM_PER_PAGE);
const indexOfFirstItem = currentPage;
@@ -18,6 +20,10 @@ const FamilyWaitlist = ({ familyData, className, loader }) => {
const handlePagination = (e) => handlePagingFunc(e, setCurrentPage);
const popUpHandler = () => {
setPopUp((prev) => !prev);
};
return (
<div
className={`update-table w-full bg-white dark:bg-dark-white h-full lg:min-h-[450px] overflow-hidden rounded-2xl section-shadow ${
@@ -75,7 +81,7 @@ const FamilyWaitlist = ({ familyData, className, loader }) => {
</td>
<td className="text-right py-4 px-2">
<button
type="button"
onClick={() => setPopUp({ show: true, data: value })}
className="w-20 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
>
View
@@ -100,6 +106,7 @@ const FamilyWaitlist = ({ familyData, className, loader }) => {
)}
</>
)}
{popUp.show && <SuggestTask details={popUp.data} onClose={() => {setPopUp({ show: false, data: {} })}} situation={popUp.show} />}
</div>
);
};