diff --git a/src/components/MyActiveJobs/JobActions/CurrentTaskAction.jsx b/src/components/MyActiveJobs/JobActions/CurrentTaskAction.jsx
index 8d94b4f..dac45e2 100644
--- a/src/components/MyActiveJobs/JobActions/CurrentTaskAction.jsx
+++ b/src/components/MyActiveJobs/JobActions/CurrentTaskAction.jsx
@@ -1,6 +1,37 @@
-import React from 'react'
+import React, { useState, useRef } from 'react'
+
+import ModalCom from '../../Helpers/ModalCom'
+import LoadingSpinner from '../../Spinners/LoadingSpinner'
+
+function CurrentTaskAction({jobDetails}) {
+
+ const [checked, setChecked] = useState(false)
+
+ const [reqStatus, setReqStatus] = useState({loading:false, status: false, message: ''})
+
+ let [popUp, setPopUp] = useState(false)
+
+ const popUpHandler = () => {
+ if(popUp){
+ setChecked(false)
+ }
+ setPopUp(prev => !prev)
+ }
+
+ // FUNCTION TO HANDLE WHEN USER CLICKS ON SEND FOR REVIEW AND ACCEPTANCE
+ const taskCompletedSubmit = () => {
+ setReqStatus({loading:true, status: false, message: ''})
+ if(!checked){
+ setReqStatus({loading:false, status: false, message: 'Please check the box above'})
+ return setTimeout(()=>{
+ setReqStatus({loading:false, status: false, message: ''})
+ }, 3000)
+ }
+ setTimeout(()=>{
+ setReqStatus({loading:false, status: false, message: ''})
+ }, 3000)
+ }
-function CurrentTaskAction() {
return (
@@ -19,7 +50,7 @@ function CurrentTaskAction() {
-
@@ -28,7 +59,93 @@ function CurrentTaskAction() {
+ {popUp && (
+
+
+
+
+ Confirm Completion
+
+
+
+
+
+
+
+
+ {setChecked(prev => !prev)}}
+ className='w-6 h-6 text-sky-blue bg-gray-100 focus:ring-sky-blue'
+ />
+ If you have completed this task
+
+
+ {reqStatus.loading ?
+
+ :
+
+ Send for Review & Acceptance
+
+ }
+
+
+ {/* FOR SUCCESS/ERROR DISPLAY SECTION*/}
+
+ {reqStatus.message != "" &&
+ (!reqStatus.status ? (
+
+ {reqStatus.message}
+
+ ) : (
+ reqStatus.status && (
+
+ {reqStatus.message}
+
+ )
+ ))}
+
+ {/* END OF FOR SUCCESS/ERROR DISPLAY SECTION*/}
+
+
+ {/* cancel btn */}
+
+
+ Cancel
+
+
+
+
+
+ )}
)
}
diff --git a/src/components/MyActiveJobs/JobActions/IndexJobActions.jsx b/src/components/MyActiveJobs/JobActions/IndexJobActions.jsx
index d718675..c7646f7 100644
--- a/src/components/MyActiveJobs/JobActions/IndexJobActions.jsx
+++ b/src/components/MyActiveJobs/JobActions/IndexJobActions.jsx
@@ -16,11 +16,11 @@ function IndexJobActions({details}) { // FUNCTION TO RENDER SPECIFIC JOB ACTION
case 'OWNER':
return (()=>{
if(description == 'ACTIVE'){
- return
+ return
}else if(description == 'PASTDUE'){
- return
+ return
}else if(description == 'REVIEW'){
- return
+ return
} else {
return null
}
@@ -28,11 +28,11 @@ function IndexJobActions({details}) { // FUNCTION TO RENDER SPECIFIC JOB ACTION
case 'WORKER':
return (()=>{
if(description == 'ACTIVE'){
- return
+ return
}else if(description == 'PASTDUE'){
- return
+ return
}else if(description == 'REVIEW'){
- return
+ return
} else {
return null
}
|