Skip to content
Merged
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
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}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we default the sections to [] if not yet defined?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mountiny I think we don't need the default value here because we always have this option

Screenshot 2024-04-19 at 17 43 01

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