Skip to content

Commit 47e6ad6

Browse files
Apply unreported badge selected color to mobile/narrow layout
The buttonHoveredBG color for selected unreported badges was only applied in StatusCell (wide/desktop layout). On mobile/narrow screens, UserInfoAndActionButtonRow renders StatusBadge directly and was missing the isSelected-based color logic. Pass isSelected through from all three callers and apply the same conditional background. Co-authored-by: Jayesh Mangwani <jayeshmangwani@users.noreply.github.com>
1 parent 498b43e commit 47e6ad6

4 files changed

Lines changed: 8 additions & 1 deletion

File tree

src/components/Search/SearchList/ListItem/ExpenseReportListItem.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,7 @@ function ExpenseReportListItem<TItem extends ListItem>({
299299
shouldShowUserInfo={!!reportItem?.from}
300300
stateNum={reportItem.stateNum}
301301
statusNum={reportItem.statusNum}
302+
isSelected={!!reportItem.isSelected}
302303
/>
303304
)}
304305
{!isLargeScreenWidth && (

src/components/Search/SearchList/ListItem/ReportListItemHeader.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@ function ReportListItemHeader<TItem extends ListItem>({
251251
containerStyles={[styles.pr3, styles.mb2]}
252252
stateNum={reportItem.stateNum}
253253
statusNum={reportItem.statusNum}
254+
isSelected={!!reportItem.isSelected}
254255
/>
255256
<HeaderFirstRow
256257
report={reportItem}

src/components/Search/SearchList/ListItem/TransactionListItem.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,7 @@ function TransactionListItem<TItem extends ListItem>({
237237
shouldShowUserInfo={!isDeletedTransaction && !!transactionItem?.from}
238238
stateNum={transactionItem.report?.stateNum}
239239
statusNum={transactionItem.report?.statusNum}
240+
isSelected={!!transactionItem.isSelected}
240241
/>
241242
)}
242243
<TransactionItemRow

src/components/Search/SearchList/ListItem/UserInfoAndActionButtonRow.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,22 @@ function UserInfoAndActionButtonRow({
2020
containerStyles,
2121
stateNum,
2222
statusNum,
23+
isSelected,
2324
}: {
2425
item: TransactionReportGroupListItemType | TransactionListItemType | ExpenseReportListItemType;
2526
shouldShowUserInfo: boolean;
2627
containerStyles?: StyleProp<ViewStyle>;
2728
stateNum: ExpenseReportListItemType['stateNum'];
2829
statusNum: ExpenseReportListItemType['statusNum'];
30+
isSelected?: boolean;
2931
}) {
3032
const styles = useThemeStyles();
3133
const theme = useTheme();
3234
const {translate} = useLocalize();
3335
const statusText = getReportStatusTranslation({stateNum, statusNum, translate});
3436
const reportStatusColorStyle = getReportStatusColorStyle(theme, stateNum, statusNum);
37+
const isUnreported = stateNum === undefined && statusNum === undefined;
38+
const badgeBackgroundColor = isSelected && isUnreported ? theme.buttonHoveredBG : reportStatusColorStyle?.backgroundColor;
3539
const participantFromDisplayName = item.formattedFrom ?? item?.from?.displayName ?? '';
3640
return (
3741
<View style={[styles.pt0, styles.flexRow, styles.alignItemsCenter, shouldShowUserInfo ? styles.justifyContentBetween : styles.justifyContentEnd, styles.gap2, containerStyles]}>
@@ -53,7 +57,7 @@ function UserInfoAndActionButtonRow({
5357
{!!statusText && !!reportStatusColorStyle && (
5458
<StatusBadge
5559
text={statusText}
56-
backgroundColor={reportStatusColorStyle.backgroundColor}
60+
backgroundColor={badgeBackgroundColor}
5761
textColor={reportStatusColorStyle.textColor}
5862
/>
5963
)}

0 commit comments

Comments
 (0)