-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Only bold user display name when it's unread in search page #37306
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,6 +55,9 @@ type ListItem = { | |
/** Whether this option is disabled for selection */ | ||
isDisabled?: boolean; | ||
|
||
/** List title is bold by default. Use this props to customize it */ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. NAB: |
||
isBold?: boolean; | ||
|
||
/** User accountID */ | ||
accountID?: number | null; | ||
|
||
|
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -2,6 +2,7 @@ import PropTypes from 'prop-types'; | |||
import React, {useEffect, useMemo, useState} from 'react'; | ||||
import {View} from 'react-native'; | ||||
import {withOnyx} from 'react-native-onyx'; | ||||
import _ from 'underscore'; | ||||
import HeaderWithBackButton from '@components/HeaderWithBackButton'; | ||||
import {usePersonalDetails} from '@components/OnyxProvider'; | ||||
import ScreenWrapper from '@components/ScreenWrapper'; | ||||
|
@@ -93,7 +94,7 @@ function SearchPage({betas, reports, isSearchingForReports}) { | |||
|
||||
if (recentReports.length > 0) { | ||||
newSections.push({ | ||||
data: recentReports, | ||||
data: _.map(recentReports, (report) => ({...report, isBold: report.isUnread})), | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This caused inconsistency with LHN where the bold style was applied based on other factors too (the notification preference of the report)
|
||||
shouldShow: true, | ||||
indexOffset, | ||||
}); | ||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NAB: Why do we need !== false if it's a boolean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we fix that with a default prop maybe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It could be undefined.
item
is an object, I'm not sure if we can set a default value for an object attribute.