Skip to content

Commit

Permalink
Merge pull request #40522 from Expensify/marco-fixWorkspaceSwitcher
Browse files Browse the repository at this point in the history
[CP Staging] Fix default selection in workspace switcher
  • Loading branch information
marcochavezf authored Apr 19, 2024
2 parents 0d595b3 + edaf634 commit 81d49b4
Showing 1 changed file with 16 additions and 20 deletions.
36 changes: 16 additions & 20 deletions src/pages/WorkspaceSwitcherPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -170,26 +170,22 @@ function WorkspaceSwitcherPage() {
testID={WorkspaceSwitcherPage.displayName}
includeSafeAreaPaddingBottom={false}
>
{({didScreenTransitionEnd}) => (
<>
<HeaderWithBackButton
title={translate('workspace.switcher.headerTitle')}
onBackButtonPress={Navigation.goBack}
/>
<SelectionList<WorkspaceListItem>
ListItem={UserListItem}
sections={didScreenTransitionEnd ? sections : CONST.EMPTY_ARRAY}
onSelectRow={selectPolicy}
textInputLabel={usersWorkspaces.length >= CONST.WORKSPACE_SWITCHER.MINIMUM_WORKSPACES_TO_SHOW_SEARCH ? translate('common.search') : undefined}
textInputValue={searchTerm}
onChangeText={setSearchTerm}
headerMessage={headerMessage}
listFooterContent={shouldShowCreateWorkspace ? WorkspaceCardCreateAWorkspaceInstance : null}
initiallyFocusedOptionKey={activeWorkspaceID ?? CONST.WORKSPACE_SWITCHER.NAME}
showLoadingPlaceholder
/>
</>
)}
<HeaderWithBackButton
title={translate('workspace.switcher.headerTitle')}
onBackButtonPress={Navigation.goBack}
/>
<SelectionList<WorkspaceListItem>
ListItem={UserListItem}
sections={sections}
onSelectRow={selectPolicy}
textInputLabel={usersWorkspaces.length >= CONST.WORKSPACE_SWITCHER.MINIMUM_WORKSPACES_TO_SHOW_SEARCH ? translate('common.search') : undefined}
textInputValue={searchTerm}
onChangeText={setSearchTerm}
headerMessage={headerMessage}
listFooterContent={shouldShowCreateWorkspace ? WorkspaceCardCreateAWorkspaceInstance : null}
initiallyFocusedOptionKey={activeWorkspaceID ?? CONST.WORKSPACE_SWITCHER.NAME}
showLoadingPlaceholder
/>
</ScreenWrapper>
);
}
Expand Down

0 comments on commit 81d49b4

Please sign in to comment.