diff --git a/src/pages/WorkspaceSwitcherPage/WorkspacesSectionHeader.tsx b/src/pages/WorkspaceSwitcherPage/WorkspacesSectionHeader.tsx deleted file mode 100644 index 89d052d263db..000000000000 --- a/src/pages/WorkspaceSwitcherPage/WorkspacesSectionHeader.tsx +++ /dev/null @@ -1,62 +0,0 @@ -import React from 'react'; -import {View} from 'react-native'; -import Icon from '@components/Icon'; -import * as Expensicons from '@components/Icon/Expensicons'; -import {PressableWithFeedback} from '@components/Pressable'; -import Text from '@components/Text'; -import Tooltip from '@components/Tooltip'; -import useLocalize from '@hooks/useLocalize'; -import useTheme from '@hooks/useTheme'; -import useThemeStyles from '@hooks/useThemeStyles'; -import interceptAnonymousUser from '@libs/interceptAnonymousUser'; -import Navigation from '@libs/Navigation/Navigation'; -import * as App from '@userActions/App'; -import CONST from '@src/CONST'; - -type WorkspacesSectionHeaderProps = { - /** Should show the create workspace icon */ - shouldShowCreateWorkspaceIcon: boolean; -}; - -function WorkspacesSectionHeader({shouldShowCreateWorkspaceIcon}: WorkspacesSectionHeaderProps) { - const theme = useTheme(); - const styles = useThemeStyles(); - const {translate} = useLocalize(); - - return ( - - - - {translate('common.workspaces')} - - - {shouldShowCreateWorkspaceIcon && ( - - { - const activeRoute = Navigation.getActiveRouteWithoutParams(); - interceptAnonymousUser(() => App.createWorkspaceWithPolicyDraftAndNavigateToIt('', '', false, false, activeRoute)); - }} - > - {({hovered}) => ( - - )} - - - )} - - ); -} - -export default WorkspacesSectionHeader; diff --git a/src/pages/WorkspaceSwitcherPage/index.tsx b/src/pages/WorkspaceSwitcherPage/index.tsx index e418c5d5df59..7c1ca11b6442 100644 --- a/src/pages/WorkspaceSwitcherPage/index.tsx +++ b/src/pages/WorkspaceSwitcherPage/index.tsx @@ -24,7 +24,6 @@ import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; import {isEmptyObject} from '@src/types/utils/EmptyObject'; import WorkspaceCardCreateAWorkspace from './WorkspaceCardCreateAWorkspace'; -import WorkspacesSectionHeader from './WorkspacesSectionHeader'; type WorkspaceListItem = { text: string; @@ -183,7 +182,14 @@ function WorkspaceSwitcherPage() { pressableStyle={styles.flexRow} shouldSyncFocus={false} /> - + + + {translate('common.workspaces')} + + ListItem={UserListItem} sections={sections}