From 454c1786a89a1ea2190272a993a8ed414835c8f5 Mon Sep 17 00:00:00 2001 From: rayane-djouah <77965000+rayane-djouah@users.noreply.github.com> Date: Mon, 1 Apr 2024 00:19:11 +0100 Subject: [PATCH 01/14] Fix: Gray Replies does not disappear together with reply when reply is deleted --- src/pages/home/report/ReportActionsList.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/pages/home/report/ReportActionsList.tsx b/src/pages/home/report/ReportActionsList.tsx index d1b9c420b0af..3d635603e10a 100644 --- a/src/pages/home/report/ReportActionsList.tsx +++ b/src/pages/home/report/ReportActionsList.tsx @@ -532,14 +532,13 @@ function ReportActionsList({ mostRecentIOUReportActionID={mostRecentIOUReportActionID} shouldHideThreadDividerLine={shouldHideThreadDividerLine} shouldDisplayNewMarker={shouldDisplayNewMarker(reportAction, index)} - shouldDisplayReplyDivider={sortedReportActions.length > 1} + shouldDisplayReplyDivider={sortedVisibleReportActions.length > 1} /> ), [ report, linkedReportActionID, sortedVisibleReportActions, - sortedReportActions.length, mostRecentIOUReportActionID, shouldHideThreadDividerLine, shouldDisplayNewMarker, From ccbd4f6cf3c171a5ddef0e25ad1898ca06693d6b Mon Sep 17 00:00:00 2001 From: rayane-djouah <77965000+rayane-djouah@users.noreply.github.com> Date: Mon, 1 Apr 2024 02:47:42 +0100 Subject: [PATCH 02/14] Thread - Invited thread member can click on Thread when they are not a member of main chat --- src/components/ParentNavigationSubtitle.tsx | 4 ++++ src/libs/ReportUtils.ts | 8 ++++++++ src/pages/home/report/ReportActionItem.tsx | 7 ++++++- src/pages/home/report/ReportActionItemParentAction.tsx | 3 ++- src/pages/home/report/ThreadDivider.tsx | 5 ++++- src/styles/utils/index.ts | 4 ++-- 6 files changed, 26 insertions(+), 5 deletions(-) diff --git a/src/components/ParentNavigationSubtitle.tsx b/src/components/ParentNavigationSubtitle.tsx index 3109453ca6b0..a778e2a701db 100644 --- a/src/components/ParentNavigationSubtitle.tsx +++ b/src/components/ParentNavigationSubtitle.tsx @@ -25,6 +25,10 @@ function ParentNavigationSubtitle({parentNavigationSubtitleData, parentReportID const {translate} = useLocalize(); + if (!reportName){ + return; + } + return ( { diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index 9fa28535a7a7..652c99f2b491 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -5306,6 +5306,13 @@ function isReportParticipant(accountID: number, report: OnyxEntry): bool return possibleAccountIDs.includes(accountID); } +/** + * Check to see if the current user has access to view the report. + */ +function canCurrentUserOpenReport(report: OnyxEntry): boolean { + return (isReportParticipant(currentUserAccountID ?? 0, report) || isPublicRoom(report)) && canAccessReport(report, allPolicies, allBetas); +} + function shouldUseFullTitleToDisplay(report: OnyxEntry): boolean { return isMoneyRequestReport(report) || isPolicyExpenseChat(report) || isChatRoom(report) || isChatThread(report) || isTaskReport(report); } @@ -5857,6 +5864,7 @@ export { getChildReportNotificationPreference, getAllAncestorReportActions, isReportParticipant, + canCurrentUserOpenReport, isValidReport, getReportDescriptionText, isReportFieldOfTypeTitle, diff --git a/src/pages/home/report/ReportActionItem.tsx b/src/pages/home/report/ReportActionItem.tsx index 2716fedcf59a..e43f8fbbfc6b 100644 --- a/src/pages/home/report/ReportActionItem.tsx +++ b/src/pages/home/report/ReportActionItem.tsx @@ -145,6 +145,9 @@ type ReportActionItemProps = { /** Callback to be called on onPress */ onPress?: () => void; + + /** Should press be disabled */ + isDisabled?: boolean; } & ReportActionItemOnyxProps; const isIOUReport = (actionObj: OnyxEntry): actionObj is OnyxTypes.ReportActionBase & OnyxTypes.OriginalMessageIOU => @@ -169,6 +172,7 @@ function ReportActionItem({ policy, transaction, onPress = undefined, + isDisabled = false, }: ReportActionItemProps) { const {translate} = useLocalize(); const {isSmallScreenWidth} = useWindowDimensions(); @@ -831,6 +835,7 @@ function ReportActionItem({ isSmallScreenWidth && DeviceCapabilities.canUseTouchScreen() && ControlSelection.block()} onPressOut={() => ControlSelection.unblock()} @@ -860,7 +865,7 @@ function ReportActionItem({ checkIfContextMenuActive={toggleContextMenuFromActiveReportAction} setIsEmojiPickerActive={setIsEmojiPickerActive} /> - + ReportActions.clearAllRelatedReportActionErrors(report.reportID, action)} // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing diff --git a/src/pages/home/report/ReportActionItemParentAction.tsx b/src/pages/home/report/ReportActionItemParentAction.tsx index 3d98973c86c4..c55cae369410 100644 --- a/src/pages/home/report/ReportActionItemParentAction.tsx +++ b/src/pages/home/report/ReportActionItemParentAction.tsx @@ -101,9 +101,10 @@ function ReportActionItemParentAction({ errorRowStyles={[styles.ml10, styles.mr2]} onClose={() => Report.navigateToConciergeChatAndDeleteReport(ancestor.report.reportID)} > - + Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(ancestor.report.parentReportID ?? ''))} + isDisabled={!ReportUtils.canCurrentUserOpenReport(ReportUtils.getReport(ancestor?.report?.parentReportID) as OnyxTypes.Report)} parentReportAction={parentReportAction} report={ancestor.report} reportActions={reportActions} diff --git a/src/pages/home/report/ThreadDivider.tsx b/src/pages/home/report/ThreadDivider.tsx index 083129e15e6d..4500af526428 100644 --- a/src/pages/home/report/ThreadDivider.tsx +++ b/src/pages/home/report/ThreadDivider.tsx @@ -16,9 +16,11 @@ import ROUTES from '@src/ROUTES'; type ThreadDividerProps = { /** Thread ancestor */ ancestor: Ancestor; + /** Whether the link is disbled */ + isDisabled: boolean; }; -function ThreadDivider({ancestor}: ThreadDividerProps) { +function ThreadDivider({ancestor, isDisabled}: ThreadDividerProps) { const styles = useThemeStyles(); const theme = useTheme(); const {translate} = useLocalize(); @@ -30,6 +32,7 @@ function ThreadDivider({ancestor}: ThreadDividerProps) { accessibilityLabel={translate('threads.thread')} role={CONST.ROLE.BUTTON} style={[styles.flexRow, styles.alignItemsCenter, styles.gap1]} + disabled={isDisabled} > ({ /** * Generate the styles for the ReportActionItem wrapper view. */ - getReportActionItemStyle: (isHovered = false, isClickable = false): ViewStyle => + getReportActionItemStyle: (isHovered = false, isClickable = false, isDisabled = false): ViewStyle => // TODO: Remove this "eslint-disable-next" once the theme switching migration is done and styles are fully typed (GH Issue: https://github.com/Expensify/App/issues/27337) // eslint-disable-next-line @typescript-eslint/no-unsafe-return ({ @@ -1462,7 +1462,7 @@ const createStyleUtils = (theme: ThemeColors, styles: ThemeStyles) => ({ : // Warning: Setting this to a non-transparent color will cause unread indicator to break on Android theme.transparent, opacity: 1, - ...(isClickable ? styles.cursorPointer : styles.cursorInitial), + ...(isDisabled ? styles.cursorDisabled : (isClickable ? styles.cursorPointer : styles.cursorInitial)), }), /** From 2fc36ea9e2ea31ab8a4cb32135f003f9027c13f7 Mon Sep 17 00:00:00 2001 From: rayane-djouah <77965000+rayane-djouah@users.noreply.github.com> Date: Mon, 1 Apr 2024 02:48:36 +0100 Subject: [PATCH 03/14] Fix: Thread-Cursor is hand cursor instead of text cursor when hovering over edit composer in thread --- src/pages/home/report/ReportActionItem.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/home/report/ReportActionItem.tsx b/src/pages/home/report/ReportActionItem.tsx index e43f8fbbfc6b..732e7ce06e55 100644 --- a/src/pages/home/report/ReportActionItem.tsx +++ b/src/pages/home/report/ReportActionItem.tsx @@ -865,7 +865,7 @@ function ReportActionItem({ checkIfContextMenuActive={toggleContextMenuFromActiveReportAction} setIsEmojiPickerActive={setIsEmojiPickerActive} /> - + ReportActions.clearAllRelatedReportActionErrors(report.reportID, action)} // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing From 80078c34e96b189b79396e40999043155836f410 Mon Sep 17 00:00:00 2001 From: rayane-djouah <77965000+rayane-djouah@users.noreply.github.com> Date: Mon, 1 Apr 2024 02:51:19 +0100 Subject: [PATCH 04/14] prettier --- src/components/ParentNavigationSubtitle.tsx | 2 +- src/pages/home/report/ReportActionItem.tsx | 8 +++++++- src/pages/home/report/ReportActionItemParentAction.tsx | 5 ++++- src/styles/utils/index.ts | 2 +- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/components/ParentNavigationSubtitle.tsx b/src/components/ParentNavigationSubtitle.tsx index a778e2a701db..24b2ddf8a10c 100644 --- a/src/components/ParentNavigationSubtitle.tsx +++ b/src/components/ParentNavigationSubtitle.tsx @@ -25,7 +25,7 @@ function ParentNavigationSubtitle({parentNavigationSubtitleData, parentReportID const {translate} = useLocalize(); - if (!reportName){ + if (!reportName) { return; } diff --git a/src/pages/home/report/ReportActionItem.tsx b/src/pages/home/report/ReportActionItem.tsx index 732e7ce06e55..ebabb189a23d 100644 --- a/src/pages/home/report/ReportActionItem.tsx +++ b/src/pages/home/report/ReportActionItem.tsx @@ -865,7 +865,13 @@ function ReportActionItem({ checkIfContextMenuActive={toggleContextMenuFromActiveReportAction} setIsEmojiPickerActive={setIsEmojiPickerActive} /> - + ReportActions.clearAllRelatedReportActionErrors(report.reportID, action)} // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing diff --git a/src/pages/home/report/ReportActionItemParentAction.tsx b/src/pages/home/report/ReportActionItemParentAction.tsx index c55cae369410..4bdbe842df96 100644 --- a/src/pages/home/report/ReportActionItemParentAction.tsx +++ b/src/pages/home/report/ReportActionItemParentAction.tsx @@ -101,7 +101,10 @@ function ReportActionItemParentAction({ errorRowStyles={[styles.ml10, styles.mr2]} onClose={() => Report.navigateToConciergeChatAndDeleteReport(ancestor.report.reportID)} > - + Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(ancestor.report.parentReportID ?? ''))} isDisabled={!ReportUtils.canCurrentUserOpenReport(ReportUtils.getReport(ancestor?.report?.parentReportID) as OnyxTypes.Report)} diff --git a/src/styles/utils/index.ts b/src/styles/utils/index.ts index 34ba0fdb9a8d..59f0a6fb322e 100644 --- a/src/styles/utils/index.ts +++ b/src/styles/utils/index.ts @@ -1462,7 +1462,7 @@ const createStyleUtils = (theme: ThemeColors, styles: ThemeStyles) => ({ : // Warning: Setting this to a non-transparent color will cause unread indicator to break on Android theme.transparent, opacity: 1, - ...(isDisabled ? styles.cursorDisabled : (isClickable ? styles.cursorPointer : styles.cursorInitial)), + ...(isDisabled ? styles.cursorDisabled : isClickable ? styles.cursorPointer : styles.cursorInitial), }), /** From 92fd58acbca1d92dbf9399c2eabce84b2a1b82c7 Mon Sep 17 00:00:00 2001 From: rayane-djouah <77965000+rayane-djouah@users.noreply.github.com> Date: Mon, 1 Apr 2024 02:55:49 +0100 Subject: [PATCH 05/14] fix lint error --- src/styles/utils/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/styles/utils/index.ts b/src/styles/utils/index.ts index 59f0a6fb322e..1ef2298392ae 100644 --- a/src/styles/utils/index.ts +++ b/src/styles/utils/index.ts @@ -1462,6 +1462,7 @@ const createStyleUtils = (theme: ThemeColors, styles: ThemeStyles) => ({ : // Warning: Setting this to a non-transparent color will cause unread indicator to break on Android theme.transparent, opacity: 1, + // eslint-disable-next-line no-nested-ternary ...(isDisabled ? styles.cursorDisabled : isClickable ? styles.cursorPointer : styles.cursorInitial), }), From f38039d720ce9c639eac7a784d923e4501472d81 Mon Sep 17 00:00:00 2001 From: rayane-djouah <77965000+rayane-djouah@users.noreply.github.com> Date: Tue, 2 Apr 2024 04:36:58 +0100 Subject: [PATCH 06/14] added explanation comment --- src/components/ParentNavigationSubtitle.tsx | 1 + src/pages/home/report/ThreadDivider.tsx | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/ParentNavigationSubtitle.tsx b/src/components/ParentNavigationSubtitle.tsx index 24b2ddf8a10c..e8cb2e634045 100644 --- a/src/components/ParentNavigationSubtitle.tsx +++ b/src/components/ParentNavigationSubtitle.tsx @@ -25,6 +25,7 @@ function ParentNavigationSubtitle({parentNavigationSubtitleData, parentReportID const {translate} = useLocalize(); + // We should not display the parent navigation subtitle if the user does not have access to the parent chat (the reportName is empty in this case) if (!reportName) { return; } diff --git a/src/pages/home/report/ThreadDivider.tsx b/src/pages/home/report/ThreadDivider.tsx index 4500af526428..d055ea6a9da4 100644 --- a/src/pages/home/report/ThreadDivider.tsx +++ b/src/pages/home/report/ThreadDivider.tsx @@ -16,7 +16,8 @@ import ROUTES from '@src/ROUTES'; type ThreadDividerProps = { /** Thread ancestor */ ancestor: Ancestor; - /** Whether the link is disbled */ + + /** Whether the link is disabled */ isDisabled: boolean; }; From 928b10f8484ab5fdfd8b8680bcd6e46fc40f01b1 Mon Sep 17 00:00:00 2001 From: rayane-djouah <77965000+rayane-djouah@users.noreply.github.com> Date: Tue, 2 Apr 2024 18:03:40 +0100 Subject: [PATCH 07/14] make the thread link look gray when it's disabled --- src/pages/home/report/ThreadDivider.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/home/report/ThreadDivider.tsx b/src/pages/home/report/ThreadDivider.tsx index d055ea6a9da4..98bcec50750e 100644 --- a/src/pages/home/report/ThreadDivider.tsx +++ b/src/pages/home/report/ThreadDivider.tsx @@ -37,11 +37,11 @@ function ThreadDivider({ancestor, isDisabled}: ThreadDividerProps) { > - {translate('threads.thread')} + {translate('threads.thread')} {!ancestor.shouldDisplayNewMarker && } From 2c4a34a8e7765dbae30e0fd9ce223e7ffef4135b Mon Sep 17 00:00:00 2001 From: rayane-djouah <77965000+rayane-djouah@users.noreply.github.com> Date: Tue, 2 Apr 2024 18:04:58 +0100 Subject: [PATCH 08/14] prevent Thread and Replies words from being copied --- src/pages/home/report/RepliesDivider.tsx | 2 +- src/pages/home/report/ThreadDivider.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/home/report/RepliesDivider.tsx b/src/pages/home/report/RepliesDivider.tsx index deac38596c99..9d237e20b9c9 100644 --- a/src/pages/home/report/RepliesDivider.tsx +++ b/src/pages/home/report/RepliesDivider.tsx @@ -19,7 +19,7 @@ function RepliesDivider({shouldHideThreadDividerLine}: RepliesDividerProps) { const {translate} = useLocalize(); return ( - + + Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(ancestor?.report?.parentReportID ?? ''))} accessibilityLabel={translate('threads.thread')} From 4860d792d5ee863fef8e8ca053261eec7049dfdf Mon Sep 17 00:00:00 2001 From: rayane-djouah <77965000+rayane-djouah@users.noreply.github.com> Date: Tue, 2 Apr 2024 18:34:48 +0100 Subject: [PATCH 09/14] prevent Thread and Replies words from being selected and copied --- src/pages/home/report/RepliesDivider.tsx | 8 ++++++-- src/pages/home/report/ThreadDivider.tsx | 5 ++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/pages/home/report/RepliesDivider.tsx b/src/pages/home/report/RepliesDivider.tsx index 9d237e20b9c9..d6d5e1d3cfc8 100644 --- a/src/pages/home/report/RepliesDivider.tsx +++ b/src/pages/home/report/RepliesDivider.tsx @@ -7,6 +7,7 @@ import useLocalize from '@hooks/useLocalize'; import useTheme from '@hooks/useTheme'; import useThemeStyles from '@hooks/useThemeStyles'; import variables from '@styles/variables'; +import CONST from '@src/CONST'; type RepliesDividerProps = { /** Whether we should hide thread divider line */ @@ -19,14 +20,17 @@ function RepliesDivider({shouldHideThreadDividerLine}: RepliesDividerProps) { const {translate} = useLocalize(); return ( - + - {translate('threads.replies')} + {translate('threads.replies')} {!shouldHideThreadDividerLine && } ); diff --git a/src/pages/home/report/ThreadDivider.tsx b/src/pages/home/report/ThreadDivider.tsx index 360408c4a823..2ac2d6449f67 100644 --- a/src/pages/home/report/ThreadDivider.tsx +++ b/src/pages/home/report/ThreadDivider.tsx @@ -27,7 +27,10 @@ function ThreadDivider({ancestor, isDisabled}: ThreadDividerProps) { const {translate} = useLocalize(); return ( - + Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(ancestor?.report?.parentReportID ?? ''))} accessibilityLabel={translate('threads.thread')} From eecb6947137154352ce9867a6f80b3830aa4c397 Mon Sep 17 00:00:00 2001 From: rayane-djouah <77965000+rayane-djouah@users.noreply.github.com> Date: Tue, 2 Apr 2024 19:14:04 +0100 Subject: [PATCH 10/14] make isDisabled prop optional --- src/pages/home/report/ThreadDivider.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/home/report/ThreadDivider.tsx b/src/pages/home/report/ThreadDivider.tsx index 2ac2d6449f67..a6830eea3de2 100644 --- a/src/pages/home/report/ThreadDivider.tsx +++ b/src/pages/home/report/ThreadDivider.tsx @@ -18,10 +18,10 @@ type ThreadDividerProps = { ancestor: Ancestor; /** Whether the link is disabled */ - isDisabled: boolean; + isDisabled?: boolean; }; -function ThreadDivider({ancestor, isDisabled}: ThreadDividerProps) { +function ThreadDivider({ancestor, isDisabled = false}: ThreadDividerProps) { const styles = useThemeStyles(); const theme = useTheme(); const {translate} = useLocalize(); From bc4b3654f192fa4e94211cf4807c2c27c8b7a3d1 Mon Sep 17 00:00:00 2001 From: rayane-djouah <77965000+rayane-djouah@users.noreply.github.com> Date: Thu, 4 Apr 2024 18:43:16 +0100 Subject: [PATCH 11/14] Remove not allowed cursor on hover for the top-most message when the user don't have access to the parent thread --- src/pages/home/report/ReportActionItem.tsx | 6 ------ src/pages/home/report/ReportActionItemParentAction.tsx | 7 +++++-- src/styles/utils/index.ts | 4 ++-- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/pages/home/report/ReportActionItem.tsx b/src/pages/home/report/ReportActionItem.tsx index a0acfe686c16..7c7ddd5e9efd 100644 --- a/src/pages/home/report/ReportActionItem.tsx +++ b/src/pages/home/report/ReportActionItem.tsx @@ -145,9 +145,6 @@ type ReportActionItemProps = { /** Callback to be called on onPress */ onPress?: () => void; - - /** Should press be disabled */ - isDisabled?: boolean; } & ReportActionItemOnyxProps; const isIOUReport = (actionObj: OnyxEntry): actionObj is OnyxTypes.ReportActionBase & OnyxTypes.OriginalMessageIOU => @@ -172,7 +169,6 @@ function ReportActionItem({ policy, transaction, onPress = undefined, - isDisabled = false, }: ReportActionItemProps) { const {translate} = useLocalize(); const {isSmallScreenWidth} = useWindowDimensions(); @@ -835,7 +831,6 @@ function ReportActionItem({ isSmallScreenWidth && DeviceCapabilities.canUseTouchScreen() && ControlSelection.block()} onPressOut={() => ControlSelection.unblock()} @@ -869,7 +864,6 @@ function ReportActionItem({ style={StyleUtils.getReportActionItemStyle( hovered || isWhisper || isContextMenuActive || !!isEmojiPickerActive || draftMessage !== undefined, draftMessage === undefined && !!onPress, - isDisabled, )} > Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(ancestor.report.parentReportID ?? ''))} - isDisabled={!ReportUtils.canCurrentUserOpenReport(ReportUtils.getReport(ancestor?.report?.parentReportID) as OnyxTypes.Report)} + onPress={ + ReportUtils.canCurrentUserOpenReport(ReportUtils.getReport(ancestor?.report?.parentReportID) as OnyxTypes.Report) + ? () => Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(ancestor.report.parentReportID ?? '')) + : undefined + } parentReportAction={parentReportAction} report={ancestor.report} reportActions={reportActions} diff --git a/src/styles/utils/index.ts b/src/styles/utils/index.ts index 1ef2298392ae..329cc4fbdf85 100644 --- a/src/styles/utils/index.ts +++ b/src/styles/utils/index.ts @@ -1451,7 +1451,7 @@ const createStyleUtils = (theme: ThemeColors, styles: ThemeStyles) => ({ /** * Generate the styles for the ReportActionItem wrapper view. */ - getReportActionItemStyle: (isHovered = false, isClickable = false, isDisabled = false): ViewStyle => + getReportActionItemStyle: (isHovered = false, isClickable = false): ViewStyle => // TODO: Remove this "eslint-disable-next" once the theme switching migration is done and styles are fully typed (GH Issue: https://github.com/Expensify/App/issues/27337) // eslint-disable-next-line @typescript-eslint/no-unsafe-return ({ @@ -1463,7 +1463,7 @@ const createStyleUtils = (theme: ThemeColors, styles: ThemeStyles) => ({ theme.transparent, opacity: 1, // eslint-disable-next-line no-nested-ternary - ...(isDisabled ? styles.cursorDisabled : isClickable ? styles.cursorPointer : styles.cursorInitial), + ...(isClickable ? styles.cursorPointer : styles.cursorInitial), }), /** From 623345d9680499039df73712ac5cbae177ecdd31 Mon Sep 17 00:00:00 2001 From: rayane-djouah <77965000+rayane-djouah@users.noreply.github.com> Date: Thu, 4 Apr 2024 20:25:05 +0100 Subject: [PATCH 12/14] Remove not allowed cursor on hover for the 'Thread' link for when it is disabled (use default cursor) --- .../report/ReportActionItemParentAction.tsx | 2 +- src/pages/home/report/ThreadDivider.tsx | 45 ++++++++++++------- 2 files changed, 29 insertions(+), 18 deletions(-) diff --git a/src/pages/home/report/ReportActionItemParentAction.tsx b/src/pages/home/report/ReportActionItemParentAction.tsx index f2117cb57191..d4119e738eac 100644 --- a/src/pages/home/report/ReportActionItemParentAction.tsx +++ b/src/pages/home/report/ReportActionItemParentAction.tsx @@ -103,7 +103,7 @@ function ReportActionItemParentAction({ > - Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(ancestor?.report?.parentReportID ?? ''))} - accessibilityLabel={translate('threads.thread')} - role={CONST.ROLE.BUTTON} - style={[styles.flexRow, styles.alignItemsCenter, styles.gap1]} - disabled={isDisabled} - > - - {translate('threads.thread')} - + {isLinkDisabled ? ( + <> + + {translate('threads.thread')} + + ) : ( + Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(ancestor?.report?.parentReportID ?? ''))} + accessibilityLabel={translate('threads.thread')} + role={CONST.ROLE.BUTTON} + style={[styles.flexRow, styles.alignItemsCenter, styles.gap1]} + > + + {translate('threads.thread')} + + )} {!ancestor.shouldDisplayNewMarker && } ); From 0f7ecdb40060b838e11d2c906f5545d523729b1d Mon Sep 17 00:00:00 2001 From: rayane-djouah <77965000+rayane-djouah@users.noreply.github.com> Date: Mon, 8 Apr 2024 16:52:59 +0100 Subject: [PATCH 13/14] remove comment --- src/styles/utils/index.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/styles/utils/index.ts b/src/styles/utils/index.ts index 329cc4fbdf85..a3357b8982a1 100644 --- a/src/styles/utils/index.ts +++ b/src/styles/utils/index.ts @@ -1462,7 +1462,6 @@ const createStyleUtils = (theme: ThemeColors, styles: ThemeStyles) => ({ : // Warning: Setting this to a non-transparent color will cause unread indicator to break on Android theme.transparent, opacity: 1, - // eslint-disable-next-line no-nested-ternary ...(isClickable ? styles.cursorPointer : styles.cursorInitial), }), From 2a38baacb0f59c0a4349b4118adbb9edda97fea2 Mon Sep 17 00:00:00 2001 From: rayane-djouah <77965000+rayane-djouah@users.noreply.github.com> Date: Tue, 9 Apr 2024 18:52:15 +0100 Subject: [PATCH 14/14] Fix lint error --- src/pages/home/report/ReportActionItemParentAction.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/home/report/ReportActionItemParentAction.tsx b/src/pages/home/report/ReportActionItemParentAction.tsx index d4119e738eac..afbeb734e2b6 100644 --- a/src/pages/home/report/ReportActionItemParentAction.tsx +++ b/src/pages/home/report/ReportActionItemParentAction.tsx @@ -103,11 +103,11 @@ function ReportActionItemParentAction({ > Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(ancestor.report.parentReportID ?? '')) : undefined }