From b90828f6569d8ae2abc41c88646befc8817d95ce Mon Sep 17 00:00:00 2001 From: Dylan Date: Mon, 18 Sep 2023 13:54:22 +0700 Subject: [PATCH 1/2] default pointer in completed task --- src/components/ReportActionItem/TaskView.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/components/ReportActionItem/TaskView.js b/src/components/ReportActionItem/TaskView.js index 965c3120d51b..21d5520f53a2 100644 --- a/src/components/ReportActionItem/TaskView.js +++ b/src/components/ReportActionItem/TaskView.js @@ -50,7 +50,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 ( ( { + 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')} @@ -127,6 +131,7 @@ function TaskView(props) { wrapperStyle={[styles.pv2, styles.taskDescriptionMenuItem]} shouldGreyOutWhenDisabled={false} numberOfLinesTitle={0} + interactive={!isDisableInteractive} /> {props.report.managerID ? ( @@ -144,6 +149,7 @@ function TaskView(props) { wrapperStyle={[styles.pv2]} isSmallAvatarSubscriptMenu shouldGreyOutWhenDisabled={false} + interactive={!isDisableInteractive} /> ) : ( @@ -154,6 +160,7 @@ function TaskView(props) { disabled={disableState} wrapperStyle={[styles.pv2]} shouldGreyOutWhenDisabled={false} + interactive={!isDisableInteractive} /> )} From dc7cbae3daef109f431cfe41adeb101a59041aaa Mon Sep 17 00:00:00 2001 From: Dylan Date: Mon, 18 Sep 2023 14:19:58 +0700 Subject: [PATCH 2/2] fix lint --- src/components/ReportActionItem/TaskView.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/components/ReportActionItem/TaskView.js b/src/components/ReportActionItem/TaskView.js index 21d5520f53a2..5d56b477bb08 100644 --- a/src/components/ReportActionItem/TaskView.js +++ b/src/components/ReportActionItem/TaskView.js @@ -64,8 +64,8 @@ function TaskView(props) { {(hovered) => ( { - if (isDisableInteractive) { - return + if (isDisableInteractive) { + return; } if (e && e.type === 'click') { e.currentTarget.blur(); @@ -73,7 +73,12 @@ function TaskView(props) { Navigation.navigate(ROUTES.getTaskReportTitleRoute(props.report.reportID)); })} - style={({pressed}) => [styles.ph5, styles.pv2, StyleUtils.getButtonBackgroundColorStyle(getButtonState(hovered, pressed, false, disableState, !isDisableInteractive), true), isDisableInteractive && !disableState && styles.cursorDefault]} + 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')}