Skip to content

Commit

Permalink
Merge pull request #27643 from DylanDylann/fix/27243
Browse files Browse the repository at this point in the history
Fix/27243: Display default pointer in completed task
  • Loading branch information
yuwenmemon authored Sep 21, 2023
2 parents f04a569 + dc7cbae commit 87f22c0
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/components/ReportActionItem/TaskView.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ function TaskView(props) {
const isOpen = ReportUtils.isOpenTaskReport(props.report);
const isCanceled = ReportUtils.isCanceledTaskReport(props.report);
const canModifyTask = Task.canModifyTask(props.report, props.currentUserPersonalDetails.accountID);
const disableState = !canModifyTask || !isOpen;
const disableState = !canModifyTask || isCanceled;
const isDisableInteractive = !canModifyTask || !isOpen;
return (
<View>
<OfflineWithFeedback
Expand All @@ -64,13 +65,21 @@ function TaskView(props) {
{(hovered) => (
<PressableWithSecondaryInteraction
onPress={Session.checkIfActionIsAllowed((e) => {
if (isDisableInteractive) {
return;
}
if (e && e.type === 'click') {
e.currentTarget.blur();
}

Navigation.navigate(ROUTES.getTaskReportTitleRoute(props.report.reportID));
})}
style={({pressed}) => [styles.ph5, styles.pv2, StyleUtils.getButtonBackgroundColorStyle(getButtonState(hovered, pressed, false, disableState), true)]}
style={({pressed}) => [
styles.ph5,
styles.pv2,
StyleUtils.getButtonBackgroundColorStyle(getButtonState(hovered, pressed, false, disableState, !isDisableInteractive), true),
isDisableInteractive && !disableState && styles.cursorDefault,
]}
ref={props.forwardedRef}
disabled={disableState}
accessibilityLabel={taskTitle || props.translate('task.task')}
Expand Down Expand Up @@ -129,6 +138,7 @@ function TaskView(props) {
wrapperStyle={[styles.pv2, styles.taskDescriptionMenuItem]}
shouldGreyOutWhenDisabled={false}
numberOfLinesTitle={0}
interactive={!isDisableInteractive}
/>
</OfflineWithFeedback>
{props.report.managerID ? (
Expand All @@ -146,6 +156,7 @@ function TaskView(props) {
wrapperStyle={[styles.pv2]}
isSmallAvatarSubscriptMenu
shouldGreyOutWhenDisabled={false}
interactive={!isDisableInteractive}
/>
</OfflineWithFeedback>
) : (
Expand All @@ -156,6 +167,7 @@ function TaskView(props) {
disabled={disableState}
wrapperStyle={[styles.pv2]}
shouldGreyOutWhenDisabled={false}
interactive={!isDisableInteractive}
/>
)}
</OfflineWithFeedback>
Expand Down

0 comments on commit 87f22c0

Please sign in to comment.