From bb2d7b89239857d10af14cc19b8f994954ba4d81 Mon Sep 17 00:00:00 2001 From: "pramod.mahajan" Date: Fri, 10 Oct 2025 19:54:20 +0530 Subject: [PATCH] added pading in check-in check-out form --- src/components/Activities/AttendcesLogs.jsx | 32 +-- .../Activities/CheckCheckOutForm.jsx | 6 +- src/pages/Directory/DirectoryPage.jsx | 195 ++++++++++++------ 3 files changed, 137 insertions(+), 96 deletions(-) diff --git a/src/components/Activities/AttendcesLogs.jsx b/src/components/Activities/AttendcesLogs.jsx index 439529ac..31c1522f 100644 --- a/src/components/Activities/AttendcesLogs.jsx +++ b/src/components/Activities/AttendcesLogs.jsx @@ -132,9 +132,12 @@ const AttendanceLog = ({ handleModalData, searchTerm, organizationId }) => { }, [showPending]); - useEffect(() => { + useEffect(() => { + if (data?.length) { filtering(data); - }, [data, showPending]); + } +}, [data, showPending]); + // New useEffect to handle search filtering const filteredSearchData = useMemo(() => { @@ -148,31 +151,6 @@ const AttendanceLog = ({ handleModalData, searchTerm, organizationId }) => { }); }, [processedData, searchTerm]); - // const filteredSearchData = useMemo(() => { - // let tempData = processedData; - - // if (searchTerm) { - // const lowercasedSearchTerm = searchTerm.toLowerCase(); - // tempData = tempData.filter((item) => { - // const fullName = `${item.firstName} ${item.lastName}`.toLowerCase(); - // return fullName.includes(lowercasedSearchTerm); - // }); - // } - - // if (filters?.selectedOrganization) { - // tempData = tempData.filter( - // (item) => item.organization?.name === filters.selectedOrganization - // ); - // } - - // if (filters?.selectedServices?.length > 0) { - // tempData = tempData.filter((item) => - // filters.selectedServices.includes(item.service?.name) - // ); - // } - - // return tempData; - // }, [processedData, searchTerm, filters]); const { diff --git a/src/components/Activities/CheckCheckOutForm.jsx b/src/components/Activities/CheckCheckOutForm.jsx index 3d7c5e0e..830c8db0 100644 --- a/src/components/Activities/CheckCheckOutForm.jsx +++ b/src/components/Activities/CheckCheckOutForm.jsx @@ -110,8 +110,8 @@ const CheckInCheckOut = ({ modeldata, closeModal, handleSubmitForm }) => { }, [projectNames, projectId, loading]); return ( -
-
+ +
)} @@ -246,7 +266,7 @@ export default function DirectoryPage({ IsPage = true, projectId = null }) { -
    +
      {activeTab === "contacts" && (
    • @@ -256,30 +276,73 @@ export default function DirectoryPage({ IsPage = true, projectId = null }) { role="switch" id="inactiveContactsSwitch" checked={showActive} - onChange={(e) => setShowActive(e.target.checked)} + onChange={(e) => + setShowActive(e.target.checked) + } />
      - {showActive ? "Active Contacts" : "Inactive Contacts"} + + {showActive + ? "Active Contacts" + : "Inactive Contacts"} +
    • )}
    • -
    • -
    • -
    • +
    • + setGridView(true)} + > + Card View + +
    • + +
    • + setGridView(false)} + > + List View + +
    • {/* Divider */} - {activeTab === "contacts" &&

    • } + {activeTab === "contacts" && ( +
    • +
      +
    • + )}