File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,8 +22,9 @@ import type { BottomTabBarProps } from '@react-navigation/bottom-tabs';
2222import { Animated , StyleSheet } from 'react-native' ;
2323import TabIcon from './TabIcon' ;
2424import { useTheme } from 'react-native-paper' ;
25+ import { useSafeAreaInsets } from 'react-native-safe-area-context' ;
2526
26- export const TAB_BAR_HEIGHT = 60 ;
27+ export const TAB_BAR_HEIGHT = 55 ;
2728
2829function CustomTabBar (
2930 props : BottomTabBarProps & {
@@ -40,12 +41,15 @@ function CustomTabBar(
4041) {
4142 const state = props . state ;
4243 const theme = useTheme ( ) ;
44+ const safeAreaInsets = useSafeAreaInsets ( ) ;
4345
4446 return (
4547 < Animated . View
4648 style = { {
4749 ...styles . bar ,
4850 backgroundColor : theme . colors . surface ,
51+ paddingBottom : safeAreaInsets . bottom ,
52+ height : TAB_BAR_HEIGHT + safeAreaInsets . bottom ,
4953 } }
5054 >
5155 { state . routes . map (
@@ -79,7 +83,6 @@ const styles = StyleSheet.create({
7983 bar : {
8084 flexDirection : 'row' ,
8185 width : '100%' ,
82- height : TAB_BAR_HEIGHT ,
8386 position : 'absolute' ,
8487 bottom : 0 ,
8588 left : 0 ,
Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ import {
3939 GeneralPreferenceKeys ,
4040} from '../utils/asyncStorage' ;
4141import { ParsedUrlDataType } from '../utils/URLHandler' ;
42+ import { useSafeAreaInsets } from 'react-native-safe-area-context' ;
4243
4344const styles = StyleSheet . create ( {
4445 header : {
@@ -103,6 +104,7 @@ const ICONS: {
103104} ;
104105
105106function TabNavigator ( props : PropsType ) {
107+ const safeAreaInsets = useSafeAreaInsets ( ) ;
106108 const { preferences } = usePreferences ( ) ;
107109 let defaultRoute = getPreferenceString (
108110 GeneralPreferenceKeys . defaultStartScreen ,
@@ -133,7 +135,7 @@ function TabNavigator(props: PropsType) {
133135 backBehavior = { 'initialRoute' }
134136 screenOptions = { {
135137 sceneStyle : {
136- paddingBottom : TAB_BAR_HEIGHT ,
138+ paddingBottom : TAB_BAR_HEIGHT + safeAreaInsets . bottom ,
137139 } ,
138140 } }
139141 >
You can’t perform that action at this time.
0 commit comments