diff --git a/src/components/LHNOptionsList/OptionRowLHN.tsx b/src/components/LHNOptionsList/OptionRowLHN.tsx index 431a12d00106..cee949133eb2 100644 --- a/src/components/LHNOptionsList/OptionRowLHN.tsx +++ b/src/components/LHNOptionsList/OptionRowLHN.tsx @@ -84,7 +84,7 @@ function OptionRowLHN({reportID, isFocused = false, onSelectRow = () => {}, opti const hasBrickError = optionItem.brickRoadIndicator === CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR; const shouldShowGreenDotIndicator = !hasBrickError && ReportUtils.requiresAttentionFromCurrentUser(optionItem, optionItem.parentReportAction); const textStyle = isFocused ? styles.sidebarLinkActiveText : styles.sidebarLinkText; - const textUnreadStyle = optionItem?.isUnread && optionItem.notificationPreference !== CONST.REPORT.NOTIFICATION_PREFERENCE.MUTE ? [textStyle, styles.sidebarLinkTextBold] : [textStyle]; + const textUnreadStyle = OptionsListUtils.shouldUseBoldText(optionItem) ? [textStyle, styles.sidebarLinkTextBold] : [textStyle]; const displayNameStyle = [styles.optionDisplayName, styles.optionDisplayNameCompact, styles.pre, textUnreadStyle, style]; const alternateTextStyle = isInFocusMode ? [textStyle, styles.textLabelSupporting, styles.optionAlternateTextCompact, styles.ml2, style] diff --git a/src/libs/OptionsListUtils.ts b/src/libs/OptionsListUtils.ts index b9be3ffac761..f70a3e570e71 100644 --- a/src/libs/OptionsListUtils.ts +++ b/src/libs/OptionsListUtils.ts @@ -795,6 +795,7 @@ function createOption( result.isWaitingOnBankAccount = report.isWaitingOnBankAccount; result.policyID = report.policyID; result.isSelfDM = ReportUtils.isSelfDM(report); + result.notificationPreference = report.notificationPreference; const visibleParticipantAccountIDs = ReportUtils.getParticipantsAccountIDsForDisplay(report, true); @@ -2547,6 +2548,10 @@ function sortItemsAlphabetically(membersList: T[]): T[] { return membersList.sort((a, b) => (a.text ?? '').toLowerCase().localeCompare((b.text ?? '').toLowerCase())); } +function shouldUseBoldText(report: ReportUtils.OptionData): boolean { + return report.isUnread === true && report.notificationPreference !== CONST.REPORT.NOTIFICATION_PREFERENCE.MUTE; +} + export { getAvatarsForAccountIDs, isCurrentUser, @@ -2590,6 +2595,7 @@ export { shouldShowViolations, getPersonalDetailSearchTerms, getCurrentUserSearchTerms, + shouldUseBoldText, }; export type {MemberForList, CategorySection, CategoryTreeSection, Options, OptionList, SearchOption, PayeePersonalDetails, Category, Tax, TaxRatesOption, Option, OptionTree}; diff --git a/src/pages/ChatFinderPage/index.tsx b/src/pages/ChatFinderPage/index.tsx index 80cd744d56fe..1a990b5daffe 100644 --- a/src/pages/ChatFinderPage/index.tsx +++ b/src/pages/ChatFinderPage/index.tsx @@ -123,14 +123,16 @@ function ChatFinderPage({betas, isSearchingForReports, navigation}: ChatFinderPa if (recentReports?.length > 0) { newSections.push({ - data: recentReports.map((report) => ({...report, isBold: report.isUnread})), + data: recentReports.map((report) => { + return {...report, isBold: OptionsListUtils.shouldUseBoldText(report)}; + }), shouldShow: true, }); } if (localPersonalDetails.length > 0) { newSections.push({ - data: localPersonalDetails, + data: localPersonalDetails.map((personalDetail) => ({...personalDetail, isBold: false})), shouldShow: true, }); }