diff --git a/packages/legacy/core/App/navigators/TabStack.tsx b/packages/legacy/core/App/navigators/TabStack.tsx index 04343e39f5..9281b94395 100644 --- a/packages/legacy/core/App/navigators/TabStack.tsx +++ b/packages/legacy/core/App/navigators/TabStack.tsx @@ -11,12 +11,14 @@ import { useNetwork } from '../contexts/network' import { useTheme } from '../contexts/theme' import { Screens, Stacks, TabStackParams, TabStacks } from '../types/navigators' import { TourID } from '../types/tour' +import { isTablet, orientation, Orientation } from '../utils/helpers' import { testIdWithKey } from '../utils/testable' import CredentialStack from './CredentialStack' import HomeStack from './HomeStack' const TabStack: React.FC = () => { + const { width, height } = useWindowDimensions() const { useCustomNotifications } = useConfiguration() const { total } = useCustomNotifications() const { t } = useTranslation() @@ -31,6 +33,14 @@ const TabStack: React.FC = () => { }, }) + const leftMarginForDevice = (width: number, height: number) => { + if (isTablet(width, height)) { + return orientation(width, height) === Orientation.Portrait ? 130 : 170 + } + + return 0 + } + return ( { + {showLabels && ( @@ -68,12 +78,15 @@ const TabStack: React.FC = () => { ), tabBarShowLabel: false, - tabBarBadge: total || undefined, - tabBarBadgeStyle: { backgroundColor: ColorPallet.semantic.error }, tabBarAccessibilityLabel: `${t('TabStack.Home')} (${ total === 1 ? t('Home.OneNotification') : t('Home.CountNotifications', { count: total || 0 }) })`, tabBarTestID: testIdWithKey(t('TabStack.Home')), + tabBarBadge: total || undefined, + tabBarBadgeStyle: { + marginLeft: leftMarginForDevice(width, height), + backgroundColor: ColorPallet.semantic.error, + }, }} />