Skip to content

Commit

Permalink
Merge pull request #37306 from bernhardoj/fix/36075-search-page-bold
Browse files Browse the repository at this point in the history
Only bold user display name when it's unread in search page
  • Loading branch information
neil-marcellini authored Mar 1, 2024
2 parents 7587ff8 + 2093642 commit ea2bda2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/SelectionList/UserListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ function UserListItem({
style={[
styles.optionDisplayName,
isFocused ? styles.sidebarLinkActiveText : styles.sidebarLinkText,
styles.sidebarLinkTextBold,
item.isBold !== false && styles.sidebarLinkTextBold,
styles.pre,
item.alternateText ? styles.mb1 : null,
]}
Expand Down
3 changes: 3 additions & 0 deletions src/components/SelectionList/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ type ListItem = {
/** Whether this option is disabled for selection */
isDisabled?: boolean;

/** List title is bold by default. Use this props to customize it */
isBold?: boolean;

/** User accountID */
accountID?: number | null;

Expand Down
3 changes: 2 additions & 1 deletion src/pages/SearchPage/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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})),
shouldShow: true,
indexOffset,
});
Expand Down

0 comments on commit ea2bda2

Please sign in to comment.