diff --git a/src/components/MyActiveJobs/JobActions/CurrentTaskAction.jsx b/src/components/MyActiveJobs/JobActions/CurrentTaskAction.jsx index 7877744..a964f50 100644 --- a/src/components/MyActiveJobs/JobActions/CurrentTaskAction.jsx +++ b/src/components/MyActiveJobs/JobActions/CurrentTaskAction.jsx @@ -8,6 +8,10 @@ import usersService from '../../../services/UsersService' function CurrentTaskAction({jobDetails}) { + const currTime = new Date().getTime() / (1000*60*60) + const deliveryTime = new Date(jobDetails?.delivery_date).getTime() / (1000*60*60) + const canSendForReview = currTime >= (deliveryTime - Number(jobDetails?.strict_timeline ? jobDetails.strict_timeline : 0)) // calculation to determine when send for review button will be active + const apiCall = new usersService() const navigate = useNavigate() @@ -120,36 +124,56 @@ function CurrentTaskAction({jobDetails}) {
-
-
- {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 ? - - : - - } -
- - {/* FOR SUCCESS/ERROR DISPLAY SECTION*/} -
-
- {reqStatus.message} +
+ <> +
+ {setChecked(prev => !prev)}} + className='w-6 h-6 text-sky-blue bg-gray-100 focus:ring-sky-blue' + /> +

If you have completed this task

-
- {/* END OF FOR SUCCESS/ERROR DISPLAY SECTION*/} + +
+ {reqStatus.loading ? + + : + + } +
+ + {/* FOR SUCCESS/ERROR DISPLAY SECTION*/} + {reqStatus.message && +
+
+ {reqStatus.message} +
+
+ } + {/* END OF FOR SUCCESS/ERROR DISPLAY SECTION*/} + + {!canSendForReview && + <> +

+ This task requires you use about 80% of the time allocated +

+ + + } +
{/* cancel btn */}