From 47932d73013cfa2a41c90ba8631f553e41542869 Mon Sep 17 00:00:00 2001 From: victorAnumudu Date: Thu, 30 May 2024 11:40:37 +0100 Subject: [PATCH] added Job Details Modal --- src/components/MyActiveJobs/ActiveJobs.jsx | 20 ++++++- .../MyActiveJobs/JobDetailPopout.jsx | 52 +++++++++++++++++++ src/components/attachmentCom/AttachFile.jsx | 4 +- 3 files changed, 73 insertions(+), 3 deletions(-) create mode 100644 src/components/MyActiveJobs/JobDetailPopout.jsx diff --git a/src/components/MyActiveJobs/ActiveJobs.jsx b/src/components/MyActiveJobs/ActiveJobs.jsx index 129f1a0..da8f85a 100644 --- a/src/components/MyActiveJobs/ActiveJobs.jsx +++ b/src/components/MyActiveJobs/ActiveJobs.jsx @@ -15,6 +15,8 @@ import { SocketValues } from "../Contexts/SocketIOContext"; import TabButton from "../customTabs/TabButton"; import AttachFile from "../attachmentCom/AttachFile"; +import JobDetailPopout from "./JobDetailPopout"; + function ActiveJobs(props) { let {sendMessage, joinRoom} = SocketValues() // destructures 'SEND MESSAGE' and 'JOIN ROOM' FUNCTIONS FROM SOCKET @@ -43,6 +45,8 @@ function ActiveJobs(props) { let [popUp, setPopUp] = useState(false); // STATE FOR POPOUT MODAL + let [jobDetailModal, setJobDetailModal] = useState(false); // STATE FOR JOB DELIVERY DETAIL POPOUT MODAL + const printRef = useRef(); // to handle printing const handlePrint = useReactToPrint({ @@ -54,6 +58,10 @@ function ActiveJobs(props) { setPopUp((prev) => !prev); }; + const jobDetailModalHandler = () => { // FUNCTION TO CLOSE JOB DELIVERY DETAIL MODAL + setJobDetailModal((prev) => !prev); + }; + // FUNCTION TO HANDLE MESSAGE CHANGE const handleMessageChange = ({ target: { value } }) => { setMessageToSend(value); @@ -325,7 +333,7 @@ function ActiveJobs(props) { {/* job details */}
-

Delivery Detail

+ {passDue ? (

@@ -587,6 +595,16 @@ function ActiveJobs(props) { /> )} {/* END OF POPOUT SECTION */} + + {/* Delivery Details Popout */} + {jobDetailModal && + + } + {/* END Delivery Details Popout */} ); } diff --git a/src/components/MyActiveJobs/JobDetailPopout.jsx b/src/components/MyActiveJobs/JobDetailPopout.jsx new file mode 100644 index 0000000..c585171 --- /dev/null +++ b/src/components/MyActiveJobs/JobDetailPopout.jsx @@ -0,0 +1,52 @@ +import React from 'react' +import ModalCom from '../Helpers/ModalCom' + +export default function JobDetailPopout({action, situation, jobDetail}) { + return ( + +

+
+

+ Delivery Detail +

+ +
+
+

{jobDetail}

+
+
+ +
+
+ + ); +} diff --git a/src/components/attachmentCom/AttachFile.jsx b/src/components/attachmentCom/AttachFile.jsx index 93bac02..b79d1a2 100644 --- a/src/components/attachmentCom/AttachFile.jsx +++ b/src/components/attachmentCom/AttachFile.jsx @@ -113,7 +113,7 @@ export default function AttachFile({data='', fontSize='text-sm', showOnData=fals let fileNameExt = item.originalname.split('.')[item.originalname.split('.').length - 1] let downloadLink = fileNameExt == 'mp4' ? `${process.env.REACT_APP_MEDIA_LINK}/mytask/${item.file_uid}` : `${uploadedList?.data?.session_image_server}/${localStorage.getItem("session_token")}/jobfile/${item.file_uid}` return( -
+
{index + 1}: +
{index + 1}: