Compare commits

...

2 Commits

@@ -9,8 +9,8 @@ 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 minDueTime = new Date(jobDetails?.minimum_due).getTime() / (1000*60*60)
const canSendForReview = jobDetails.strict_timeline ? currTime >= minDueTime : true // calculation to determine when send for review button will be active
const apiCall = new usersService()
const navigate = useNavigate()
@@ -132,6 +132,7 @@ function CurrentTaskAction({jobDetails}) {
checked={checked}
onChange={()=>{setChecked(prev => !prev)}}
className='w-6 h-6 text-sky-blue bg-gray-100 focus:ring-sky-blue'
disabled={!canSendForReview}
/>
<p className='font-bold text-base tracking-wide text-dark-gray dark:text-white'>If you have completed this task</p>
</div>
@@ -143,7 +144,7 @@ function CurrentTaskAction({jobDetails}) {
<button
type="button"
onClick={taskCompletedSubmit}
className={`px-2 py-1 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white ${!canSendForReview && 'pointer-events-none'}`}
className={`px-2 py-1 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white ${!canSendForReview && 'pointer-events-none opacity-50'}`}
>
Send for Review & Acceptance
</button>