From edaf63456ce43ab26dea40eacc98108e3d32ace2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Ch=C3=A1vez?= Date: Thu, 18 Apr 2024 18:05:43 -0600 Subject: [PATCH] Pass sections directly --- src/pages/WorkspaceSwitcherPage/index.tsx | 36 ++++++++++------------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/src/pages/WorkspaceSwitcherPage/index.tsx b/src/pages/WorkspaceSwitcherPage/index.tsx index 0a5492536d56..f65ce10ce649 100644 --- a/src/pages/WorkspaceSwitcherPage/index.tsx +++ b/src/pages/WorkspaceSwitcherPage/index.tsx @@ -170,26 +170,22 @@ function WorkspaceSwitcherPage() { testID={WorkspaceSwitcherPage.displayName} includeSafeAreaPaddingBottom={false} > - {({didScreenTransitionEnd}) => ( - <> - - - 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 - /> - - )} + + + 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 + /> ); }