Skip to content
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

Remove list headers #50655

Merged
merged 3 commits into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions src/components/SelectionList/CardListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import type {BankIcon} from '@src/types/onyx/Bank';
import BaseListItem from './BaseListItem';
import type {BaseListItemProps, ListItem} from './types';

type CardListItemProps<TItem extends ListItem> = BaseListItemProps<TItem & {bankIcon?: BankIcon; lastFourPAN?: string}>;
type CardListItemProps<TItem extends ListItem> = BaseListItemProps<TItem & {bankIcon?: BankIcon; lastFourPAN?: string; isVirtual?: boolean}>;

function CardListItem<TItem extends ListItem>({
item,
Expand All @@ -38,6 +38,11 @@ function CardListItem<TItem extends ListItem>({
}
}, [item, onCheckboxPress, onSelectRow]);

const subtitleText =
`${item.lastFourPAN ? `${translate('paymentMethodList.accountLastFour')} ${item.lastFourPAN}` : ''}` +
`${item.lastFourPAN && item.isVirtual ? ` ${CONST.DOT_SEPARATOR} ` : ''}` +
`${item.isVirtual ? translate('workspace.expensifyCard.virtual') : ''}`;

return (
<BaseListItem
item={item}
Expand Down Expand Up @@ -79,10 +84,10 @@ function CardListItem<TItem extends ListItem>({
item.alternateText ? styles.mb1 : null,
]}
/>
{!!item.lastFourPAN && (
{!!subtitleText && (
<TextWithTooltip
shouldShowTooltip={showTooltip}
text={`${translate('paymentMethodList.accountLastFour')} ${item.lastFourPAN}`}
text={subtitleText}
style={[styles.textLabelSupporting, styles.lh16, styles.pre]}
/>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ function SearchFiltersCardPage() {

return {
lastFourPAN: card.lastFourPAN,
isVirtual: card?.nameValuePairs?.isVirtual,
text: card.bank,
keyForList: card.cardID.toString(),
isSelected: newCards.includes(card.cardID.toString()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ function SearchFiltersCategoryPage() {
/>
<View style={[styles.flex1, safePaddingBottomStyle]}>
<SearchMultipleSelectionPicker
pickerTitle={translate('common.category')}
items={categoryItems}
initiallySelectedItems={selectedCategoriesItems}
onSaveSelection={onSaveSelection}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ function SearchFiltersCurrencyPage() {
/>
<View style={[styles.flex1]}>
<SearchMultipleSelectionPicker
pickerTitle={translate('search.filters.currency')}
items={currencyItems}
initiallySelectedItems={selectedCurrenciesItems}
onSaveSelection={handleOnSubmit}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ function SearchFiltersExpenseTypePage() {
/>
<View style={[styles.flex1]}>
<SearchMultipleSelectionPicker
pickerTitle={translate('search.expenseType')}
items={expenseTypesItems}
initiallySelectedItems={initiallySelectedItems}
onSaveSelection={updateExpenseTypeFilter}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ function SearchFiltersTagPage() {
/>
<View style={[styles.flex1]}>
<SearchMultipleSelectionPicker
pickerTitle={translate('common.tag')}
items={tagItems}
initiallySelectedItems={selectedTagsItems}
onSaveSelection={updateTagFilter}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ function SearchFiltersTaxRatePage() {
/>
<View style={[styles.flex1]}>
<SearchMultipleSelectionPicker
pickerTitle={translate('workspace.taxes.taxRate')}
items={taxItems}
initiallySelectedItems={selectedTaxesItems}
onSaveSelection={updateTaxRateFilters}
Expand Down
Loading