diff --git a/src/pages/WorkspaceSwitcherPage/WorkspacesSectionHeader.tsx b/src/pages/WorkspaceSwitcherPage/WorkspacesSectionHeader.tsx index 9c714e54704c..89d052d263db 100644 --- a/src/pages/WorkspaceSwitcherPage/WorkspacesSectionHeader.tsx +++ b/src/pages/WorkspaceSwitcherPage/WorkspacesSectionHeader.tsx @@ -13,7 +13,12 @@ import Navigation from '@libs/Navigation/Navigation'; import * as App from '@userActions/App'; import CONST from '@src/CONST'; -function WorkspacesSectionHeader() { +type WorkspacesSectionHeaderProps = { + /** Should show the create workspace icon */ + shouldShowCreateWorkspaceIcon: boolean; +}; + +function WorkspacesSectionHeader({shouldShowCreateWorkspaceIcon}: WorkspacesSectionHeaderProps) { const theme = useTheme(); const styles = useThemeStyles(); const {translate} = useLocalize(); @@ -28,26 +33,28 @@ function WorkspacesSectionHeader() { {translate('common.workspaces')} - - { - const activeRoute = Navigation.getActiveRouteWithoutParams(); - interceptAnonymousUser(() => App.createWorkspaceWithPolicyDraftAndNavigateToIt('', '', false, false, activeRoute)); - }} - > - {({hovered}) => ( - - )} - - + {shouldShowCreateWorkspaceIcon && ( + + { + const activeRoute = Navigation.getActiveRouteWithoutParams(); + interceptAnonymousUser(() => App.createWorkspaceWithPolicyDraftAndNavigateToIt('', '', false, false, activeRoute)); + }} + > + {({hovered}) => ( + + )} + + + )} ); } diff --git a/src/pages/WorkspaceSwitcherPage/index.tsx b/src/pages/WorkspaceSwitcherPage/index.tsx index 221889b80b49..d4d59638b592 100644 --- a/src/pages/WorkspaceSwitcherPage/index.tsx +++ b/src/pages/WorkspaceSwitcherPage/index.tsx @@ -183,7 +183,7 @@ function WorkspaceSwitcherPage() { pressableStyle={styles.flexRow} shouldSyncFocus={false} /> - + ListItem={UserListItem} sections={sections}