Skip to content

Commit 29121fb

Browse files
committed
Make InviteReceiptPartnerPolicyPage use new SelectionList
1 parent a94d3c3 commit 29121fb

File tree

3 files changed

+17
-11
lines changed

3 files changed

+17
-11
lines changed

src/components/SelectionList/BaseSelectionList.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ function BaseSelectionList<TItem extends ListItem>({
4343
onSelectAll,
4444
onCheckboxPress,
4545
onScrollBeginDrag,
46+
onDismissError,
4647
onEndReached,
4748
onEndReachedThreshold,
4849
confirmButtonOptions,
@@ -329,6 +330,7 @@ function BaseSelectionList<TItem extends ListItem>({
329330
isFocused={isItemFocused}
330331
isDisabled={isItemDisabled}
331332
canSelectMultiple={canSelectMultiple}
333+
onDismissError={onDismissError}
332334
shouldSingleExecuteRowSelect={shouldSingleExecuteRowSelect}
333335
shouldPreventDefaultFocusOnSelectRow={shouldPreventDefaultFocusOnSelectRow}
334336
rightHandSideComponent={rightHandSideComponent}

src/components/SelectionList/types.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ type SelectionListProps<TItem extends ListItem> = Partial<ChildrenProps> & {
3232
/** Called when the list is scrolled and the user begins dragging */
3333
onScrollBeginDrag?: () => void;
3434

35+
/** Callback to fire when an error is dismissed */
36+
onDismissError?: (item: TItem) => void;
37+
3538
/** Called once when the scroll position gets within onEndReachedThreshold of the rendered content */
3639
onEndReached?: () => void;
3740

src/pages/workspace/receiptPartners/EditInviteReceiptPartnerPolicyPage.tsx

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import HeaderWithBackButton from '@components/HeaderWithBackButton';
77
import * as Expensicons from '@components/Icon/Expensicons';
88
import PressableWithDelayToggle from '@components/Pressable/PressableWithDelayToggle';
99
import ScreenWrapper from '@components/ScreenWrapper';
10-
import SelectionList from '@components/SelectionListWithSections';
11-
import type {ListItem} from '@components/SelectionListWithSections/types';
12-
import UserListItem from '@components/SelectionListWithSections/UserListItem';
10+
import SelectionList from '@components/SelectionList';
11+
import UserListItem from '@components/SelectionList/ListItem/UserListItem';
12+
import type {ListItem} from '@components/SelectionList/types';
1313
import TabSelector from '@components/TabSelector/TabSelector';
1414
import useDebouncedState from '@hooks/useDebouncedState';
1515
import {useMemoizedLazyIllustrations} from '@hooks/useLazyAsset';
@@ -317,20 +317,21 @@ function EditInviteReceiptPartnerPolicyPage({route}: EditInviteReceiptPartnerPol
317317
return (
318318
<TabScreenWithFocusTrapWrapper>
319319
<SelectionList
320+
data={filteredMembers}
320321
ListItem={UserListItem}
321322
onSelectRow={() => {}}
322323
onDismissError={dismissError}
323-
listItemWrapperStyle={styles.cursorDefault}
324+
style={{listItemWrapperStyle: styles.cursorDefault}}
324325
addBottomSafeAreaPadding
325326
shouldShowTextInput={shouldShowTextInput}
326-
textInputLabel={shouldShowTextInput ? translate('common.search') : undefined}
327-
textInputValue={searchTerm}
328-
onChangeText={setSearchTerm}
329-
headerMessage={currentHeaderMessage}
330-
sections={buildSections(filteredMembers)}
327+
textInputOptions={{
328+
label: shouldShowTextInput ? translate('common.search') : undefined,
329+
value: searchTerm,
330+
onChangeText: setSearchTerm,
331+
headerMessage: currentHeaderMessage,
332+
}}
331333
listEmptyContent={listEmptyContent}
332-
shouldShowListEmptyContent={shouldShowListEmptyContent}
333-
sectionListStyle={styles.pt3}
334+
showListEmptyContent={shouldShowListEmptyContent}
334335
/>
335336
</TabScreenWithFocusTrapWrapper>
336337
);

0 commit comments

Comments
 (0)