@@ -125,6 +125,7 @@ function WorkspacesListPage() {
125125 const icons = useMemoizedLazyExpensifyIcons ( [ 'Building' , 'Exit' , 'Copy' , 'Star' , 'Trashcan' , 'Transfer' , 'FallbackWorkspaceAvatar' , 'Plus' ] as const ) ;
126126 const theme = useTheme ( ) ;
127127 const styles = useThemeStyles ( ) ;
128+ const expensifyIcons = useMemoizedLazyExpensifyIcons ( [ 'Building' , 'Exit' , 'Copy' , 'Star' , 'Trashcan' , 'Transfer' , 'Plus' , 'FallbackWorkspaceAvatar' ] ) ;
128129 const { translate, localeCompare} = useLocalize ( ) ;
129130 const { isOffline} = useNetwork ( ) ;
130131 const isFocused = useIsFocused ( ) ;
@@ -339,15 +340,15 @@ function WorkspacesListPage() {
339340
340341 const threeDotsMenuItems : PopoverMenuItem [ ] = [
341342 {
342- icon : icons . Building ,
343+ icon : expensifyIcons . Building ,
343344 text : translate ( 'workspace.common.goToWorkspace' ) ,
344345 onSelected : item . action ,
345346 } ,
346347 ] ;
347348
348349 if ( ! isOwner && ( item . policyID !== preferredPolicyID || ! isRestrictedToPreferredPolicy ) ) {
349350 threeDotsMenuItems . push ( {
350- icon : icons . Exit ,
351+ icon : expensifyIcons . Exit ,
351352 text : translate ( 'common.leave' ) ,
352353 onSelected : callFunctionIfActionIsAllowed ( ( ) => {
353354 close ( ( ) => {
@@ -485,6 +486,8 @@ function WorkspacesListPage() {
485486 policyIDToDelete ,
486487 preferredPolicyID ,
487488 icons ,
489+ expensifyIcons . Building ,
490+ expensifyIcons . Exit ,
488491 ] ,
489492 ) ;
490493
@@ -726,39 +729,7 @@ function WorkspacesListPage() {
726729 [ getWorkspaceMenuItem , styles , translate ] ,
727730 ) ;
728731
729- if ( ! workspaces . length && ! domains . length ) {
730- return (
731- < ScreenWrapper
732- shouldEnablePickerAvoiding = { false }
733- shouldEnableMaxHeight
734- testID = { WorkspacesListPage . displayName }
735- shouldShowOfflineIndicatorInWideScreen
736- bottomContent = {
737- shouldUseNarrowLayout && (
738- < NavigationTabBar
739- selectedTab = { NAVIGATION_TABS . WORKSPACES }
740- shouldShowFloatingCameraButton = { false }
741- />
742- )
743- }
744- enableEdgeToEdgeBottomSafeAreaPadding = { false }
745- >
746- < View style = { styles . topBarWrapper } >
747- < TopBar breadcrumbLabel = { translate ( 'common.workspaces' ) } />
748- </ View >
749- { shouldShowLoadingIndicator ? (
750- < View style = { [ styles . flex1 ] } >
751- < FullScreenLoadingIndicator style = { [ styles . flex1 , styles . pRelative ] } />
752- </ View >
753- ) : (
754- < ScrollView contentContainerStyle = { [ styles . pt2 , styles . flexGrow1 , styles . flexShrink0 ] } >
755- < WorkspacesEmptyStateComponent />
756- </ ScrollView >
757- ) }
758- { shouldDisplayLHB && < NavigationTabBar selectedTab = { NAVIGATION_TABS . WORKSPACES } /> }
759- </ ScreenWrapper >
760- ) ;
761- }
732+ const shouldShowEmptyState = ! workspaces . length && ! domains . length ;
762733
763734 return (
764735 < ScreenWrapper
@@ -774,25 +745,43 @@ function WorkspacesListPage() {
774745 />
775746 )
776747 }
748+ shouldEnableMaxHeight = { shouldShowEmptyState }
777749 >
778- < View style = { styles . flex1 } >
779- < TopBar breadcrumbLabel = { translate ( 'common.workspaces' ) } > { ! shouldUseNarrowLayout && < View style = { [ styles . pr2 ] } > { getHeaderButton ( ) } </ View > } </ TopBar >
780- { shouldUseNarrowLayout && < View style = { [ styles . ph5 , styles . pt2 ] } > { getHeaderButton ( ) } </ View > }
781- < FlatList
782- ref = { flatlistRef }
783- data = { data }
784- onScrollToIndexFailed = { ( info ) => {
785- flatlistRef . current ?. scrollToOffset ( {
786- offset : info . averageItemLength * info . index ,
787- animated : true ,
788- } ) ;
789- } }
790- renderItem = { renderItem }
791- ListHeaderComponent = { listHeaderComponent }
792- keyboardShouldPersistTaps = "handled"
793- contentContainerStyle = { styles . pb20 }
794- />
795- </ View >
750+ { shouldShowEmptyState ? (
751+ < >
752+ < View style = { styles . topBarWrapper } >
753+ < TopBar breadcrumbLabel = { translate ( 'common.workspaces' ) } />
754+ </ View >
755+ { shouldShowLoadingIndicator ? (
756+ < View style = { [ styles . flex1 ] } >
757+ < FullScreenLoadingIndicator style = { [ styles . flex1 , styles . pRelative ] } />
758+ </ View >
759+ ) : (
760+ < ScrollView contentContainerStyle = { [ styles . pt2 , styles . flexGrow1 , styles . flexShrink0 ] } >
761+ < WorkspacesEmptyStateComponent />
762+ </ ScrollView >
763+ ) }
764+ </ >
765+ ) : (
766+ < View style = { styles . flex1 } >
767+ < TopBar breadcrumbLabel = { translate ( 'common.workspaces' ) } > { ! shouldUseNarrowLayout && < View style = { [ styles . pr2 ] } > { getHeaderButton ( ) } </ View > } </ TopBar >
768+ { shouldUseNarrowLayout && < View style = { [ styles . ph5 , styles . pt2 ] } > { getHeaderButton ( ) } </ View > }
769+ < FlatList
770+ ref = { flatlistRef }
771+ data = { data }
772+ onScrollToIndexFailed = { ( info ) => {
773+ flatlistRef . current ?. scrollToOffset ( {
774+ offset : info . averageItemLength * info . index ,
775+ animated : true ,
776+ } ) ;
777+ } }
778+ renderItem = { renderItem }
779+ ListHeaderComponent = { listHeaderComponent }
780+ keyboardShouldPersistTaps = "handled"
781+ contentContainerStyle = { styles . pb20 }
782+ />
783+ </ View >
784+ ) }
796785 < ConfirmModal
797786 title = { translate ( 'workspace.common.delete' ) }
798787 isVisible = { isDeleteModalOpen }
0 commit comments