Skip to content

Commit

Permalink
use WorkspaceSwitcherButton component
Browse files Browse the repository at this point in the history
  • Loading branch information
kosmydel committed Jan 5, 2024
1 parent f5509a7 commit d87b676
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ function BottomTabBar() {
// Parent navigator of the bottom tab bar is the root navigator.
const currentTabName = useNavigationState<RootStackParamList, string | undefined>((state) => {
const topmostBottomTabRoute = getTopmostBottomTabRoute(state);
if (topmostBottomTabRoute) {
return topmostBottomTabRoute.name;
}
return topmostBottomTabRoute?.name;
});

return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
import PropTypes from 'prop-types';
import React, {useCallback} from 'react';
import {View} from 'react-native';
import * as Expensicons from '@components/Icon/Expensicons';
import PressableWithFeedback from '@components/Pressable/PressableWithFeedback';
import Search from '@components/Search';
import SubscriptAvatar from '@components/SubscriptAvatar';
import WorkspaceSwitcherButton from '@components/WorkspaceSwitcherButton';
import useLocalize from '@hooks/useLocalize';
import useThemeStyles from '@hooks/useThemeStyles';
import Navigation from '@libs/Navigation/Navigation';
import SignInOrAvatarWithOptionalStatus from '@pages/home/sidebar/SignInOrAvatarWithOptionalStatus';
import * as Session from '@userActions/Session';
import CONST from '@src/CONST';
import ROUTES from '@src/ROUTES';

// TODO-IDEAL: isCreateMenuOpen wasn't used before
Expand All @@ -32,14 +29,7 @@ function TopBar({isCreateMenuOpen = false}) {
style={[styles.gap4, styles.flexRow, styles.ph5, styles.pv5, styles.justifyContentBetween, styles.alignItemsCenter]}
dataSet={{dragArea: true}}
>
<PressableWithFeedback role={CONST.ROLE.BUTTON}>
<SubscriptAvatar
mainAvatar={{source: Expensicons.ExpensifyAppIcon, name: 'Expensify', type: CONST.ICON_TYPE_AVATAR}}
subscriptIcon={{source: Expensicons.DownArrow, width: 8, height: 8}}
showTooltip={false}
noMargin
/>
</PressableWithFeedback>
<WorkspaceSwitcherButton />
<Search
placeholder={translate('sidebarScreen.buttonSearch')}
onPress={Session.checkIfActionIsAllowed(showSearchPage)}
Expand Down

0 comments on commit d87b676

Please sign in to comment.