react-query-v2 : react-query intergrated inside attendance and gallery module #270
@ -9,6 +9,8 @@ import { convertShortTime } from "../../utils/dateUtils";
|
|||||||
import RenderAttendanceStatus from "../../components/Activities/RenderAttendanceStatus";
|
import RenderAttendanceStatus from "../../components/Activities/RenderAttendanceStatus";
|
||||||
import AttendLogs from "../../components/Activities/AttendLogs";
|
import AttendLogs from "../../components/Activities/AttendLogs";
|
||||||
import { useAttendanceByEmployee } from "../../hooks/useAttendance";
|
import { useAttendanceByEmployee } from "../../hooks/useAttendance";
|
||||||
|
import GlobalModel from "../../components/common/GlobalModel";
|
||||||
|
import { ITEMS_PER_PAGE } from "../../utils/constants";
|
||||||
|
|
||||||
const AttendancesEmployeeRecords = ({ employee }) => {
|
const AttendancesEmployeeRecords = ({ employee }) => {
|
||||||
const [attendances, setAttendnaces] = useState([]);
|
const [attendances, setAttendnaces] = useState([]);
|
||||||
@ -88,21 +90,10 @@ const AttendancesEmployeeRecords = ({ employee }) => {
|
|||||||
const currentDate = new Date().toLocaleDateString("en-CA");
|
const currentDate = new Date().toLocaleDateString("en-CA");
|
||||||
const { currentPage, totalPages, currentItems, paginate } = usePagination(
|
const { currentPage, totalPages, currentItems, paginate } = usePagination(
|
||||||
sortedFinalList,
|
sortedFinalList,
|
||||||
20
|
ITEMS_PER_PAGE
|
||||||
);
|
);
|
||||||
|
|
||||||
// useEffect(() => {
|
|
||||||
// const { startDate, endDate } = dateRange;
|
|
||||||
// if (startDate && endDate) {
|
|
||||||
// dispatch(
|
|
||||||
// fetchEmployeeAttendanceData({
|
|
||||||
// employeeId: employee,
|
|
||||||
// fromDate: startDate,
|
|
||||||
// toDate: endDate,
|
|
||||||
// })
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// }, [dateRange, employee, isRefreshing]);
|
|
||||||
|
|
||||||
const openModal = (id) => {
|
const openModal = (id) => {
|
||||||
setAttendanecId(id);
|
setAttendanecId(id);
|
||||||
@ -112,32 +103,13 @@ const AttendancesEmployeeRecords = ({ employee }) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div
|
|
||||||
className={`modal fade ${isModalOpen ? "show" : ""}`}
|
|
||||||
tabIndex="-1"
|
|
||||||
role="dialog"
|
|
||||||
style={{ display: isModalOpen ? "block" : "none" }}
|
|
||||||
aria-hidden={!isModalOpen}
|
|
||||||
>
|
|
||||||
{" "}
|
|
||||||
<div
|
|
||||||
className="modal-dialog modal-lg modal-simple attendance-log-modal mx-sm-auto mx-1"
|
|
||||||
role="document"
|
|
||||||
>
|
|
||||||
<div className="modal-content">
|
|
||||||
<div className="modal-body p-sm-4 p-0">
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
className="btn-close"
|
|
||||||
onClick={closeModal}
|
|
||||||
aria-label="Close"
|
|
||||||
></button>
|
|
||||||
|
|
||||||
<AttendLogs Id={attendanceId} />
|
{isModalOpen && (
|
||||||
</div>
|
<GlobalModel size="lg" isOpen={isModalOpen} closeModal={closeModal}>
|
||||||
</div>
|
<AttendLogs Id={attendanceId} />
|
||||||
</div>
|
</GlobalModel>
|
||||||
</div>
|
)}
|
||||||
<div className="px-4 py-2 " style={{ minHeight: "500px" }}>
|
<div className="px-4 py-2 " style={{ minHeight: "500px" }}>
|
||||||
<div
|
<div
|
||||||
className="dataTables_length text-start py-2 d-flex justify-content-between "
|
className="dataTables_length text-start py-2 d-flex justify-content-between "
|
||||||
|
Loading…
x
Reference in New Issue
Block a user