Skip to content

Commit 03888da

Browse files
authored
Merge pull request Expensify#72956 from software-mansion-labs/@GCyganek/migrate-WorkspaceMemberRoleSelectionModal-SelectionList
Make `WorkspaceMemberRoleSelectionModal` use new `SelectionList`
2 parents fb04ae1 + da45e35 commit 03888da

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

‎src/pages/workspace/WorkspaceMemberRoleSelectionModal.tsx‎

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@ import type {ValueOf} from 'type-fest';
44
import HeaderWithBackButton from '@components/HeaderWithBackButton';
55
import Modal from '@components/Modal';
66
import ScreenWrapper from '@components/ScreenWrapper';
7-
import SelectionList from '@components/SelectionListWithSections';
8-
import RadioListItem from '@components/SelectionListWithSections/RadioListItem';
7+
import SelectionList from '@components/SelectionList';
8+
import RadioListItem from '@components/SelectionList/ListItem/RadioListItem';
9+
import type {ListItem} from '@components/SelectionList/types';
910
import useLocalize from '@hooks/useLocalize';
1011
import useThemeStyles from '@hooks/useThemeStyles';
1112
import CONST from '@src/CONST';
1213

13-
type ListItemType = {
14+
type ListItemType = ListItem<ValueOf<typeof CONST.POLICY.ROLE>> & {
1415
value: ValueOf<typeof CONST.POLICY.ROLE>;
1516
text: string;
1617
alternateText: string;
1718
isSelected: boolean;
18-
keyForList: ValueOf<typeof CONST.POLICY.ROLE>;
1919
};
2020

2121
type WorkspaceMemberDetailsPageProps = {
@@ -55,12 +55,11 @@ function WorkspaceMemberDetailsRoleSelectionModal({isVisible, items, onRoleChang
5555
/>
5656
<View style={[styles.containerWithSpaceBetween, styles.pointerEventsBoxNone]}>
5757
<SelectionList
58-
sections={[{data: items}]}
58+
data={items}
5959
ListItem={RadioListItem}
6060
onSelectRow={onRoleChange}
61-
isAlternateTextMultilineSupported
6261
shouldSingleExecuteRowSelect
63-
initiallyFocusedOptionKey={items.find((item) => item.isSelected)?.keyForList}
62+
initiallyFocusedItemKey={items.find((item) => item.isSelected)?.keyForList}
6463
addBottomSafeAreaPadding
6564
/>
6665
</View>

0 commit comments

Comments
 (0)